Bugs item #1584723, was opened at 2006-10-25 20:52 Message generated for change (Settings changed) made by gbrandl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1584723&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.5 >Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Andreas (andyfloe) Assigned to: Nobody/Anonymous (nobody) Summary: os.tempnam fails on SUSE Linux to accept directory argument Initial Comment: On SUSE Linux 10.1 the function os.tempnam does not use the "dir" argument properly. It always takes the tmpdir, in this case "/tmp". In the example below it is expected to get a filename of '/tmp/tmp/pref2iGGS5' instead of '/tmp/pref2iGGS5'. [EMAIL PROTECTED]:~> python Python 2.5 (r25:51908, Oct 18 2006, 22:50:32) [GCC 4.1.0 (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.mkdir("/tmp/tmp") >>> os.tempnam("/tmp/tmp", "pref") __main__:1: RuntimeWarning: tempnam is a potential security risk to your program '/tmp/pref2iGGS5' >>> [EMAIL PROTECTED]:~> ls -l /tmp/tmp total 0 [EMAIL PROTECTED]:~> ls -ld /tmp/tmp drwxr-xr-x 2 auser users 48 2006-10-17 20:13 /tmp/tmp This behavior is also the same on the Python version which comes with SUSE Linux 10.1. On Solaris 10 the behavior is as expected, e.g. -bash-3.00$ python Python 2.4.3 (#1, Sep 16 2006, 10:31:38) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.mkdir("/tmp/tmp") >>> os.tempnam("/tmp/tmp", "pref") __main__:1: RuntimeWarning: tempnam is a potential security risk to your program '/tmp/tmp/prefAAAIeaafH' A patch for the test 'test_os.py' is attached to this report. It has been tested on SUSE Linux 10.1. ---------------------------------------------------------------------- Comment By: Andreas (andyfloe) Date: 2006-10-26 16:55 Message: Logged In: YES user_id=1292384 Your hint about the environment variable TMPDIR actually solves my problem. I have overlooked the information given in the documentation about this fact. Thanks. ---------------------------------------------------------------------- Comment By: Matthias Kievernagel (mkiever) Date: 2006-10-26 00:12 Message: Logged In: YES user_id=1477880 This one once irritated me also. In my case the cause was the environment variable 'TMPDIR'. This is the first location chosen by os.tempnam (see 'man tempnam'). Please check again. Matthias Kievernagel mkiever at web dot de ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1584723&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com