[Twisted-Python] Possible bug
![](https://secure.gravatar.com/avatar/8c7dc64a3da0fd9a08744a9fa4d06d31.jpg?s=120&d=mm&r=g)
Hi all, Using windows 10 with Python 3.5, importing pretty much anything gives me the following error. Not sure if there's something wrong with my configuration or if it's a bug... I seem to remember something a while back, should I file a ticket? Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\python35\lib\site-packages\twisted\internet\reactor.py", line 38, in <module> from twisted.internet import default File "C:\python35\lib\site-packages\twisted\internet\default.py", line 56, in <module> install = _getInstallFunction(platform) File "C:\python35\lib\site-packages\twisted\internet\default.py", line 50, in _getInstallFunction from twisted.internet.selectreactor import install File "C:\python35\lib\site-packages\twisted\internet\selectreactor.py", line 18, in <module> from twisted.internet import posixbase File "C:\python35\lib\site-packages\twisted\internet\posixbase.py", line 18, in <module> from twisted.internet import error, udp, tcp File "C:\python35\lib\site-packages\twisted\internet\udp.py", line 53, in <module> from twisted.internet import base, defer, address File "C:\python35\lib\site-packages\twisted\internet\base.py", line 23, in <module> from twisted.internet import fdesc, main, error, abstract, defer, threads File "C:\python35\lib\site-packages\twisted\internet\defer.py", line 29, in <module> from twisted.python import lockfile, failure File "C:\python35\lib\site-packages\twisted\python\lockfile.py", line 52, in <module> _open = file NameError: name 'file' is not defined Cheers,
![](https://secure.gravatar.com/avatar/3d37232726396a1d3c7412dd915095ea.jpg?s=120&d=mm&r=g)
Hi Chris, Twisted does not yet support Python 3 on Windows. There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows. - Amber
![](https://secure.gravatar.com/avatar/8c7dc64a3da0fd9a08744a9fa4d06d31.jpg?s=120&d=mm&r=g)
Hi Amber On 31/10/2015 06:45, Amber "Hawkie" Brown wrote:
Hi Chris,
Twisted does not yet support Python 3 on Windows.
That's a shame. I've never contributed to an open source project before, but I'd be glad to try and help out. I feel I __may__ know enough Python now to certainly have a shot at it.
There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows.
As above, if I can help, please tell me how! Cheers,
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
If you feel like you might, you definitely do :-). Often people feel like they need to be advanced rocket surgeons to work on Twisted, but in fact, our robust code-review process means that you don't have to worry about making mistakes at all. Just submit your best effort, and you'll get a code review telling you how to improve it so that it can be integrated (and you _will_ get at least one round of review: I created Twisted, and even _I_ can't usually land a patch without one or two rounds of review ;-)). Thanks for offering to help out! If everybody who wanted Python 3 support just signed on to work on a ticket like this, the port would have been finished a year ago ;-).
There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket <https://twistedmatrix.com/trac/ticket/8025#ticket> which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows. As above, if I can help, please tell me how!
Our toolchain is a little clunky (sorry about that) for hysterical raisins. Before I launch into an explanation though, are you already familiar with Git and/or how to contribute on GitHub? -glyph
![](https://secure.gravatar.com/avatar/c194a4d2f2f8269aa052942e87985198.jpg?s=120&d=mm&r=g)
On 31 October 2015 at 10:03, Chris Norman <chris.norman2@googlemail.com> wrote:
This is some info about contributing http://twistedmatrix.com/trac/wiki/TwistedDevelopment For git you should check http://twistedmatrix.com/trac/wiki/GitMirror Join the #twisted-dev channel and maybe get in touch with Amber to see if you can continue her great porting work :) Regards, Adi
-- Adi Roiban
![](https://secure.gravatar.com/avatar/8c7dc64a3da0fd9a08744a9fa4d06d31.jpg?s=120&d=mm&r=g)
Hi, So I went on the net on the off chance that the info I was looking for was easy to obtain, and I found out about trial. I cloned the git and did: python bin/trial twisted I got the following: Unhandled Error Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 473, in postOptions _BasicOptions.postOptions(self) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 383, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 370, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 213, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 171, in getCache provider = pluginModule.load() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\modules.py", line 389, in load return self.pathEntry.pythonPath.moduleLoader(self.name) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\reflect.py", line 303, in namedAny topLevelPackage = _importAndCheckStack(trialname) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\reflect.py", line 242, in _importAndCheckStack return __import__(importName) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugins\twisted_core.py", line 5, in <module> from twisted.internet.endpoints import _SystemdParser, _TCP6ServerParser, _StandardIOParser File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\endpoints.py", line 34, in <module> from twisted.internet.stdio import StandardIO, PipeAddress File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\stdio.py", line 30, in <module> from twisted.internet import _win32stdio File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_win32stdio.py", line 15, in <module> from twisted.internet import _pollingfile, main File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_pollingfile.py", line 106, in <module> class _PollableReadPipe(_PollableResource): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_pollingfile.py", line 108, in _PollableReadPipe implements(IPushProducer) File "C:\python35\lib\site-packages\zope\interface\declarations.py", line 412, in implements raise TypeError(_ADVICE_ERROR % 'implementer') builtins.TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. Unexpected error while writing cache file Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 473, in postOptions _BasicOptions.postOptions(self) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 383, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 370, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 213, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 185, in getCache dropinPath.setContent(pickle.dumps(dropinDotCache)) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\filepath.py", line 1532, in setContent os.rename(sib.path, self.path) builtins.ValueError: rename: src and dst must be the same type Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 91, in symlink rename(newlinkname, filename) FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock.1446280185217.newlink' -> 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bin/trial", line 22, in <module> run() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 616, in run test_result = trialRunner.run(suite) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 959, in run return self._runWithoutDecoration(test, self._forceGarbageCollection) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 983, in _runWithoutDecoration oldDir = self._setUpTestdir() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 886, in _setUpTestdir testdir, self._testDirLock = util._unusedTestDirectory(base) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\util.py", line 356, in _unusedTestDirectory if testDirLock.lock(): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 160, in lock symlink(str(os.getpid()), self.name) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 94, in symlink os.rmdir(newlinkname) OSError: [WinError 145] The directory is not empty: 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock.1446280185217.newlink' Is that a trial error or a Twisted test failing? Sorry if this is a stupid question, but (terrible, I know) I've never used tests before. Another quick google told me that Trial was ported to Python3, so I'm not sure... If it's a test failing, it's not really telling me where the failure is. Cheers. On 31/10/2015 07:39, Glyph Lefkowitz wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Not _all_ of Twisted has been ported to Python 3, so if you run the full test suite (that's what "trial twisted" does) some of it will fail. If you want to run the parts that are expected to pass, run `python admin/run-python3-tests´. If those fail then we have a problem :). -glyph
![](https://secure.gravatar.com/avatar/3d37232726396a1d3c7412dd915095ea.jpg?s=120&d=mm&r=g)
Hi Chris, Twisted does not yet support Python 3 on Windows. There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows. - Amber
![](https://secure.gravatar.com/avatar/8c7dc64a3da0fd9a08744a9fa4d06d31.jpg?s=120&d=mm&r=g)
Hi Amber On 31/10/2015 06:45, Amber "Hawkie" Brown wrote:
Hi Chris,
Twisted does not yet support Python 3 on Windows.
That's a shame. I've never contributed to an open source project before, but I'd be glad to try and help out. I feel I __may__ know enough Python now to certainly have a shot at it.
There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows.
As above, if I can help, please tell me how! Cheers,
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
If you feel like you might, you definitely do :-). Often people feel like they need to be advanced rocket surgeons to work on Twisted, but in fact, our robust code-review process means that you don't have to worry about making mistakes at all. Just submit your best effort, and you'll get a code review telling you how to improve it so that it can be integrated (and you _will_ get at least one round of review: I created Twisted, and even _I_ can't usually land a patch without one or two rounds of review ;-)). Thanks for offering to help out! If everybody who wanted Python 3 support just signed on to work on a ticket like this, the port would have been finished a year ago ;-).
There's a ticket at https://twistedmatrix.com/trac/ticket/8025#ticket <https://twistedmatrix.com/trac/ticket/8025#ticket> which makes all the tests pass on the platform; I just need to work on it some more. I expect Twisted 16.0 to have base support for Python 3 on Windows. As above, if I can help, please tell me how!
Our toolchain is a little clunky (sorry about that) for hysterical raisins. Before I launch into an explanation though, are you already familiar with Git and/or how to contribute on GitHub? -glyph
![](https://secure.gravatar.com/avatar/c194a4d2f2f8269aa052942e87985198.jpg?s=120&d=mm&r=g)
On 31 October 2015 at 10:03, Chris Norman <chris.norman2@googlemail.com> wrote:
This is some info about contributing http://twistedmatrix.com/trac/wiki/TwistedDevelopment For git you should check http://twistedmatrix.com/trac/wiki/GitMirror Join the #twisted-dev channel and maybe get in touch with Amber to see if you can continue her great porting work :) Regards, Adi
-- Adi Roiban
![](https://secure.gravatar.com/avatar/8c7dc64a3da0fd9a08744a9fa4d06d31.jpg?s=120&d=mm&r=g)
Hi, So I went on the net on the off chance that the info I was looking for was easy to obtain, and I found out about trial. I cloned the git and did: python bin/trial twisted I got the following: Unhandled Error Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 473, in postOptions _BasicOptions.postOptions(self) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 383, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 370, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 213, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 171, in getCache provider = pluginModule.load() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\modules.py", line 389, in load return self.pathEntry.pythonPath.moduleLoader(self.name) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\reflect.py", line 303, in namedAny topLevelPackage = _importAndCheckStack(trialname) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\reflect.py", line 242, in _importAndCheckStack return __import__(importName) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugins\twisted_core.py", line 5, in <module> from twisted.internet.endpoints import _SystemdParser, _TCP6ServerParser, _StandardIOParser File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\endpoints.py", line 34, in <module> from twisted.internet.stdio import StandardIO, PipeAddress File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\stdio.py", line 30, in <module> from twisted.internet import _win32stdio File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_win32stdio.py", line 15, in <module> from twisted.internet import _pollingfile, main File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_pollingfile.py", line 106, in <module> class _PollableReadPipe(_PollableResource): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\internet\_pollingfile.py", line 108, in _PollableReadPipe implements(IPushProducer) File "C:\python35\lib\site-packages\zope\interface\declarations.py", line 412, in implements raise TypeError(_ADVICE_ERROR % 'implementer') builtins.TypeError: Class advice impossible in Python3. Use the @implementer class decorator instead. Unexpected error while writing cache file Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 473, in postOptions _BasicOptions.postOptions(self) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 383, in postOptions self['reporter'] = self._loadReporterByName(self['reporter']) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 370, in _loadReporterByName for p in plugin.getPlugins(itrial.IReporter): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 213, in getPlugins allDropins = getCache(package) --- <exception caught here> --- File "C:\Users\chris\Dropbox\SRC\twisted\twisted\plugin.py", line 185, in getCache dropinPath.setContent(pickle.dumps(dropinDotCache)) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\filepath.py", line 1532, in setContent os.rename(sib.path, self.path) builtins.ValueError: rename: src and dst must be the same type Traceback (most recent call last): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 91, in symlink rename(newlinkname, filename) FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock.1446280185217.newlink' -> 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "bin/trial", line 22, in <module> run() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\scripts\trial.py", line 616, in run test_result = trialRunner.run(suite) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 959, in run return self._runWithoutDecoration(test, self._forceGarbageCollection) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 983, in _runWithoutDecoration oldDir = self._setUpTestdir() File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\runner.py", line 886, in _setUpTestdir testdir, self._testDirLock = util._unusedTestDirectory(base) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\trial\util.py", line 356, in _unusedTestDirectory if testDirLock.lock(): File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 160, in lock symlink(str(os.getpid()), self.name) File "C:\Users\chris\Dropbox\SRC\twisted\twisted\python\lockfile.py", line 94, in symlink os.rmdir(newlinkname) OSError: [WinError 145] The directory is not empty: 'C:\\Users\\chris\\Dropbox\\SRC\\twisted\\_trial_temp.lock.1446280185217.newlink' Is that a trial error or a Twisted test failing? Sorry if this is a stupid question, but (terrible, I know) I've never used tests before. Another quick google told me that Trial was ported to Python3, so I'm not sure... If it's a test failing, it's not really telling me where the failure is. Cheers. On 31/10/2015 07:39, Glyph Lefkowitz wrote:
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
Not _all_ of Twisted has been ported to Python 3, so if you run the full test suite (that's what "trial twisted" does) some of it will fail. If you want to run the parts that are expected to pass, run `python admin/run-python3-tests´. If those fail then we have a problem :). -glyph
participants (5)
-
Adi Roiban
-
Amber "Hawkie" Brown
-
Chris Norman
-
Glyph Lefkowitz
-
Hawkie