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.

Author sriram
Recipients georg.brandl, ncoghlan, ping, sriram, wosc
Date 2010-04-27.17:52:33
SpamBayes Score 1.788265e-09
Marked as misclassified No
Message-id <1272390756.88.0.622898737626.issue5727@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

I believe this behaviour can be tested if we can prove that Cmd's cmdloop uses raw_input to get the data as against self.stdin.readline().

To test it, ideally I would have liked to override sys.stdin with a fake input stream and pass the list of args (like it's done in test_doctest.py). I can then pass the character codes for Up and Down Arrows in our fake stream and check if the raw_input can use readline and move through the fake input stream but that won't be possible because the C implementation of raw_input uses the readline functionality if only both stdin and stdout are from a terminal.

So alternatively, if we can just ensure that doctest's pdb (_OutputREdirectingPdb) has use_rawinput as 1, we can be assured that readline will be used.

I have attached the svn diff with trunk. Please review and comment

Thanks
Sriram
History
Date User Action Args
2010-04-27 17:52:37sriramsetrecipients: + sriram, ping, georg.brandl, ncoghlan, wosc
2010-04-27 17:52:36sriramsetmessageid: <1272390756.88.0.622898737626.issue5727@psf.upfronthosting.co.za>
2010-04-27 17:52:35sriramlinkissue5727 messages
2010-04-27 17:52:34sriramcreate