Comments (12)
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.
from pudb.
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.
Sadly this doesn’t solve the issue I have that when the app prints anything, the tui disappears completely in the second shell, and doesn’t reappear until the app exits. sending Ctrl-l via the first terminal doesn’t seem to redraw. Surely I’m not the first person to ever debug an app that logs to stdout?
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.
from pudb.
The latest version
Installing collected packages: pudb
Attempting uninstall: pudb
Found existing installation: pudb 2022.1.3
Uninstalling pudb-2022.1.3:
Successfully uninstalled pudb-2022.1.3
Successfully installed pudb-2023.1
also gives me
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 466, in user_line
self.interaction(frame)
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 436, in interaction
self.ui.call_with_ui(self.ui.interaction, exc_tuple,
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 2540, in call_with_ui
self.show()
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 2531, in show
self.screen.start()
File ".venv/lib/python3.11/site-packages/urwid/display_common.py", line 813, in start
self._start(*args, **kwargs)
File ".venv/lib/python3.11/site-packages/urwid/raw_display.py", line 222, in _start
self.write(escape.SWITCH_TO_ALTERNATE_BUFFER)
File ".venv/lib/python3.11/site-packages/urwid/raw_display.py", line 286, in write
self._term_output_file.write(data)
ValueError: I/O operation on closed file.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 2456, in show_internal_exc_dlg
self._show_internal_exc_dlg(exc_tuple)
File ".venv/lib/python3.11/site-packages/pudb/debugger.py", line 2479, in _show_internal_exc_dlg
urwid=".".join(map(str, urwid.version.version)),
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'urwid.version' has no attribute 'version'
😕
from pudb.
Also seems to be related to #317 (comment)?
from pudb.
ValueError: I/O operation on closed file.
I successfully git bisected this. Reverting one-line commit 277980e (July 2022) avoids this issue. That tty.close()
really does look like a smoking gun!
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)
from pudb.
That's awesome work!
Can you contribute your testing methodology? 🙏
from pudb.
That's awesome work!
Can you confirm it works for you too?
Can you contribute your testing methodology?
export PUDB_TTY=/dev/pts/X
./try-the-debugger.sh
from pudb.
I will for sure use that one-line revert "in anger" and report back if I find any problem.
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: pip install pudb==2022.1.2
https://pypi.org/project/pudb/#history
from pudb.
I'm having this issue too, and for me removing tty_file.close() call fixed the problem entirely.
from pudb.
I also had the same issues and removing the tty_file.close()
fixed the issue entirely.
from pudb.
Related Issues (20)
- remote debugging - Cannot disable application log message from garbling up the PuDB UI screen HOT 3
- Pudb UI Exception Encountered: Object 'A' appears to be a sequence, but does not behave like one: iteration over a 0-d tensor HOT 1
- Disable "view output" in remote debug HOT 1
- Error reported when exiting iPython and returning to UI on Mac OS X HOT 3
- Please make this marvel run well on a-Shell app for iPad HOT 1
- "Debugger instance already exists" when used in pytest HOT 5
- Greyscale Theme HOT 4
- New Release HOT 1
- Unable to use `--pdb --pdbcls=pudb.debugger:Debugger` with latest versions of urwid HOT 2
- telnetlib (used for remote debugger) is deprecated in Python 3.12 HOT 4
- Run to line in the same frame HOT 1
- Allow setting term size via env var HOT 1
- PUDB freezes at welcome screen HOT 2
- export PUDB_TTY=... not working HOT 1
- how can i see or get the current debugged file path?
- Ipython StartUp Script for pudb python shell. HOT 3
- remote debugging with telnet fails: a Debugger instance already exists HOT 2
- 2024.1 display clobbered with internal pudb [DEBUG] messages. HOT 11
- Variable ListBox crashes for long variables repr HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pudb.