Author idank
Recipients idank
Date 2011-08-24.17:00:11
SpamBayes Score 3.22037e-12
Marked as misclassified No
Message-id <1314205212.4.0.313319940132.issue12833@psf.upfronthosting.co.za>
In-reply-to
Content
import sys, readline

sys.stdout.write('foo ')
raw_input()

When trying the above on Debian, 2.6.6 using gnome-terminal, typing a character then hitting backspace deletes "foo " as well.

I'm not sure if this is a bug or the expected behavior when writing to stdout directly rather than passing the string to raw_input() (for my particular use case that's not an option though).

One possible workaround seems to be to delete the trailing space from write() and move it to raw_input:

sys.stdout.write('foo')
raw_input(' ')

Then backspace seems to work properly. This has something to do with readline because when it's not imported, it also works as expected (but other things break obviously).
History
Date User Action Args
2011-08-24 17:00:12idanksetrecipients: + idank
2011-08-24 17:00:12idanksetmessageid: <1314205212.4.0.313319940132.issue12833@psf.upfronthosting.co.za>
2011-08-24 17:00:11idanklinkissue12833 messages
2011-08-24 17:00:11idankcreate