Last active
August 29, 2015 14:27
-
-
Save franckverrot/bc34b588580cff836c87 to your computer and use it in GitHub Desktop.
Python vs Ruby on a closed stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### Python | |
λ (echo 'before'; exec 1>&-; python -c 'print("after")') | |
before | |
close failed in file object destructor: | |
sys.excepthook is missing | |
lost sys.stderr | |
### Ruby | |
λ (echo 'before'; exec 1>&-; ruby -e 'puts("after")') | |
before | |
λ (echo 'before'; exec 1>&-; ruby -e 'puts("1"*8190)'); # Sending 8191 chars | |
before | |
λ (echo 'before'; exec 1>&-; ruby -e 'puts("1"*8191)'); # Sending 8192 chars | |
before | |
-e:1:in `write': Broken pipe @ io_write - <STDOUT> (Errno::EPIPE) | |
from -e:1:in `puts' | |
from -e:1:in `puts' | |
from -e:1:in `<main>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment