[issue24716] Multiple fdopen() on mkstemp() descriptor crashes py27 interpreter

2015-07-26 Thread Thomas Krijnen
Thomas Krijnen added the comment: Thanks for the feedback. I realize the example code is rather bad, I was just surprised to see the interpreter actually crash. Good to know in py3 things are more robust. Closed. -- resolution: -> not a bug status: open -> closed

[issue24716] Multiple fdopen() on mkstemp() descriptor crashes py27 interpreter

2015-07-25 Thread STINNER Victor
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-n

[issue24716] Multiple fdopen() on mkstemp() descriptor crashes py27 interpreter

2015-07-25 Thread eryksun
eryksun added the comment: Reassigning "f" closes the first file object, but not before the second file object gets created. You can write to the already-closed file, assuming the write is small enough to not flush the FILE stream buffer (e.g. "beer", given an empty 4 KiB buffer). However, clo

[issue24716] Multiple fdopen() on mkstemp() descriptor crashes py27 interpreter

2015-07-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue24716] Multiple fdopen() on mkstemp() descriptor crashes py27 interpreter

2015-07-25 Thread Thomas Krijnen
New submission from Thomas Krijnen: Following code crashes my Python 2.7.9 interpreter on Windows: import os, tempfile a, b = tempfile.mkstemp() f = os.fdopen(a, "wb") f = os.fdopen(a, "wb") f.write("beer") f.close() -- components: Windows messages: 247329 nosy: Thomas Krijnen, paul.moo