[issue17673] add `copy_from` argument to temporaryfile

Kyle Roberts report at bugs.python.org
Mon Apr 29 17:11:28 CEST 2013


Kyle Roberts added the comment:

Thanks for the comments Antoine. I didn't have a good reason for using the file name at the time, although even when using the file name I should have used the "file" variable that was already created. I tried using the file descriptor, but I encountered a "[Errno 9] Bad file descriptor" once the methods using _mkstemp_inner call _io.open on the returned fd. This leads me to believe that the fd is being closed somehow, but as you can see from my copy function, I don't implicitly or explicitly close the file using the file descriptor. I'm not sure yet why the file name works as expected but the fd does not. Am I missing something simple?

As for points 2-4 I have most of that done. What's the pythonic way for determining if an argument is file-like? I've seen isinstance, hasattr, etc.

----------

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


More information about the Python-bugs-list mailing list