wtfpython icon indicating copy to clipboard operation
wtfpython copied to clipboard

GC Reference Counting algorithm can destroy a file descriptor too early

Open Lucas-C opened this issue 5 years ago • 0 comments

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

Lucas-C avatar Feb 13 '20 07:02 Lucas-C