Hi,

this is the diff to update Python 2.7.1 to Python 2.7.2.

Before applying the diff, please save the regress log of Python 2.7.1 to 
compare.

To test:
$ cd /usr/ports/lang/python/2.7 && make regress
$ cp /usr/ports/pobj/Python-2.7.1/regress.log /somewhere
$ apply my diff
$ cd /usr/ports/lang/python/2.7 && make regress

Please send me the two regress log to see the diff.

I have only tested on amd64, will test on sparc64.

Thanks,

Remi.
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/python/2.7/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- Makefile    27 Sep 2011 21:27:36 -0000      1.16
+++ Makefile    28 Sep 2011 06:07:52 -0000
@@ -1,13 +1,11 @@
 # $OpenBSD: Makefile,v 1.16 2011/09/27 21:27:36 sthen Exp $
 
 VERSION =              2.7
-PATCHLEVEL =           .1
-REVISION =             12
-REVISION-bsddb =       13
+PATCHLEVEL =           .2
 SHARED_LIBS =          python2.7 0.0
 VERSION_SPEC =         >=2.7,<2.8
 
-AUTOCONF_VERSION =     2.65
+AUTOCONF_VERSION =     2.68
 CONFIGURE_ARGS +=      --with-cxx_main \
                        --with-system-expat
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/python/2.7/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    24 Apr 2011 09:31:44 -0000      1.1.1.1
+++ distinfo    28 Sep 2011 06:07:52 -0000
@@ -1,5 +1,5 @@
-MD5 (Python-2.7.1.tgz) = Fe1WczZV4/q3heSacnjS+w==
-RMD160 (Python-2.7.1.tgz) = CTxJp5LXVfUXPbsE6Vljnz6eYWs=
-SHA1 (Python-2.7.1.tgz) = 3WuRDEeRKnxdjyO3/ArIv4Rl65I=
-SHA256 (Python-2.7.1.tgz) = yhPnsYYIIUlPcN4BcgIoOtc7H7e9iFhkAcVO+Vgibsg=
-SIZE (Python-2.7.1.tgz) = 14058131
+MD5 (Python-2.7.2.tgz) = Dd/iZfGz0KjCRZ9b9miUxw==
+RMD160 (Python-2.7.2.tgz) = HdgHP3CLkrtXttOsqRS1T4HxBxw=
+SHA1 (Python-2.7.2.tgz) = WnTB2ubCpMI9D5rqs09sskd03PM=
+SHA256 (Python-2.7.2.tgz) = HVS3CWwXkCw/QP/OfluE4ActAUQCQYT/8YSoTVY6u7M=
+SIZE (Python-2.7.2.tgz) = 14091337
Index: patches/patch-Lib_test_test_subprocess_py
===================================================================
RCS file: patches/patch-Lib_test_test_subprocess_py
diff -N patches/patch-Lib_test_test_subprocess_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Lib_test_test_subprocess_py   28 Sep 2011 06:07:52 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- Lib/test/test_subprocess.py.orig   Sat Jun 11 17:46:26 2011
++++ Lib/test/test_subprocess.py        Wed Sep 28 08:05:38 2011
+@@ -849,6 +849,7 @@
+         # all standard fds closed.
+         self.check_close_std_fds([0, 1, 2])
+ 
++    @unittest.skipIf(sys.platform.startswith("openbsd"), "blocking on 
OpenBSD")
+     def test_wait_when_sigchild_ignored(self):
+         # NOTE: sigchild_ignore.py may not be an effective test on all OSes.
+         sigchild_ignore = test_support.findfile("sigchild_ignore.py",
Index: patches/patch-Lib_test_test_urllib2_py
===================================================================
RCS file: patches/patch-Lib_test_test_urllib2_py
diff -N patches/patch-Lib_test_test_urllib2_py
--- patches/patch-Lib_test_test_urllib2_py      6 Jul 2011 12:05:56 -0000       
1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-$OpenBSD: patch-Lib_test_test_urllib2_py,v 1.3 2011/07/06 12:05:56 jasper Exp $
-
-Test fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3
-
---- Lib/test/test_urllib2.py.orig      Mon Nov 22 06:04:33 2010
-+++ Lib/test/test_urllib2.py   Wed Jul  6 14:05:40 2011
-@@ -969,6 +969,28 @@ class HandlerTests(unittest.TestCase):
-             self.assertEqual(count,
-                              urllib2.HTTPRedirectHandler.max_redirections)
- 
-+    def test_invalid_redirect(self):
-+        from_url = "http://example.com/a.html";
-+        valid_schemes = ['http', 'https', 'ftp']
-+        invalid_schemes = ['file', 'imap', 'ldap']
-+        schemeless_url = "example.com/b.html"
-+        h = urllib2.HTTPRedirectHandler()
-+        o = h.parent = MockOpener()
-+        req = Request(from_url)
-+        req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT
-+
-+        for scheme in invalid_schemes:
-+            invalid_url = scheme + '://' + schemeless_url
-+            self.assertRaises(urllib2.HTTPError, h.http_error_302,
-+                              req, MockFile(), 302, "Security Loophole",
-+                              MockHeaders({"location": invalid_url}))
-+
-+        for scheme in valid_schemes:
-+            valid_url = scheme + '://' + schemeless_url
-+            h.http_error_302(req, MockFile(), 302, "That's fine",
-+                MockHeaders({"location": valid_url}))
-+            self.assertEqual(o.req.get_full_url(), valid_url)
-+
-     def test_cookie_redirect(self):
-         # cookies shouldn't leak into redirected requests
-         from cookielib import CookieJar
Index: patches/patch-Lib_test_test_urllib_py
===================================================================
RCS file: patches/patch-Lib_test_test_urllib_py
diff -N patches/patch-Lib_test_test_urllib_py
--- patches/patch-Lib_test_test_urllib_py       6 Jul 2011 12:05:56 -0000       
1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@
-$OpenBSD: patch-Lib_test_test_urllib_py,v 1.3 2011/07/06 12:05:56 jasper Exp $
-
-Test fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3
-
---- Lib/test/test_urllib.py.orig       Sun Nov 21 14:34:58 2010
-+++ Lib/test/test_urllib.py    Wed Jul  6 14:05:40 2011
-@@ -161,6 +161,20 @@ Content-Type: text/html; charset=iso-8859-1
-         finally:
-             self.unfakehttp()
- 
-+    def test_invalid_redirect(self):
-+        # urlopen() should raise IOError for many error codes.
-+        self.fakehttp("""HTTP/1.1 302 Found
-+Date: Wed, 02 Jan 2008 03:03:54 GMT
-+Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e
-+Location: file:README
-+Connection: close
-+Content-Type: text/html; charset=iso-8859-1
-+""")
-+        try:
-+            self.assertRaises(IOError, urllib.urlopen, "http://python.org/";)
-+        finally:
-+            self.unfakehttp()
-+
-     def test_empty_socket(self):
-         # urlopen() raises IOError if the underlying socket does not send any
-         # data. (#1680230)
Index: patches/patch-Lib_urllib2_py
===================================================================
RCS file: patches/patch-Lib_urllib2_py
diff -N patches/patch-Lib_urllib2_py
--- patches/patch-Lib_urllib2_py        6 Jul 2011 12:05:56 -0000       1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-Lib_urllib2_py,v 1.3 2011/07/06 12:05:56 jasper Exp $
-
-Fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3
-
---- Lib/urllib2.py.orig        Sat Nov 20 12:24:08 2010
-+++ Lib/urllib2.py     Wed Jul  6 14:05:40 2011
-@@ -579,6 +579,17 @@ class HTTPRedirectHandler(BaseHandler):
- 
-         newurl = urlparse.urljoin(req.get_full_url(), newurl)
- 
-+        # For security reasons we do not allow redirects to protocols
-+        # other than HTTP, HTTPS or FTP.
-+        newurl_lower = newurl.lower()
-+        if not (newurl_lower.startswith('http://') or
-+                newurl_lower.startswith('https://') or
-+                newurl_lower.startswith('ftp://')):
-+            raise HTTPError(newurl, code,
-+                            msg + " - Redirection to url '%s' is not allowed" 
%
-+                            newurl,
-+                            headers, fp)
-+
-         # XXX Probably want to forget about the state of the current
-         # request, although that might interact poorly with other
-         # handlers that also use handler-specific request attributes
Index: patches/patch-Lib_urllib_py
===================================================================
RCS file: patches/patch-Lib_urllib_py
diff -N patches/patch-Lib_urllib_py
--- patches/patch-Lib_urllib_py 7 May 2011 09:35:13 -0000       1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-Lib_urllib_py,v 1.2 2011/05/07 09:35:13 fgsch Exp $
-
-Fix for CVE-2011-1521: http://hg.python.org/cpython/rev/a778b963eae3
-
---- Lib/urllib.py.orig Sat Apr 23 15:02:11 2011
-+++ Lib/urllib.py      Sat Apr 23 15:09:17 2011
-@@ -644,6 +644,18 @@ class FancyURLopener(URLopener):
-         fp.close()
-         # In case the server sent a relative URL, join with original:
-         newurl = basejoin(self.type + ":" + url, newurl)
-+
-+        # For security reasons we do not allow redirects to protocols
-+        # other than HTTP, HTTPS or FTP.
-+        newurl_lower = newurl.lower()
-+        if not (newurl_lower.startswith('http://') or
-+                newurl_lower.startswith('https://') or
-+                newurl_lower.startswith('ftp://')):
-+            raise IOError('redirect error', errcode,
-+                          errmsg + " - Redirection to url '%s' is not 
allowed" %
-+                          newurl,
-+                          headers)
-+
-         return self.open(newurl)
- 
-     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
Index: patches/patch-configure_in
===================================================================
RCS file: /cvs/ports/lang/python/2.7/patches/patch-configure_in,v
retrieving revision 1.5
diff -u -p -r1.5 patch-configure_in
--- patches/patch-configure_in  7 Jul 2011 21:32:39 -0000       1.5
+++ patches/patch-configure_in  28 Sep 2011 06:07:52 -0000
@@ -2,9 +2,9 @@ $OpenBSD: patch-configure_in,v 1.5 2011/
 
 Wrong value of LDSHARED in sysconfig, cf http://bugs.python.org/issue10547
 
---- configure.in.orig  Mon Nov  1 02:47:19 2010
-+++ configure.in       Thu Jul  7 22:57:06 2011
-@@ -331,7 +331,7 @@ case $ac_sys_system/$ac_sys_release in
+--- configure.in.orig  Sat Jun 11 17:46:28 2011
++++ configure.in       Wed Sep 28 07:08:06 2011
+@@ -324,7 +324,7 @@
      # As this has a different meaning on Linux, only define it on OpenBSD
      AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library 
features])
      ;;
@@ -13,42 +13,7 @@ Wrong value of LDSHARED in sysconfig, cf
      # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
      # also defined. This can be overridden by defining _BSD_SOURCE
      # As this has a different meaning on Linux, only define it on OpenBSD
-@@ -1850,30 +1850,14 @@ then
-       BSD/OS*/4*)
-               LDSHARED="gcc -shared"
-               LDCXXSHARED="g++ -shared";;
--      FreeBSD*)
-+      FreeBSD*|OpenBSD*)
-               if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
-               then
--                      LDSHARED='$(CC) -shared ${LDFLAGS}'
--                      LDCXXSHARED='$(CXX) -shared ${LDFLAGS}'
-+                      LDSHARED='$(CC) -shared'
-+                      LDCXXSHARED='$(CXX) -shared'
-               else
--                      LDSHARED="ld -Bshareable ${LDFLAGS}"
-+                      LDSHARED="ld -Bshareable"
-               fi;;
--      OpenBSD*)
--              if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
--              then
--                              LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
--                              LDCXXSHARED='$(CXX) -shared $(CCSHARED) 
${LDFLAGS}'
--              else
--                              case `uname -r` in
--                              [[01]].* | 2.[[0-7]] | 2.[[0-7]].*)
--                                 LDSHARED="ld -Bshareable ${LDFLAGS}"
--                                 ;;
--                              *)
--                                 LDSHARED='$(CC) -shared $(CCSHARED) 
${LDFLAGS}'
--                                 LDCXXSHARED='$(CXX) -shared $(CCSHARED) 
${LDFLAGS}'
--                                 ;;
--                              esac
--              fi;;
-       NetBSD*|DragonFly*)
-               LDSHARED="cc -shared ${LDFLAGS}"
-               LDCXXSHARED="c++ -shared ${LDFLAGS}";;
-@@ -2035,9 +2019,10 @@ AC_CHECK_LIB(dld, shl_load)     # Dynamic linking for 
HP-U
+@@ -2049,9 +2049,10 @@
  
  # only check for sem_init if thread support is requested
  if test "$with_threads" = "yes" -o -z "$with_threads"; then
Index: patches/patch-setup_py
===================================================================
RCS file: /cvs/ports/lang/python/2.7/patches/patch-setup_py,v
retrieving revision 1.2
diff -u -p -r1.2 patch-setup_py
--- patches/patch-setup_py      6 Jul 2011 12:05:56 -0000       1.2
+++ patches/patch-setup_py      28 Sep 2011 06:07:52 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-setup_py,v 1.2 2011/07/06 12:05:56 jasper Exp $
---- setup.py.orig      Sun Oct 31 17:40:21 2010
-+++ setup.py   Wed Jul  6 14:05:41 2011
-@@ -23,6 +23,11 @@ COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount
+--- setup.py.orig      Sat Jun 11 17:46:28 2011
++++ setup.py   Wed Sep 28 07:11:27 2011
+@@ -23,6 +23,11 @@
  # This global variable is used to hold the list of modules to be disabled.
  disabled_module_list = []
  
@@ -13,7 +13,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (at the front) if
      1) 'dir' is not already in 'dirlist'
-@@ -347,8 +352,8 @@ class PyBuildExt(build_ext):
+@@ -369,8 +374,8 @@
  
      def detect_modules(self):
          # Ensure that /usr/local is always used
@@ -21,10 +21,10 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
 -        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
 +        add_dir_to_list(self.compiler.library_dirs, usrlocal('lib'))
 +        add_dir_to_list(self.compiler.include_dirs, usrlocal('include'))
+         self.add_multiarch_paths()
  
          # Add paths specified in the environment variables LDFLAGS and
-         # CPPFLAGS for header and library files.
-@@ -680,8 +685,6 @@ class PyBuildExt(build_ext):
+@@ -703,8 +708,6 @@
                                 depends = ['socketmodule.h']) )
          # Detect SSL support for the socket module (via _ssl)
          search_for_ssl_incs_in = [
@@ -33,7 +33,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
                               ]
          ssl_incs = find_file('openssl/ssl.h', inc_dirs,
                               search_for_ssl_incs_in
-@@ -692,9 +695,7 @@ class PyBuildExt(build_ext):
+@@ -715,9 +718,7 @@
              if krb5_h:
                  ssl_incs += krb5_h
          ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
@@ -44,7 +44,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
  
          if (ssl_incs is not None and
              ssl_libs is not None):
-@@ -793,7 +794,7 @@ class PyBuildExt(build_ext):
+@@ -816,7 +817,7 @@
                  # BerkeleyDB 4.6.x is not stable on many architectures.
                  arch = platform_machine()
                  if arch not in ('i386', 'i486', 'i586', 'i686',
@@ -53,7 +53,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
                      return False
              return True
  
-@@ -856,6 +857,7 @@ class PyBuildExt(build_ext):
+@@ -879,6 +880,7 @@
                  std_variants.append(os.path.join(dn, "db3.%d"%x))
  
          db_inc_paths = std_variants + db_inc_paths
@@ -61,7 +61,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
          db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
  
          db_ver_inc_map = {}
-@@ -919,6 +921,7 @@ class PyBuildExt(build_ext):
+@@ -942,6 +944,7 @@
                      db_incdir.replace("include", 'lib64'),
                      db_incdir.replace("include", 'lib'),
                  ]
@@ -69,7 +69,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
  
                  if sys.platform != 'darwin':
                      db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
-@@ -941,6 +944,7 @@ class PyBuildExt(build_ext):
+@@ -964,6 +967,7 @@
                  # symlink to more general names?
                  for dblib in (('db-%d.%d' % db_ver),
                                ('db%d%d' % db_ver),
@@ -77,7 +77,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
                                ('db%d' % db_ver[0])):
                      dblib_file = self.compiler.find_library_file(
                                      db_dirs_to_check + lib_dirs, dblib )
-@@ -988,6 +992,7 @@ class PyBuildExt(build_ext):
+@@ -1011,6 +1015,7 @@
                               '/usr/local/include/sqlite',
                               '/usr/local/include/sqlite3',
                             ]
@@ -85,7 +85,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
          MIN_SQLITE_VERSION_NUMBER = (3, 0, 8)
          MIN_SQLITE_VERSION = ".".join([str(x)
                                      for x in MIN_SQLITE_VERSION_NUMBER])
-@@ -1033,6 +1038,7 @@ class PyBuildExt(build_ext):
+@@ -1056,6 +1061,7 @@
                  os.path.join(sqlite_incdir, '..', '..', 'lib64'),
                  os.path.join(sqlite_incdir, '..', '..', 'lib'),
              ]
@@ -93,7 +93,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
              sqlite_libfile = self.compiler.find_library_file(
                                  sqlite_dirs_to_check + lib_dirs, 'sqlite3')
              if sqlite_libfile:
-@@ -1097,7 +1103,7 @@ class PyBuildExt(build_ext):
+@@ -1120,7 +1126,7 @@
                  sysroot = macosx_sdk_root()
                  f = os.path.join(sysroot, f[1:])
  
@@ -102,7 +102,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
              data = open(f).read()
              m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
              if m is not None:
-@@ -1416,7 +1422,11 @@ class PyBuildExt(build_ext):
+@@ -1439,7 +1445,11 @@
              libraries = []
  
          elif platform.startswith('openbsd'):
@@ -115,7 +115,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
              libraries = []
  
          elif platform.startswith('netbsd'):
-@@ -1464,6 +1474,9 @@ class PyBuildExt(build_ext):
+@@ -1487,6 +1497,9 @@
                          'freebsd7', 'freebsd8')
              or platform.startswith("gnukfreebsd")):
              exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
@@ -125,7 +125,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
          else:
              missing.append('ossaudiodev')
  
-@@ -1637,7 +1650,7 @@ class PyBuildExt(build_ext):
+@@ -1660,7 +1673,7 @@
          # For 8.4a2, the X11 headers are not included. Rather than include a
          # complicated search, this is a hard-coded path. It could bail out
          # if X11 libs are not found...
@@ -134,7 +134,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
          frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
  
          # All existing framework builds of Tcl/Tk don't support 64-bit
-@@ -1687,8 +1700,7 @@ class PyBuildExt(build_ext):
+@@ -1710,8 +1723,7 @@
          # The versions with dots are used on Unix, and the versions without
          # dots on Windows, for detection by cygwin.
          tcllib = tklib = tcl_includes = tk_includes = None
@@ -144,7 +144,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
              tklib = self.compiler.find_library_file(lib_dirs,
                                                          'tk' + version)
              tcllib = self.compiler.find_library_file(lib_dirs,
-@@ -1731,17 +1743,9 @@ class PyBuildExt(build_ext):
+@@ -1754,17 +1766,9 @@
          if platform == 'sunos5':
              include_dirs.append('/usr/openwin/include')
              added_lib_dirs.append('/usr/openwin/lib')
@@ -165,7 +165,7 @@ $OpenBSD: patch-setup_py,v 1.2 2011/07/0
  
          # If Cygwin, then verify that X is installed before proceeding
          if platform == 'cygwin':
-@@ -2045,7 +2049,7 @@ def main():
+@@ -2068,7 +2072,7 @@
            # Scripts to install
            scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
                       'Tools/scripts/2to3',

Reply via email to