Skip to content

Instantly share code, notes, and snippets.

@Dutchy-
Last active August 29, 2015 14:21
Show Gist options
  • Save Dutchy-/c87b1c27b9c08fb0323c to your computer and use it in GitHub Desktop.
Save Dutchy-/c87b1c27b9c08fb0323c to your computer and use it in GitHub Desktop.
Python 3 readline 'bug'
# 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