R. David Murray added the comment:
I think it is a reasonable backward-compatibility fix to make it work as badly
as it previously did ;). I would not document it, and I do not consider it a
high priority (as Serhiy said, this usage reached into object internals and
thus was dangerous from the start).
Unless I'm missing something, there is no need to add any new features to
support your use case, Марк, or for us to apply a backward compatibility fix
for you to get your code working agian. Your use case is already supported:
fd, name = tempfile.mkstemp(...)
with io.open(fd, ...) as f:
...
This has the added advantage that it will work on all python versions. You can
easy wrap it into a function for use in your application if you don't like
needing two lines.
To extend support for this to Windows, we can add a feature to mkstmp to not
use O_TEMPORARY. Also, it would probably be worth adding the above as an
example to the docs.
----------
nosy: +r.david.murray
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21579>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com