[Twisted-Python] error on log module (twisted python 3)

Gelin Yan dynamicgl at gmail.com
Tue Sep 8 01:57:27 MDT 2015


On Tue, Sep 8, 2015 at 3:16 PM, Glyph <glyph at twistedmatrix.com> wrote:

>
>
> On Sep 7, 2015, at 11:48 PM, Gelin Yan <dynamicgl at gmail.com> wrote:
>
> Hi All
>
>     I just noticed my app raised an exception such as
>
> Traceback (most recent call last):
>
>   File "/home/m/py343/lib/python3.4/runpy.py", line 170, in
> _run_module_as_main
>
>     "__main__", mod_spec)
>
>   File "/home/m/py343/lib/python3.4/runpy.py", line 85, in _run_code
>
>     exec(code, run_globals)
>
>   File "gw_go.zip/__main__.py", line 8, in <module>
>
>   File "gw_go.zip/gw_server2/gw_go.py", line 87, in main
>
>   File
> "/home/m/py343/lib/python3.4/site-packages/twisted/python/logfile.py", line
> 48, in fromFullPath
>
>     os.path.dirname(logPath), *args, **kwargs)
>
>   File
> "/home/m/py343/lib/python3.4/site-packages/twisted/python/logfile.py", line
> 40, in __init__
>
>     self._openFile()
>
>   File
> "/home/m/py343/lib/python3.4/site-packages/twisted/python/logfile.py", line
> 238, in _openFile
>
>     BaseLogFile._openFile(self)
>
>   File
> "/home/m/py343/lib/python3.4/site-packages/twisted/python/logfile.py", line
> 75, in _openFile
>
>     self._file = file(self.path, "w+", 1)
>
> NameError: name 'file' is not defined
>
>
>      I used python 3.4 and twisted 15.40 (from pip) under ubuntu 14.04.
>
>
> twisted.python.logfile was not fully ported as of Twisted 15.4; just the
> syntax.  So this error is expected.  However, you may be pleased to hear
> that the fix landed last week: https://twistedmatrix.com/trac/ticket/6749 and
> will be in 15.5.
>
> -glyph
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
Hi Glyph

    I just found out the ticket you mentioned. It looks like 15.4 doesn't
include it. I am waiting for the next release. For now, I have to use the
standard logging system.

Regards

gelin yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20150908/fd9f9c52/attachment.html>


More information about the Twisted-Python mailing list