Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)

This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
diff --git a/Tools/scripts/gencodec.py b/Tools/scripts/gencodec.py
index 69b6ede..46563df 100644
--- a/Tools/scripts/gencodec.py
+++ b/Tools/scripts/gencodec.py
@@ -22,7 +22,7 @@
 
 """#"
 
-import string,re,os,time,marshal
+import re,os,time,marshal
 
 # Create numeric tables or character based ones ?
 numeric = 1
@@ -34,9 +34,7 @@
                    '(#.+)?')
 
 def parsecodes(codes,
-
-               split=string.split,atoi=string.atoi,len=len,
-               filter=filter,range=range):
+               len=len, filter=filter,range=range):
 
     """ Converts code combinations to either a single code integer
         or a tuple of integers.
@@ -49,12 +47,12 @@
     """
     if not codes:
         return None
-    l = split(codes,'+')
+    l = codes.split('+')
     if len(l) == 1:
-        return atoi(l[0],16)
+        return int(l[0],16)
     for i in range(len(l)):
         try:
-            l[i] = atoi(l[i],16)
+            l[i] = int(l[i],16)
         except ValueError:
             l[i] = None
     l = filter(lambda x: x is not None, l)
@@ -63,9 +61,7 @@
     else:
         return tuple(l)
 
-def readmap(filename,
-
-            strip=string.strip):
+def readmap(filename):
 
     f = open(filename,'r')
     lines = f.readlines()
@@ -76,7 +72,7 @@
     for i in range(256):
         unmapped[i] = i
     for line in lines:
-        line = strip(line)
+        line = line.strip()
         if not line or line[0] == '#':
             continue
         m = mapRE.match(line)
@@ -108,9 +104,7 @@
 
     return enc2uni
 
-def hexrepr(t,
-
-            join=string.join):
+def hexrepr(t):
 
     if t is None:
         return 'None'
@@ -118,11 +112,9 @@
         len(t)
     except:
         return '0x%04x' % t
-    return '(' + join(map(lambda t: '0x%04x' % t, t),', ') + ')'
+    return '(' + ', '.join(map(lambda t: '0x%04x' % t, t)) + ')'
 
-def unicoderepr(t,
-
-                join=string.join):
+def unicoderepr(t):
 
     if t is None:
         return 'None'
@@ -133,11 +125,9 @@
             len(t)
         except:
             return repr(unichr(t))
-        return repr(join(map(unichr, t),''))
+        return repr(''.join(map(unichr, t)))
 
-def keyrepr(t,
-
-            join=string.join):
+def keyrepr(t):
 
     if t is None:
         return 'None'
@@ -151,7 +141,7 @@
                 return repr(chr(t))
             else:
                 return repr(unichr(t))
-        return repr(join(map(chr, t),''))
+        return repr(''.join(map(chr, t)))
 
 def codegen(name,map,comments=1):
 
@@ -246,7 +236,7 @@
 
 encoding_map = codecs.make_encoding_map(decoding_map)
 ''')
-    return string.join(l,'\n')
+    return '\n'.join(l)
 
 def pymap(name,map,pyfile,comments=1):
 
@@ -269,9 +259,9 @@
     mapnames = os.listdir(dir)
     for mapname in mapnames:
         name = os.path.split(mapname)[1]
-        name = string.replace(name,'-','_')
-        name = string.split(name, '.')[0]
-        name = string.lower(name)
+        name = name.replace('-','_')
+        name = name.split('.')[0]
+        name = name.lower()
         codefile = name + '.py'
         marshalfile = name + '.mapping'
         print 'converting %s to %s and %s' % (mapname,