[Python-bugs-list] [ python-Bugs-810408 ] mkstemp doesn't return abspath

SourceForge.net noreply at sourceforge.net
Tue Sep 23 07:34:13 EDT 2003


Bugs item #810408, was opened at 2003-09-22 14:26
Message generated for change (Comment added) made by quiver
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=810408&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: George Yoshida (quiver)
Assigned to: Nobody/Anonymous (nobody)
Summary: mkstemp doesn't return abspath

Initial Comment:
The document of tempfile.mkstemp says that,

"mkstemp() returns a tuple containing an OS-level 

handle to an open file (as would be returned by 

os.open()) and the absolute pathname of that file, 

in that order."



However, if you specify the directory a relative path,

it doesn't return an absolute pathname.



>>> import tempfile

>>> tempfile.mkstemp()

(5, '/tmp/tmpHBq8rz')

>>> tempfile.mkstemp(dir='.')

(3, './tmpvK7BEr')

>>> tempfile.mkstemp(dir='./test')

(4, './test/tmplB7GZF')



----------------------------------------------------------------------

>Comment By: George Yoshida (quiver)
Date: 2003-09-23 20:34

Message:
Logged In: YES 
user_id=671362

Michael has submitted a patch to return absolute 

pathname.



http://www.python.org/sf/810914

fix for mkstemp with relative paths (bug #810408)



His fix looks good to me.

----------------------------------------------------------------------

Comment By: Anthony Baxter (anthonybaxter)
Date: 2003-09-23 20:03

Message:
Logged In: YES 
user_id=29957

Anyone got an opinion on this one? Should the docs be fixed,

or the code?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=810408&group_id=5470



More information about the Python-bugs-list mailing list