Last active
August 29, 2015 14:21
-
-
Save Dutchy-/c87b1c27b9c08fb0323c to your computer and use it in GitHub Desktop.
Python 3 readline 'bug'
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
# cat readline.py | |
f = open('test.txt', 'r') | |
print(f.readline()) | |
import subprocess | |
p = subprocess.Popen(["cat", "test.txt"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
print(p.stdout.readline()) | |
# python3 readline.py | |
bla | |
b'bla\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment