Message156998
| Author |
neologix |
| Recipients |
alexis.d, neologix |
| Date |
2012年03月28日.18:59:30 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1332961170.7.0.605479307509.issue14433@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年03月28日 18:59:30 | neologix | set | recipients:
+ neologix, alexis.d |
| 2012年03月28日 18:59:30 | neologix | set | messageid: <1332961170.7.0.605479307509.issue14433@psf.upfronthosting.co.za> |
| 2012年03月28日 18:59:30 | neologix | link | issue14433 messages |
| 2012年03月28日 18:59:30 | neologix | create |
|