[New-bugs-announce] [issue12827] OS-specific location in Lib/tempfile.py for OpenBSD

Remi Pointel report at bugs.python.org
Tue Aug 23 13:30:57 CEST 2011


New submission from Remi Pointel <python at xiri.fr>:

Hello,

/usr/tmp is not (used) on OpenBSD.

We have specific patch to do this, but I prefer to have this modification upstream.

2.5: http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/python/2.5/patches/patch-Lib_tempfile_py
2.7: http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/python/2.7/patches/patch-Lib_tempfile_py
3.2: http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/python3/3.2/patches/patch-Lib_tempfile_py

Is it possible to add a specific location to remove /usr/tmp of the dirlist?

Attached file is the patch to do this:
--- Lib/tempfile.py.orig        Thu Aug  4 17:05:24 2011
+++ Lib/tempfile.py     Tue Aug 23 12:55:40 2011
@@ -138,6 +138,8 @@
     # Failing that, try OS-specific locations.
     if _os.name == 'nt':
         dirlist.extend([ r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
+    elif _sys.platform.startswith('openbsd'):
+        dirlist.extend([ '/tmp', '/var/tmp' ])
     else:
         dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])
, '/var/tmp' ])

Thanks,
Remi.

----------
components: Library (Lib)
files: patch-Lib_tempfile_py
messages: 142803
nosy: rpointel
priority: normal
severity: normal
status: open
title: OS-specific location in Lib/tempfile.py for OpenBSD
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23017/patch-Lib_tempfile_py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12827>
_______________________________________


More information about the New-bugs-announce mailing list