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

Charles-François Natali report at bugs.python.org
Wed Mar 28 20:59:30 CEST 2012


Charles-François Natali <neologix at free.fr> 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]
>>> 
[67261 refs]
[44710 refs]
"""

When the object returned by os.fdopen() is garbage collected, the underlying FD is closed, and the interpreter aborts when it tries to read from stdin.
So it's not an issue, try calling memoryview(fdopen(<any FD other than 0,1,2>) and it'll work.

----------
nosy: +neologix
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14433>
_______________________________________


More information about the Python-bugs-list mailing list