msg121050 - (view) |
Author: Michael Hoffman (hoffman) |
Date: 2010-11-12 17:50 |
If you create a Pdb instance with an stdin argument, the default behavior is for commands to be retrieved using raw_input(), which uses sys.stdin instead, thereby causing the stdin argument to be without effect. You can work around this by setting the use_rawinput attribute of the instance to False, but this should be done whenever an stdin argument is given to the constructor. |
|
|
msg121109 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-11-13 04:22 |
This is a duplicate of issue 2571. If after reading that discussion you have ideas about and interest in working on the feature request as suggested, you may either comment on that one or open a new feature request, whichever seems clearer to you. Note that the pdb docs direct you the cmd docs, which clearly document the need to set use_rawinput, so this is not even a doc bug. |
|
|
msg121148 - (view) |
Author: Michael Hoffman (hoffman) |
Date: 2010-11-13 18:13 |
As always, it seems a bit more complicated than I originally expected. Since it's too late for a Python 2.x feature addition, I'll wait until I upgrade to 3.x to work on that. You are correct, technically this is not a docs bug but I think the clarity of the docs would be greatly improved if you would add the text from the cmd module docs to the pdb docs: "If you want a given stdin to be used, make sure to set the instance’s use_rawinput attribute to False, otherwise stdin will be ignored." I hope you will agree that this is unexpected behavior that doesn't really fit into the zen of Python. |
|
|
msg121542 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-11-19 15:44 |
+1 on clarifying the docs. Michael, where in the file do you think it should go? (You can also directly make a diff if you want.) |
|
|
msg121552 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-11-19 16:52 |
The argument against adding this to the pdb docs is that if you pull in that statement from cmd, you really ought to pull in the full description of the __init__ arguments. And whether you do that or just pull in that single statement, you are duplicating the documentation from cmd. This *may* be best, but it does increase the maintenance burden, since any change to cmd will require changes to both the cmd and pdb docs, whereas now someone changing cmd doesn't need to know that they also have to update pdb. If the situation being documented here improves in some way, I'll bet we will forget to update the pdb docs accordingly.... So, I'm -1 on adding this to the pdb docs, but will bow to the wisdom of the doc folks :) |
|
|
msg121553 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-11-19 17:02 |
This is a sound argument. I had also missed your comment “Note that the pdb docs direct you the cmd docs, which clearly document the need to set use_rawinput, so this is not even a doc bug”, which I was about to write with other words :) There was actually no need to reopen this bug. |
|
|