[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: sys.stdin and others are created with "closefd=False", so close() has no effect. Try os.close(0) instead... -- nosy: +amaury.forgeotdarc ___ Python tracker ___

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-29 Thread Alexis Daboville
Alexis Daboville added the comment: > And D isn't how you shut down the interpreter on Windows, is it? No Z + is the equivalent (D does nothing under Windows, except "printing" ^D). And in a cmd window it just print another prompt (that's strange that it doesn't exit by the way...). Also,

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread R. David Murray
R. David Murray added the comment: Hmm. And D isn't how you shut down the interpreter on Windows, is it? So maybe there is a Windows-specific bug here after all. Or do you get that same dialog if you do the Windows equivalent of D in a shell window (is that different from a CMD window, or

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread Brian Curtin
Brian Curtin added the comment: Maybe it's a different reason, but some part of something about this crashes on Windows. "python.exe has stopped working" is a crash dialog. -- ___ Python tracker _

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread Alexis Daboville
Alexis Daboville added the comment: First, thank you all for the explanations (sorry for the misleading title about the memoryview, should I rename it?). > @Brian: this isn't a crash. It is completely equivalent to pressing D > at the interactive interpreter prompt. Not exactly, at least on

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread R. David Murray
R. David Murray added the comment: To make this a little clearer, here's an even simpler example: >>> import os >>> os.fdopen(0) <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'> >>> 1 __main__:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'> 1

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread Brian Curtin
Brian Curtin added the comment: > So it's not an issue, try calling memoryview(fdopen( 0,1,2>) and it'll work. This is exactly why it's an issue. Python should not crash. -- nosy: +brian.curtin status: closed -> open ___ Python tracker

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread Charles-François Natali
Charles-François Natali added the comment: Hello, This has actually nothing to do with memoryview: """ >>> import os [67212 refs] >>> stdin = os.fdopen(0) [67234 refs] >>> del stdin __main__:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=0 mode='r' encoding='UTF-8'> [67260 refs] >>

[issue14433] Python 3 interpreter crash with memoryview and os.fdopen

2012-03-28 Thread Alexis Daboville
New submission from Alexis Daboville : Hi, I was "playing" with memoryviews when I found this behaviour, launch the Python shell, and then enter the following: >>> import os >>> memoryview(os.fdopen(0)) A TypeError "cannot make memory view because object does not have the buffer interface" i