STINNER Victor added the comment: As eryksun explained, you have a bug in your example. You should fix your code. I would not call it a bug in Python, but more yet another bug (or "unexpected behaviour") of the C stdio of Windows. My list of bugs in the C stdio is already long: https://haypo-notes.readthedocs.org/python.html#bugs-in-the-c-stdio-used-by-the-python-i-o
You should try to use the io module which is available since Python 2.6. On Linux with Python 2.7.10, I get an OSError: $ python x.py Traceback (most recent call last): File "x.py", line 7, in <module> f.close() IOError: [Errno 9] Bad file descriptor I suggest to close the issue as "not a bug". ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24716> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com