summaryrefslogtreecommitdiff
path: root/lang/python15
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2002-11-14 16:52:24 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2002-11-14 16:52:24 +0000
commit4a46e91cbf9b98c09fddc80922bd7468763773a9 (patch)
tree5b122d208c0df2d2d9b8c2c4c7d80e0de7444203 /lang/python15
parentOnly using Jikes if NO_BUILD is not set. (diff)
Backport fix for temporary file handling bug in os._execvpe() from
Python 2.2.2. Not approved by: tg (short timeout)
Notes
Notes: svn path=/head/; revision=70118
Diffstat (limited to 'lang/python15')
-rw-r--r--lang/python15/Makefile2
-rw-r--r--lang/python15/files/patch-Lib:os.py76
2 files changed, 77 insertions, 1 deletions
diff --git a/lang/python15/Makefile b/lang/python15/Makefile
index fae0b0e986e5..dd7e11b5134c 100644
--- a/lang/python15/Makefile
+++ b/lang/python15/Makefile
@@ -7,7 +7,7 @@
PORTNAME= python
PORTVERSION= 1.5.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang python
MASTER_SITES= ftp://www.python.org/pub/python/src/ \
ftp://ftp.cwi.nl/pub/python/src/
diff --git a/lang/python15/files/patch-Lib:os.py b/lang/python15/files/patch-Lib:os.py
new file mode 100644
index 000000000000..4a18ed119cbb
--- /dev/null
+++ b/lang/python15/files/patch-Lib:os.py
@@ -0,0 +1,76 @@
+*** Lib/os.py.orig Mon Feb 22 09:40:34 1999
+--- Lib/os.py Mon Nov 11 15:08:52 2002
+***************
+*** 185,192 ****
+ def execvpe(file, args, env):
+ _execvpe(file, args, env)
+
+- _notfound = None
+ def _execvpe(file, args, env = None):
+ if env:
+ func = execve
+ argrest = (args, env)
+--- 185,193 ----
+ def execvpe(file, args, env):
+ _execvpe(file, args, env)
+
+ def _execvpe(file, args, env = None):
++ from errno import ENOENT, ENOTDIR
++
+ if env:
+ func = execve
+ argrest = (args, env)
+***************
+*** 194,200 ****
+ func = execv
+ argrest = (args,)
+ env = environ
+- global _notfound
+ head, tail = path.split(file)
+ if head:
+ apply(func, (file,) + argrest)
+--- 195,200 ----
+***************
+*** 205,224 ****
+ envpath = defpath
+ import string
+ PATH = string.splitfields(envpath, pathsep)
+! if not _notfound:
+! import tempfile
+! # Exec a file that is guaranteed not to exist
+! try: execv(tempfile.mktemp(), ())
+! except error, _notfound: pass
+! exc, arg = error, _notfound
+ for dir in PATH:
+ fullname = path.join(dir, file)
+ try:
+ apply(func, (fullname,) + argrest)
+! except error, (errno, msg):
+! if errno != arg[0]:
+! exc, arg = error, (errno, msg)
+! raise exc, arg
+
+ # Change environ to automatically call putenv() if it exists
+ try:
+--- 205,225 ----
+ envpath = defpath
+ import string
+ PATH = string.splitfields(envpath, pathsep)
+! saved_exc = None
+! saved_tb = None
+ for dir in PATH:
+ fullname = path.join(dir, file)
+ try:
+ apply(func, (fullname,) + argrest)
+! except error, e:
+! tb = sys.exc_info()[2]
+! if (e.errno != ENOENT and e.errno != ENOTDIR
+! and saved_exc is None):
+! saved_exc = e
+! saved_tb = tb
+! if saved_exc:
+! raise error, saved_exc, saved_tb
+! raise error, e, tb
+
+ # Change environ to automatically call putenv() if it exists
+ try: