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 ericzolf
Recipients DahlitzFlorian, ericzolf
Date 2020-05-21.09:36:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590053786.2.0.0041092465711.issue40701@roundup.psfhosted.org>
In-reply-to
Content
In the meantime, I noticed the following in addition:

[ericl@tuxedo ~]$ python3.9
Python 3.9.0a6 (default, Apr 28 2020, 00:00:00) 
[GCC 10.0.1 20200430 (Red Hat 10.0.1-0.14)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.tempdir = b'/tmp'
>>> tempfile.gettempdir()
b'/tmp'
>>> tempfile.tempdir = '/tmp'
>>> tempfile.gettempdirb()
b'/tmp'

This actually explicitly hurts the interface description which states that tempfile.gettempdir() returns a string.

"Encouraged" by this discovery, I've tried to write a patch of tempfile.py addressing the issues discovered. It's my first patch ever of Python so bare with me. The default remains string but if someone _explicitly_ sets tempdir to bytes, it'll become bytes. I've tried all the commands listed previously and it all looks consistent to me.
History
Date User Action Args
2020-05-21 09:36:26ericzolfsetrecipients: + ericzolf, DahlitzFlorian
2020-05-21 09:36:26ericzolfsetmessageid: <1590053786.2.0.0041092465711.issue40701@roundup.psfhosted.org>
2020-05-21 09:36:26ericzolflinkissue40701 messages
2020-05-21 09:36:26ericzolfcreate