This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: pdb should set stdin+stdout around exec call
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0, Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum
Priority: low Keywords: easy, patch

Created on 2008-01-11 01:05 by gvanrossum, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
pdb.diff gvanrossum, 2008-01-11 01:05
pdb.diff gvanrossum, 2008-01-15 01:43 new fix
Messages (3)
msg59686 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-01-11 01:05
When you type a command in pdb that happens to print something, the
output goes to sys.stdout, even if self.stdout references another file.
 This makes it hard to debug code running inside a web server where
sys.stdout/stdout are connected to a socket (or a WSGI wrapper file);
the output "disappears" and ends up messing up the response.

Attached is a fix that temporarily changes sys.stdin/stdout to the
debugger's input and output.  What do people think of this?
msg59951 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-01-15 01:43
Here's an improved patch -- the recursive debugger invocation should
pass the I/O settings on.
msg59979 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-01-15 18:00
Committed revision 59984 (2.6).
Decided not to backport this to 2.5.
Date User Action Args
2022-04-11 14:56:29adminsetgithub: 46119
2008-01-15 18:00:24gvanrossumsetstatus: open -> closed
resolution: fixed
messages: + msg59979
versions: - Python 2.5
2008-01-15 01:43:22gvanrossumsetkeywords: + easy
assignee: gvanrossum
messages: + msg59951
files: + pdb.diff
2008-01-11 01:05:11gvanrossumsetkeywords: + patch
2008-01-11 01:05:05gvanrossumcreate