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 roysmith
Recipients roysmith
Date 2009-11-14.19:27:34
SpamBayes Score 7.529763e-07
Marked as misclassified No
Message-id <1258226856.45.0.72736645389.issue7325@psf.upfronthosting.co.za>
In-reply-to
Content
The docs (http://www.python.org/doc/2.5.1/lib/module-tempfile.html) specify that 
mkdtemp(), "returns the absolute pathname of the new directory".  It does that in 
the default case, but if you specify a relative path for 'dir', you get back a 
relative path.


$ python
Python 2.5.1 (r251:54863, Oct 17 2008, 14:39:09) 
[GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.mkdtemp(dir='.')
'./tmpHk1pBD'

similar results were obtained on:

Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin

Note that mkstemp() gets it right:

>>> tempfile.mkdtemp(dir='.')
'./tmpoPXdL7'
>>> tempfile.mkstemp(dir='.')
(3, '/Users/roy2/tmpwTGZ2y')
>>>
History
Date User Action Args
2009-11-14 19:27:36roysmithsetrecipients: + roysmith
2009-11-14 19:27:36roysmithsetmessageid: <1258226856.45.0.72736645389.issue7325@psf.upfronthosting.co.za>
2009-11-14 19:27:34roysmithlinkissue7325 messages
2009-11-14 19:27:34roysmithcreate