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

controller.authenticate() hanging if not inside "with" block #115

Closed
JeremyRand opened this issue Jan 9, 2022 · 3 comments
Closed

controller.authenticate() hanging if not inside "with" block #115

JeremyRand opened this issue Jan 9, 2022 · 3 comments

Comments

@JeremyRand
Copy link

I have the following two test programs, which look to me like they should behave the same:

$ cat both.py 
from stem.control import Controller

with Controller.from_port() as controller:

    print("Authenticating...")
    controller.authenticate()

    print("Tor is running version %s" % controller.get_version())
$ cat only-1.8.0.py 
from stem.control import Controller

controller = Controller.from_port()

print("Authenticating...")
controller.authenticate()

print("Tor is running version %s" % controller.get_version())

With Stem 1.8.0, they both work as expected:

$ python3 both.py 
Authenticating...
Tor is running version 0.4.5.11
$ python3 only-1.8.0.py 
Authenticating...
Tor is running version 0.4.5.11

With Stem master branch (commit hash 4ead96c), one of them works as expected...

$ python3 both.py 
Authenticating...
Tor is running version 0.4.5.11

...but the other one hangs at controller.authenticate() without exiting:

$ python3 only-1.8.0.py 
Authenticating...

It's not clear to me why Stem master causes these two programs to behave differently. I assume it's a Stem bug, since both of these programs seem like they should work, and it's definitely a breaking change from 1.8.0.

Any ideas?

@JeremyRand
Copy link
Author

Python 3.9.9 on Fedora ppc64le if it matters.

@atagar
Copy link
Contributor

atagar commented Jan 9, 2022

Hi Jeremy. This is caused by: #77

@atagar atagar closed this as completed Jan 9, 2022
@JeremyRand
Copy link
Author

Ah, that makes sense. Thanks Damian!

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