-
Notifications
You must be signed in to change notification settings - Fork 230
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
“I/O operation on closed file” when try with "Debugging from a separate terminal" #598
Comments
I’m also having this issue, which is problematic because when the app I’m debugging prints anything, the pudb UI disappears until I terminate the app. |
I believe I’ve found an alternative way to achieve the PUDB_TTY trick, instead of setting the end var, if you redirect stein to be the tty, it seems to work: $ tty
/dev/pts/17
$ perl -MPOSIX -e pause
$ pudb something.py args < /dev/pts/17
# TUI appears if you also pipe the output into that tty, you end up with the UI being drawn in the first terminal, and being able to interact with it there.
Looks like the issue above isn’t related to to printing to stdout (they were just correlated in time), something strange seems to be happening with tkinter which causes the tui to disappear completely sometime before the main window appears. |
The latest version
also gives me
😕 |
Also seems to be related to #317 (comment)? |
I successfully git bisected this. Reverting one-line commit 277980e (July 2022) avoids this issue. That Revert successfully tested on top of current version 8c8f9d4. I don't know yet if this revert has any undesired side-effect; I only found this right now and wanted to share this "breakthrough" ASAP. That commit message and the corresponding PR #534 were both empty. I will for sure use that one-line revert "in anger" and report back if I find any problem. --- a/pudb/__init__.py
+++ b/pudb/__init__.py
@@ -80,6 +80,7 @@ def _get_debugger(**kwargs):
kwargs.setdefault("stdin", tty_file)
kwargs.setdefault("stdout", tty_file)
kwargs.setdefault("term_size", term_size)
+ tty_file.close()
from pudb.debugger import Debugger
dbg = Debugger(**kwargs) |
That's awesome work! Can you contribute your testing methodology? 🙏 |
Can you confirm it works for you too?
|
This revert did not last long. It makes PUDB_TTY go further but things are still not OK: many keys don't work and the terminal acts strangely. Even without a commit message I guess this line was there for a reason. Instead I installed the last official release before this commit and so far things seem to work: |
I'm having this issue too, and for me removing tty_file.close() call fixed the problem entirely. |
I also had the same issues and removing the |
Same here, so I made a PR. |
Fixed by #656. |
Hi, I met “I/O operation on closed file” when try with "Debugging from a separate terminal" at https://documen.tician.de/pudb/starting.html#debugging-from-a-separate-terminal.
I'm using conda with below versions:
my python code:
On the first terminal, I tried with:
On the second terminal, I met the below issue. Should I run with 'root'? thanks.
The text was updated successfully, but these errors were encountered: