Serhiy Storchaka <[email protected]> added the comment:
I concur with Martin. If this feature never worked, there is a risk of breaking
user code when fix it. Let consider this as adding a new feature in 3.8. For
older versions it should be documented that the mode of the output file is not
set.
And I agree that it would be more safe to use os.open(). Either call os.open()
and pass the file descriptor to the builtin open() (but be careful to not leak
it) or use the opener argument of open().
def opener(path, flags):
return os.open(path, flags, mode)
fp = open(out_file, 'wb', opener=opener)
It would be worth also to use the 'xb' opening mode instead of 'wb'.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33687>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com