Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.5 Bug: No need to import izip #40

Closed
dvf opened this issue Dec 30, 2017 · 3 comments
Closed

Python 3.5 Bug: No need to import izip #40

dvf opened this issue Dec 30, 2017 · 3 comments

Comments

@dvf
Copy link

dvf commented Dec 30, 2017

Firstly, thanks for the wonderful reference implementation!

dvf@ubuntu-us-nyc-01:~ twistd -noy server.tac 
Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/twisted/application/app.py", line 662, in run
    runApp(config)
  File "/usr/local/lib/python3.5/dist-packages/twisted/scripts/twistd.py", line 25, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/local/lib/python3.5/dist-packages/twisted/application/app.py", line 380, in run
    self.application = self.createOrGetApplication()
  File "/usr/local/lib/python3.5/dist-packages/twisted/application/app.py", line 445, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/usr/local/lib/python3.5/dist-packages/twisted/application/app.py", line 456, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/usr/local/lib/python3.5/dist-packages/twisted/application/service.py", line 412, in loadApplication
    application = sob.loadValueFromFile(filename, 'application')
  File "/usr/local/lib/python3.5/dist-packages/twisted/persisted/sob.py", line 177, in loadValueFromFile
    eval(codeObj, d, d)
  File "server.tac", line 7, in <module>
    from kademlia.network import Server
  File "/usr/local/lib/python3.5/dist-packages/kademlia/network.py", line 13, in <module>
    from kademlia.storage import ForgetfulStorage
  File "/usr/local/lib/python3.5/dist-packages/kademlia/storage.py", line 2, in <module>
    from itertools import izip
builtins.ImportError: cannot import name 'izip'

Since Twisted supports 3.6, how about:

try:
    from itertools import izip
except ImportError:
    from itertools import zip
...
@bmuller
Copy link
Owner

bmuller commented Dec 31, 2017

There's a python 3.5 branch that doesn't use Twisted, I recommend just using that. I don't think I'll be supporting 2.7 or Twisted going forward.

@bmuller bmuller closed this as completed Dec 31, 2017
@dvf
Copy link
Author

dvf commented Jan 1, 2018

Awesome. I didn't see that. Thanks @bmuller

Are there any plans to add the Python 3 build to pypi?

@bmuller
Copy link
Owner

bmuller commented Jan 2, 2018

Yep! Just added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants