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

README examples broken in python 3.8 #10

Closed
CorruptCommit opened this issue Nov 14, 2019 · 2 comments
Closed

README examples broken in python 3.8 #10

CorruptCommit opened this issue Nov 14, 2019 · 2 comments

Comments

Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
@CorruptCommit
Copy link

@CorruptCommit CorruptCommit commented Nov 14, 2019

With the recent update to python 3.8, the examples on the README no loner work.

pipenv run python --version
Python 3.8.0
pipenv run python TorRequest-example-short.py
Traceback (most recent call last):
  File "TorRequest-example-short.py", line 3, in <module>
    with TorRequest() as tr:
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/torrequest.py", line 24, in __init__
    self.ctrl.authenticate(password=password)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 1100, in authenticate
    stem.connection.authenticate(self, *args, **kwargs)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/connection.py", line 592, in authenticate
    controller._post_authentication()
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 3902, in _post_authentication
    owning_pid = self.get_conf('__OwningControllerProcess', None)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 2170, in get_conf
    entries = self.get_conf_map(param, default, multiple)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 2273, in get_conf_map
    for key in reply:
RuntimeError: dictionary keys changed during iteration

The longer example has an extra ' at the end of line 17 (look for data and auth). Once the syntax is corrected, here is the same error:

pipenv run python TorRequest-example-long.py
Traceback (most recent call last):
  File "TorRequest-example-long.py", line 9, in <module>
    with TorRequest(proxy_port=9050, ctrl_port=9051, password=None) as tr:
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/torrequest.py", line 24, in __init__
    self.ctrl.authenticate(password=password)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 1100, in authenticate
    stem.connection.authenticate(self, *args, **kwargs)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/connection.py", line 592, in authenticate
    controller._post_authentication()
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 3902, in _post_authentication
    owning_pid = self.get_conf('__OwningControllerProcess', None)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 2170, in get_conf
    entries = self.get_conf_map(param, default, multiple)
  File "/home/user/.local/share/virtualenvs/gitlab-build-status-iwiHKajp/lib/python3.8/site-packages/stem/control.py", line 2273, in get_conf_map
    for key in reply:
RuntimeError: dictionary keys changed during iteration
@CorruptCommit
Copy link
Author

@CorruptCommit CorruptCommit commented Nov 17, 2019

Looks to be a bug with stem, see this ticket.

@CorruptCommit
Copy link
Author

@CorruptCommit CorruptCommit commented Jan 9, 2020

Now that stem 1.8.0 has been released, this issue has been corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment