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 gregory.p.smith
Recipients ericzolf, gregory.p.smith, python-dev, serhiy.storchaka
Date 2021-03-02.14:24:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I clarified the documentation in the PR and added a regression test.

I chose to explicitly document that tempfile.tempdir may only be str or bytes and cannot be a path-like object.

We already document that people really should not set it and instead pass dir= to their APIs.  Now the docs make that more clear when it comes to setting it to a bytes object due to the global API return type change consequences.

I view this PR as cleaning up a partial misbehavior while preserving an API wart of it ever working in any manner when set to a bytes value.

getting rid of tempfile.tempdir entirely or preventing it from being a bytes value at all would be much more of a breaking change, even though desirable.  Not a bugfix.  Now with the PR as is, we at least document that people should avoid doing that and make it clear what consistent behavior happens when they do it anyways.  With a test.
Date User Action Args
2021-03-02 14:24:14gregory.p.smithsetrecipients: + gregory.p.smith, python-dev, serhiy.storchaka, ericzolf
2021-03-02 14:24:14gregory.p.smithsetmessageid: <>
2021-03-02 14:24:14gregory.p.smithlinkissue40701 messages
2021-03-02 14:24:13gregory.p.smithcreate