Gregory P. Smith <g...@krypto.org> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40701> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com