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 philiprowlands
Recipients philiprowlands
Date 2018-06-18.07:34:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529307283.94.0.56676864532.issue33894@psf.upfronthosting.co.za>
In-reply-to
Content
Quoting https://docs.python.org/3/library/tempfile.html
"""
tempfile.tempdir
When set to a value other than None, this variable defines the default value for the dir argument to the functions defined in this module.

If tempdir is unset or None at any call to any of the above functions except gettempprefix() it is initialized following the algorithm described in gettempdir().
"""

"If tempdir is unset ..." is not true:

$ python3 -c 'import tempfile; del tempfile.tempdir; t = tempfile.mkdtemp()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.2/tempfile.py", line 298, in mkdtemp
    dir = gettempdir()
  File "/usr/lib/python3.2/tempfile.py", line 238, in gettempdir
    if tempdir is None:
NameError: global name 'tempdir' is not defined

No strong preference whether the docs change to match the implementation, or vice-versa.
History
Date User Action Args
2018-06-18 07:34:43philiprowlandssetrecipients: + philiprowlands
2018-06-18 07:34:43philiprowlandssetmessageid: <1529307283.94.0.56676864532.issue33894@psf.upfronthosting.co.za>
2018-06-18 07:34:43philiprowlandslinkissue33894 messages
2018-06-18 07:34:43philiprowlandscreate