-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Click 7.0 ctx.exit() hangs. #1134
Comments
Use |
@thechief389 that's not a replacement for what's being reported here. |
What I was saying was that it could be a work around until it's fixed. |
@thechief389 using |
Sorry, I haven't kept up very well with open issues lately. Thanks for tagging me. I just fired up an Ubuntu 16.04 machine to try to test this out right now, but I haven't been able to reproduce yet. I'm starting to look at the relevant mailman test to see if I can figure this out. |
@sirosen The issue occurs outside of the test suite. It occurs with various |
Okay, I've got a lot to unpack here, but let's start with the most important bit of good news: this code reproduces the bug. I am not sure if the bad interaction with Tinkering with
Another bit of relevant info: I can't seem to inspect the call stack when the except Exit as e:
if standalone_mode:
print('! checkpoint1')
ty, val, trace = sys.exc_info()
print('! checkpoint2')
stack = traceback.extract_tb(trace, limit=10)
print('! checkpoint3')
print(traceback.format_list(stack))
print('! checkpoint4')
sys.exit(e.exit_code) and the output I see is
with the process spinning at 100% CPU. So I feel like something badly weird is happening to the state of the interpreter. It's pretty clear that |
I'm finding that a context manager defined as a class with @davidism, is it too much to suggest that maybe |
Generator context managers swallowed RuntimeErrors in 3.5.2 (BPO-27122), which was fixed in 3.5.3. |
Closing as it sounds like this was a bug that was fixed in Python 3.5.2, not an issue with Click. |
This is a mysterious issue. I an a GNU Mailman developer and more detail is at https://gitlab.com/mailman/mailman/issues/520. I have narrowed the cause to the commit at 1602436.
We use click for our
mailman
command interface. Themailman
command has a number of sub-commands. The issue is two of these sub-commands under some conditions callctx.exit()
and instead of exiting at that point, the process just hangs and never exits until it is manually killed. Further, the sub-commands all have their own --help and that too prints the help and hangs, but the mainmailman --help
does exit normally after printing the help.This may have something to do with how we implement the sub-commands and I will try to provide more detail upon request.
The mystery is this hanging behavior only occurs in certain environments. I have observed it on three different Ubuntu 16.04 machines with Python 3.5.2 and bash and also on one of those with tcsh. I am unable to duplicate it on Mac OS 10.13.6 with Python 3.7.2. Another developer has tried and can't reproduce it with combinations of Python 3.6 and 3.7 under bash and zsh. It also doesn't hang under Python 3.5, 3.6 or 3.7 on our GitLab CI.
Also, I have run tox against the HEAD of the click master branch on one of the Ubuntu 16.04 machines and both py35 and py27 pass 196 tests with one expected failure.
The text was updated successfully, but these errors were encountered: