Jakub Stasiak added the comment: I don't see an obvious way of solving that. One thing I could think of is creating a wrapper for file method being returned from __getattr__ that holds reference to _TemporaryFileWrapper instance until the method gets called, please find a patch attached.
---------- keywords: +patch nosy: +jstasiak Added file: http://bugs.python.org/file31598/tempfile.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18879> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com