Message215632
| Author |
eryksun |
| Recipients |
antoine.pietri, eric.araujo, eryksun, lars.gustaebel, martin.panter, r.david.murray, serhiy.storchaka |
| Date |
2014年04月05日.21:01:19 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1396731680.15.0.805259066719.issue21044@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> you can't overwrite a io.FileIO().name attribute
A FileIO instance uses a dict for 'name' (msg214670):
>>> vars(sys.stdin.buffer.raw)
{'name': '<stdin>'}
>>> f = tempfile.TemporaryFile()
>>> vars(f.raw)
{'name': 3}
The name is optional meta-information. If it gets deleted, the repr falls back on using the file descriptor:
>>> f.raw
<_io.FileIO name=3 mode='rb+'>
>>> del f.raw.name
>>> f.raw
<_io.FileIO fd=3 mode='rb+'> |
|