New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-40701: tempfile mixes str and bytes in an inconsistent manner #20442
Conversation
the case of tempdir variable being bytes is now handled consistently. The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user.
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Is something missing from me to get this PR merged? It appears that the issue is even worse under Windows as it fails even on an existing bytes tempdir which exists, the reason being TemporaryFile is equal to NamedTemporaryFile. And it appeared that the latter also fails under Linux. See rdiff-backup/rdiff-backup#540 for details. I would actually really appreciate a backport to 3.9 as well. |
I can't merge this until the CI infrastructure issues are fixed. |
GH-24734 is a backport of this pull request to the 3.9 branch. |
…thonGH-20442) The case of tempfile.tempdir variable being bytes is now handled consistently. The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user. Adds a regression test. Expands the documentation to clarify the behavior. Co-authored-by: Eric L <ewl+git@lavar.de> Co-authored-by: Gregory P. Smith <greg@krypto.org> (cherry picked from commit 9c79274) Co-authored-by: Eric L <ericzolf@users.noreply.github.com>
…thonGH-20442) The case of tempfile.tempdir variable being bytes is now handled consistently. The getters return the right type and no more error of mixing str and bytes unless explicitly caused by the user. Adds a regression test. Expands the documentation to clarify the behavior. Co-authored-by: Eric L <ewl+git@lavar.de> Co-authored-by: Gregory P. Smith <greg@krypto.org>
the case of tempdir variable being bytes is now handled consistently.
The getters return the right type and no more error of mixing str and
bytes unless explicitly caused by the user.
https://bugs.python.org/issue40701
https://bugs.python.org/issue40701