wtfpython
wtfpython copied to clipboard
GC Reference Counting algorithm can destroy a file descriptor too early
Credit goes to Javier Honduvilla Coto for find this: http://hondu.co/blog/open-and-python I contacted him by email to clarify a few bits, and thought it'd be a nice addition here.
f = open('/tmp/a', 'w'); open(f.fileno()) # OK
open(open('/tmp/b', 'w').fileno()) # KO