Author idank
Recipients idank
Date 2011-08-24.17:00:11
SpamBayes Score 3.22037e-12
Marked as misclassified No
Message-id <>
import sys, readline

sys.stdout.write('foo ')

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:

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).
Date User Action Args
2011-08-24 17:00:12idanksetrecipients: + idank
2011-08-24 17:00:12idanksetmessageid: <>
2011-08-24 17:00:11idanklinkissue12833 messages
2011-08-24 17:00:11idankcreate