eryksun added the comment: > 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+'> ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21044> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com