◐ Shell
clean mode source ↗

Message 116524 - Python tracker

One could argue of course that every user of Python should handle EINTR, but that's something I think should be solved in the IO library because very few people know that one is supposed to restart syscalls on EINTR on POSIX systems.

Ruby for instance handles EINTR properly:

mitsuhiko@nausicaa:~$ ruby -e 'puts $stdin.read.inspect'
^Z
[1]+  Stopped
mitsuhiko@nausicaa:~$ fg
ruby -e 'puts $stdin.read.inspect'
test
"test\n"



So does perl:

mitsuhiko@nausicaa:~$ perl -e 'chomp($x = <STDIN>); print $x'
^Z
[1]+  Stopped
mitsuhiko@nausicaa:~$ fg
perl -e 'chomp($x = <STDIN>); print $x'
test
test