This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients bsdphk, christian.heimes, martin.panter, r.david.murray, serhiy.storchaka, tuxtimo, vstinner, xiang.zhang
Date 2018-06-11.06:21:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528698104.94.0.592728768989.issue33687@psf.upfronthosting.co.za>
In-reply-to
Content
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'.
History
Date User Action Args
2018-06-11 06:21:45serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, christian.heimes, r.david.murray, martin.panter, bsdphk, xiang.zhang, tuxtimo
2018-06-11 06:21:44serhiy.storchakasetmessageid: <1528698104.94.0.592728768989.issue33687@psf.upfronthosting.co.za>
2018-06-11 06:21:44serhiy.storchakalinkissue33687 messages
2018-06-11 06:21:44serhiy.storchakacreate