Pages

2012-01-03

Patch for test_commands.py in Python 2.5.6

Something seems to be wrong with a test script in Python 2.5.6.

Environment:

  • CentOS 6.2 x86_64 on VMware
  • Python 2.5.6

Symptom:

  • make test fails.

Solution:

  • Apply the patch available here on this issue or the following (patch on my Google Docs) to Lib/test/test_commands.py.


--- Lib/test/test_commands.py.orig 2006-06-29 04:10:08.000000000 +0000
+++ Lib/test/test_commands.py 2012-01-02 11:19:28.535171924 +0000
@@ -46,11 +46,7 @@
         #     drwxr-xr-x   15 Joe User My Group     4096 Aug 12 12:50 /
         # Note that the first case above has a space in the group name
         # while the second one has a space in both names.
-        pat = r'''d.........   # It is a directory.
-                  \+?          # It may have ACLs.
-                  \s+\d+       # It has some number of links.
-                  [^/]*        # Skip user, group, size, and date.
-                  /\.          # and end with the name of the file.
+        pat = r'''^.*(\/\.)[\ ]*[\n\r]*$
                '''
 
         self.assert_(re.match(pat, getstatus("/."), re.VERBOSE))


Tips for building Python 2.5.6 with SSL on CentOS 6.2 (x86_64)

You need to edit the following files because of the headers and libraries paths on 64bit CentOS.
  • Modules/Setup.dist (Python 2.5.6)
  • setup.py (ssl package)
First, edit Modules/Setup.dist as follows (patch file on Google Docs page):

--- Modules/Setup.dist.orig 2006-08-06 07:26:21.000000000 +0000
+++ Modules/Setup.dist 2012-01-02 16:09:27.904863909 +0000
@@ -203,10 +203,10 @@
 
 # Socket module helper for SSL support; you must comment out the other
 # socket line above, and possibly edit the SSL variable:
-#SSL=/usr/local/ssl
-#_ssl _ssl.c \
-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-# -L$(SSL)/lib -lssl -lcrypto
+SSL=/usr
+_ssl _ssl.c \
+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+ -L$(SSL)/lib64 -lssl -lcrypto
 
 # The crypt module is now disabled by default because it breaks builds
 # on many systems (where -lcrypt is needed), e.g. Linux (I believe).

Then build Python 2.5.6 as usual.

Next, you may need ssl package from pypi.
Edit setup.py as follows (patch file on Google Docs page):

--- setup.py.orig 2009-07-28 00:45:12.000000000 +0000
+++ setup.py 2012-01-02 16:40:09.447439694 +0000
@@ -130,7 +130,8 @@
             ssl_incs += krb5_h
 
     ssl_libs = find_library_file(compiler, 'ssl',
-                                 ['/usr/lib'],
+                                 ['/usr/lib',
+                                  '/usr/lib64'],
                                  ['/usr/local/lib',
                                   '/usr/local/ssl/lib',
                                   '/usr/contrib/ssl/lib/'

Then, build the package with make.

cf. Getting SSL Support in Python 2.5.1