[Patches] Please review before applying

Fred Gansevles gansevle@cs.utwente.nl
Tue, 11 Apr 2000 14:25:36 +0200


For the reviewer(s):

Most of the changes are simple translations, i.e.:

    string.split (s, sep)	--> s.split (sep)

Some of the changes also take the context into account, see:
    - cgi.py
    - formatter.py
    - imaplib.py

Both 'make test' and 'Lib/compileall.py Lib' produced no error-output
so I'd expect no big problems.

The following migt go into the csv-log:
________________________________________________________________________
This (mega-)patch updates all the modules in the standard-module (all
Lib/*.py files) to use the new string-methods instead of the old string
module.

----------------------------------------------------------------
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims").  To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part

of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.
FAQ about legal
I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation.  I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.

----------------------------------------------------------------
Index: Lib/BaseHTTPServer.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/BaseHTTPServer.py,v
retrieving revision 1.9
diff -c -r1.9 BaseHTTPServer.py
*** BaseHTTPServer.py	1999/10/26 13:01:36	1.9
--- BaseHTTPServer.py	2000/04/11 11:56:38
***************
*** 67,73 ****
  import sys
  import time
  import socket # For gethostbyaddr()
- import string
  import mimetools
  import SocketServer
  
--- 67,72 ----
***************
*** 212,218 ****
      """
  
      # The Python system version, truncated to its first component.
!     sys_version = "Python/" + string.split(sys.version)[0]
  
      # The server software version.  You may want to override this.
      # The format is multiple whitespace-separated strings,
--- 211,217 ----
      """
  
      # The Python system version, truncated to its first component.
!     sys_version = "Python/" + sys.version.split[0]
  
      # The server software version.  You may want to override this.
      # The format is multiple whitespace-separated strings,
***************
*** 237,243 ****
          elif requestline[-1:] == '\n':
              requestline = requestline[:-1]
          self.requestline = requestline
!         words = string.split(requestline)
          if len(words) == 3:
              [command, path, version] = words
              if version[:5] != 'HTTP/':
--- 236,242 ----
          elif requestline[-1:] == '\n':
              requestline = requestline[:-1]
          self.requestline = requestline
!         words = requestline.split()
          if len(words) == 3:
              [command, path, version] = words
              if version[:5] != 'HTTP/':
***************
*** 485,491 ****
      """
  
      if sys.argv[1:]:
!         port = string.atoi(sys.argv[1])
      else:
          port = 8000
      server_address = ('', port)
--- 484,490 ----
      """
  
      if sys.argv[1:]:
!         port = int (sys.argv[1])
      else:
          port = 8000
      server_address = ('', port)
Index: Lib/CGIHTTPServer.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/CGIHTTPServer.py,v
retrieving revision 1.12
diff -c -r1.12 CGIHTTPServer.py
*** CGIHTTPServer.py	1999/10/18 13:43:44	1.12
--- CGIHTTPServer.py	2000/04/11 11:56:38
***************
*** 82,93 ****
      def run_cgi(self):
          """Execute a CGI script."""
          dir, rest = self.cgi_info
!         i = string.rfind(rest, '?')
          if i >= 0:
              rest, query = rest[:i], rest[i+1:]
          else:
              query = ''
!         i = string.find(rest, '/')
          if i >= 0:
              script, rest = rest[:i], rest[i:]
          else:
--- 82,93 ----
      def run_cgi(self):
          """Execute a CGI script."""
          dir, rest = self.cgi_info
!         i = rest.rfind('?')
          if i >= 0:
              rest, query = rest[:i], rest[i+1:]
          else:
              query = ''
!         i = rest.find('/')
          if i >= 0:
              script, rest = rest[:i], rest[i:]
          else:
***************
*** 149,166 ****
              accept = []
              for line in self.headers.getallmatchingheaders('accept'):
                  if line[:1] in string.whitespace:
!                     accept.append(string.strip(line))
                  else:
!                     accept = accept + string.split(line[7:], ',')
!             env['HTTP_ACCEPT'] = string.joinfields(accept, ',')
              ua = self.headers.getheader('user-agent')
              if ua:
                  env['HTTP_USER_AGENT'] = ua
              co = filter(None, self.headers.getheaders('cookie'))
              if co:
!                 env['HTTP_COOKIE'] = string.join(co, ', ')
              # XXX Other HTTP_* headers
!             decoded_query = string.replace(query, '+', ' ')
              try:
                  os.setuid(nobody)
              except os.error:
--- 149,166 ----
              accept = []
              for line in self.headers.getallmatchingheaders('accept'):
                  if line[:1] in string.whitespace:
!                     accept.append(line.strip())
                  else:
!                     accept = accept + line[7:].split(',')
!             env['HTTP_ACCEPT'] = ','.join(accept)
              ua = self.headers.getheader('user-agent')
              if ua:
                  env['HTTP_USER_AGENT'] = ua
              co = filter(None, self.headers.getheaders('cookie'))
              if co:
!                 env['HTTP_COOKIE'] = ', '.join(co)
              # XXX Other HTTP_* headers
!             decoded_query = query.replace('+', ' ')
              try:
                  os.setuid(nobody)
              except os.error:
Index: Lib/ConfigParser.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.17
diff -c -r1.17 ConfigParser.py
*** ConfigParser.py	2000/03/03 20:43:57	1.17
--- ConfigParser.py	2000/04/11 11:56:38
***************
*** 259,265 ****
          depth = 0                       
          while depth < 10:               # Loop through this until it's done
              depth = depth + 1
!             if string.find(value, "%(") >= 0:
                  try:
                      value = value % d
                  except KeyError, key:
--- 259,265 ----
          depth = 0                       
          while depth < 10:               # Loop through this until it's done
              depth = depth + 1
!             if value.find("%(") >= 0:
                  try:
                      value = value % d
                  except KeyError, key:
***************
*** 271,290 ****
          return conv(self.get(section, option))
  
      def getint(self, section, option):
!         return self.__get(section, string.atoi, option)
  
      def getfloat(self, section, option):
!         return self.__get(section, string.atof, option)
  
      def getboolean(self, section, option):
          v = self.get(section, option)
!         val = string.atoi(v)
          if val not in (0, 1):
              raise ValueError, 'Not a boolean: %s' % v
          return val
  
      def optionxform(self, optionstr):
!         return string.lower(optionstr)
  
      #
      # Regular expressions for parsing section headers and options.  Note a
--- 271,290 ----
          return conv(self.get(section, option))
  
      def getint(self, section, option):
!         return self.__get(section, int, option)
  
      def getfloat(self, section, option):
!         return self.__get(section, float, option)
  
      def getboolean(self, section, option):
          v = self.get(section, option)
!         val = int(v)
          if val not in (0, 1):
              raise ValueError, 'Not a boolean: %s' % v
          return val
  
      def optionxform(self, optionstr):
!         return optionstr.lower()
  
      #
      # Regular expressions for parsing section headers and options.  Note a
***************
*** 324,337 ****
                  break
              lineno = lineno + 1
              # comment or blank line?
!             if string.strip(line) == '' or line[0] in '#;':
                  continue
!             if string.lower(string.split(line)[0]) == 'rem' \
                 and line[0] in "rR":      # no leading whitespace
                  continue
              # continuation line?
              if line[0] in ' \t' and cursect is not None and optname:
!                 value = string.strip(line)
                  if value:
                      cursect[optname] = cursect[optname] + '\n ' + value
              # a section header or option header?
--- 324,337 ----
                  break
              lineno = lineno + 1
              # comment or blank line?
!             if line.strip() == '' or line[0] in '#;':
                  continue
!             if line.split()[0].lower() == 'rem' \
                 and line[0] in "rR":      # no leading whitespace
                  continue
              # continuation line?
              if line[0] in ' \t' and cursect is not None and optname:
!                 value = line.strip()
                  if value:
                      cursect[optname] = cursect[optname] + '\n ' + value
              # a section header or option header?
***************
*** 357,370 ****
                      mo = self.OPTCRE.match(line)
                      if mo:
                          optname, vi, optval = mo.group('option', 'vi', 'value')
!                         optname = string.lower(optname)
                          if vi in ('=', ':') and ';' in optval:
                              # ';' is a comment delimiter only if it follows
                              # a spacing character
!                             pos = string.find(optval, ';')
                              if pos and optval[pos-1] in string.whitespace:
                                  optval = optval[:pos]
!                         optval = string.strip(optval)
                          # allow empty values
                          if optval == '""':
                              optval = ''
--- 357,370 ----
                      mo = self.OPTCRE.match(line)
                      if mo:
                          optname, vi, optval = mo.group('option', 'vi', 'value')
!                         optname = optname.lower()
                          if vi in ('=', ':') and ';' in optval:
                              # ';' is a comment delimiter only if it follows
                              # a spacing character
!                             pos = optval.find(';')
                              if pos and optval[pos-1] in string.whitespace:
                                  optval = optval[:pos]
!                         optval = optval.strip()
                          # allow empty values
                          if optval == '""':
                              optval = ''
Index: Lib/MimeWriter.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/MimeWriter.py,v
retrieving revision 1.4
diff -c -r1.4 MimeWriter.py
*** MimeWriter.py	1998/04/23 13:34:57	1.4
--- MimeWriter.py	2000/04/11 11:56:38
***************
*** 7,13 ****
  """
  
  
- import string
  import mimetools
  
  
--- 7,12 ----
***************
*** 86,97 ****
          self._headers = []
  
      def addheader(self, key, value, prefix=0):
!         lines = string.splitfields(value, "\n")
          while lines and not lines[-1]: del lines[-1]
          while lines and not lines[0]: del lines[0]
          for i in range(1, len(lines)):
!             lines[i] = "    " + string.strip(lines[i])
!         value = string.joinfields(lines, "\n") + "\n"
          line = key + ": " + value
          if prefix:
              self._headers.insert(0, line)
--- 85,96 ----
          self._headers = []
  
      def addheader(self, key, value, prefix=0):
!         lines = value.split("\n")
          while lines and not lines[-1]: del lines[-1]
          while lines and not lines[0]: del lines[0]
          for i in range(1, len(lines)):
!             lines[i] = "    " + lines[i].strip()
!         value = "\n".join(lines) + "\n"
          line = key + ": " + value
          if prefix:
              self._headers.insert(0, line)
Index: Lib/SimpleHTTPServer.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/SimpleHTTPServer.py,v
retrieving revision 1.8
diff -c -r1.8 SimpleHTTPServer.py
*** SimpleHTTPServer.py	1999/11/16 19:04:32	1.8
--- SimpleHTTPServer.py	2000/04/11 11:56:38
***************
*** 10,16 ****
  
  
  import os
- import string
  import posixpath
  import BaseHTTPServer
  import urllib
--- 10,15 ----
***************
*** 79,85 ****
  
          """
          path = posixpath.normpath(urllib.unquote(path))
!         words = string.splitfields(path, '/')
          words = filter(None, words)
          path = os.getcwd()
          for word in words:
--- 78,84 ----
  
          """
          path = posixpath.normpath(urllib.unquote(path))
!         words = path.split('/')
          words = filter(None, words)
          path = os.getcwd()
          for word in words:
***************
*** 128,134 ****
          base, ext = posixpath.splitext(path)
          if self.extensions_map.has_key(ext):
              return self.extensions_map[ext]
!         ext = string.lower(ext)
          if self.extensions_map.has_key(ext):
              return self.extensions_map[ext]
          else:
--- 127,133 ----
          base, ext = posixpath.splitext(path)
          if self.extensions_map.has_key(ext):
              return self.extensions_map[ext]
!         ext = ext.lower()
          if self.extensions_map.has_key(ext):
              return self.extensions_map[ext]
          else:
Index: Lib/StringIO.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/StringIO.py,v
retrieving revision 1.9
diff -c -r1.9 StringIO.py
*** StringIO.py	2000/02/28 15:12:25	1.9
--- StringIO.py	2000/04/11 11:56:38
***************
*** 28,35 ****
  - There's a simple test set (see end of this file).
  """
  
- import string
- 
  class StringIO:
  	def __init__(self, buf = ''):
  		self.buf = buf
--- 28,33 ----
***************
*** 50,56 ****
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + string.joinfields(self.buflist, '')
  			self.buflist = []
  		if mode == 1:
  			pos = pos + self.pos
--- 48,54 ----
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + ''.join(self.buflist)
  			self.buflist = []
  		if mode == 1:
  			pos = pos + self.pos
***************
*** 65,71 ****
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + string.joinfields(self.buflist, '')
  			self.buflist = []
  		if n < 0:
  			newpos = self.len
--- 63,69 ----
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + ''.join(self.buflist)
  			self.buflist = []
  		if n < 0:
  			newpos = self.len
***************
*** 78,86 ****
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + string.joinfields(self.buflist, '')
  			self.buflist = []
! 		i = string.find(self.buf, '\n', self.pos)
  		if i < 0:
  			newpos = self.len
  		else:
--- 76,84 ----
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  		if self.buflist:
! 			self.buf = self.buf + ''.join(self.buflist)
  			self.buflist = []
! 		i = self.buf.find('\n', self.pos)
  		if i < 0:
  			newpos = self.len
  		else:
***************
*** 108,114 ****
  		newpos = self.pos + len(s)
  		if self.pos < self.len:
  			if self.buflist:
! 				self.buf = self.buf + string.joinfields(self.buflist, '')
  				self.buflist = []
  			self.buflist = [self.buf[:self.pos], s, self.buf[newpos:]]
  			self.buf = ''
--- 106,112 ----
  		newpos = self.pos + len(s)
  		if self.pos < self.len:
  			if self.buflist:
! 				self.buf = self.buf + ''.join(self.buflist)
  				self.buflist = []
  			self.buflist = [self.buf[:self.pos], s, self.buf[newpos:]]
  			self.buf = ''
***************
*** 117,129 ****
  			self.len = newpos
  		self.pos = newpos
  	def writelines(self, list):
! 		self.write(string.joinfields(list, ''))
  	def flush(self):
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  	def getvalue(self):
  		if self.buflist:
! 			self.buf = self.buf + string.joinfields(self.buflist, '')
  			self.buflist = []
  		return self.buf
  
--- 115,127 ----
  			self.len = newpos
  		self.pos = newpos
  	def writelines(self, list):
! 		self.write(''.joinfields(list))
  	def flush(self):
  		if self.closed:
  			raise ValueError, "I/O operation on closed file"
  	def getvalue(self):
  		if self.buflist:
! 			self.buf = self.buf + ''.join(self.buflist)
  			self.buflist = []
  		return self.buf
  
Index: Lib/asynchat.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/asynchat.py,v
retrieving revision 1.5
diff -c -r1.5 asynchat.py
*** asynchat.py	2000/02/04 15:39:29	1.5
--- asynchat.py	2000/04/11 11:56:38
***************
*** 48,54 ****
  
  import socket
  import asyncore
- import string
  
  class async_chat (asyncore.dispatcher):
  	"""This is an abstract class.  You must derive from this class, and add
--- 48,53 ----
***************
*** 120,126 ****
  				# 3) end of buffer does not match any prefix:
  				#    collect data
  				terminator_len = len(terminator)
! 				index = string.find (self.ac_in_buffer, terminator)
  				if index != -1:
  					# we found the terminator
  					self.collect_incoming_data (self.ac_in_buffer[:index])
--- 119,125 ----
  				# 3) end of buffer does not match any prefix:
  				#    collect data
  				terminator_len = len(terminator)
! 				index = self.ac_in_buffer.find (terminator)
  				if index != -1:
  					# we found the terminator
  					self.collect_incoming_data (self.ac_in_buffer[:index])
Index: Lib/asyncore.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/asyncore.py,v
retrieving revision 1.5
diff -c -r1.5 asyncore.py
*** asyncore.py	2000/02/25 11:48:42	1.5
--- asyncore.py	2000/04/11 11:56:39
***************
*** 48,54 ****
  
  import select
  import socket
- import string
  import sys
  
  import os
--- 48,53 ----
***************
*** 152,158 ****
  				status.append ('%s:%d' % self.addr)
  			return '<%s %s at %x>' % (
  				self.__class__.__name__,
! 				string.join (status, ' '),
  				id(self)
  				)
  		except:
--- 151,157 ----
  				status.append ('%s:%d' % self.addr)
  			return '<%s %s at %x>' % (
  				self.__class__.__name__,
! 				' '.join (status),
  				id(self)
  				)
  		except:
***************
*** 407,418 ****
  	del tb
  
  	file, function, line = tbinfo[-1]
! 	info = '[' + string.join (
  		map (
! 			lambda x: string.join (x, '|'),
  			tbinfo
  			),
! 		'] ['
  		) + ']'
  	return (file, function, line), t, v, info
  
--- 406,417 ----
  	del tb
  
  	file, function, line = tbinfo[-1]
! 	info = '[' + '] ['.join (
  		map (
! 			lambda x: '|'.join (x),
  			tbinfo
  			),
! 		
  		) + ']'
  	return (file, function, line), t, v, info
  
Index: Lib/bdb.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/bdb.py,v
retrieving revision 1.27
diff -c -r1.27 bdb.py
*** bdb.py	2000/02/02 15:10:14	1.27
--- bdb.py	2000/04/11 11:56:39
***************
*** 304,310 ****
      # 
      
      def format_stack_entry(self, frame_lineno, lprefix=': '):
!         import linecache, repr, string
          frame, lineno = frame_lineno
          filename = self.canonic(frame.f_code.co_filename)
          s = filename + '(' + `lineno` + ')'
--- 304,310 ----
      # 
      
      def format_stack_entry(self, frame_lineno, lprefix=': '):
!         import linecache, repr
          frame, lineno = frame_lineno
          filename = self.canonic(frame.f_code.co_filename)
          s = filename + '(' + `lineno` + ')'
***************
*** 325,331 ****
              s = s + '->'
              s = s + repr.repr(rv)
          line = linecache.getline(filename, lineno)
!         if line: s = s + lprefix + string.strip(line)
          return s
      
      # The following two methods can be called by clients to use
--- 325,331 ----
              s = s + '->'
              s = s + repr.repr(rv)
          line = linecache.getline(filename, lineno)
!         if line: s = s + lprefix + line.strip()
          return s
      
      # The following two methods can be called by clients to use
***************
*** 532,543 ****
          if not name: name = '???'
          print '+++ call', name, args
      def user_line(self, frame):
!         import linecache, string
          name = frame.f_code.co_name
          if not name: name = '???'
          fn = self.canonic(frame.f_code.co_filename)
          line = linecache.getline(fn, frame.f_lineno)
!         print '+++', fn, frame.f_lineno, name, ':', string.strip(line)
      def user_return(self, frame, retval):
          print '+++ return', retval
      def user_exception(self, frame, exc_stuff):
--- 532,543 ----
          if not name: name = '???'
          print '+++ call', name, args
      def user_line(self, frame):
!         import linecache
          name = frame.f_code.co_name
          if not name: name = '???'
          fn = self.canonic(frame.f_code.co_filename)
          line = linecache.getline(fn, frame.f_lineno)
!         print '+++', fn, frame.f_lineno, name, ':', line.strip()
      def user_return(self, frame, retval):
          print '+++ return', retval
      def user_exception(self, frame, exc_stuff):
Index: Lib/binhex.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/binhex.py,v
retrieving revision 1.12
diff -c -r1.12 binhex.py
*** binhex.py	2000/02/04 15:39:29	1.12
--- binhex.py	2000/04/11 11:56:39
***************
*** 99,105 ****
          dsize = fp.tell()
          fp.close()
          dir, file = os.path.split(name)
!         file = string.replace(file, ':', '-', 1)
          return file, finfo, dsize, 0
  
      class openrsrc:
--- 99,105 ----
          dsize = fp.tell()
          fp.close()
          dir, file = os.path.split(name)
!         file = file.replace(':', '-', 1)
          return file, finfo, dsize, 0
  
      class openrsrc:
Index: Lib/cgi.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/cgi.py,v
retrieving revision 1.47
diff -c -r1.47 cgi.py
*** cgi.py	2000/02/28 15:12:25	1.47
--- cgi.py	2000/04/11 11:56:40
***************
*** 518,524 ****
          if ctype == 'multipart/form-data':
              return parse_multipart(fp, pdict)
          elif ctype == 'application/x-www-form-urlencoded':
!             clength = string.atoi(environ['CONTENT_LENGTH'])
              if maxlen and clength > maxlen:
                  raise ValueError, 'Maximum content length exceeded'
              qs = fp.read(clength)
--- 518,524 ----
          if ctype == 'multipart/form-data':
              return parse_multipart(fp, pdict)
          elif ctype == 'application/x-www-form-urlencoded':
!             clength = int(environ['CONTENT_LENGTH'])
              if maxlen and clength > maxlen:
                  raise ValueError, 'Maximum content length exceeded'
              qs = fp.read(clength)
***************
*** 589,604 ****
  
         Returns a list, as God intended.
      """
!     name_value_pairs = string.splitfields(qs, '&')
      r=[]
      for name_value in name_value_pairs:
!         nv = string.splitfields(name_value, '=')
          if len(nv) != 2:
              if strict_parsing:
                  raise ValueError, "bad query field: %s" % `name_value`
              continue
!         name = urllib.unquote(string.replace(nv[0], '+', ' '))
!         value = urllib.unquote(string.replace(nv[1], '+', ' '))
          r.append((name, value))
  
      return r
--- 589,604 ----
  
         Returns a list, as God intended.
      """
!     name_value_pairs = qs.split('&')
      r=[]
      for name_value in name_value_pairs:
!         nv = name_value.split('=')
          if len(nv) != 2:
              if strict_parsing:
                  raise ValueError, "bad query field: %s" % `name_value`
              continue
!         name = urllib.unquote(nv[0].replace('+', ' '))
!         value = urllib.unquote(nv[1].replace('+', ' '))
          r.append((name, value))
  
      return r
***************
*** 643,650 ****
              clength = headers.getheader('content-length')
              if clength:
                  try:
!                     bytes = string.atoi(clength)
!                 except string.atoi_error:
                      pass
              if bytes > 0:
                  if maxlen and bytes > maxlen:
--- 643,650 ----
              clength = headers.getheader('content-length')
              if clength:
                  try:
!                     bytes = int(clength)
!                 except ValueError:
                      pass
              if bytes > 0:
                  if maxlen and bytes > maxlen:
***************
*** 660,666 ****
                  terminator = lastpart # End outer loop
                  break
              if line[:2] == "--":
!                 terminator = string.strip(line)
                  if terminator in (nextpart, lastpart):
                      break
              lines.append(line)
--- 660,666 ----
                  terminator = lastpart # End outer loop
                  break
              if line[:2] == "--":
!                 terminator = line.strip()
                  if terminator in (nextpart, lastpart):
                      break
              lines.append(line)
***************
*** 676,682 ****
                  elif line[-1:] == "\n":
                      line = line[:-1]
                  lines[-1] = line
!                 data = string.joinfields(lines, "")
          line = headers['content-disposition']
          if not line:
              continue
--- 676,682 ----
                  elif line[-1:] == "\n":
                      line = line[:-1]
                  lines[-1] = line
!                 data = "".join(lines)
          line = headers['content-disposition']
          if not line:
              continue
***************
*** 701,715 ****
      Return the main content-type and a dictionary of options.
  
      """
!     plist = map(string.strip, string.splitfields(line, ';'))
!     key = string.lower(plist[0])
      del plist[0]
      pdict = {}
      for p in plist:
!         i = string.find(p, '=')
          if i >= 0:
!             name = string.lower(string.strip(p[:i]))
!             value = string.strip(p[i+1:])
              if len(value) >= 2 and value[0] == value[-1] == '"':
                  value = value[1:-1]
              pdict[name] = value
--- 701,715 ----
      Return the main content-type and a dictionary of options.
  
      """
!     plist = map(lambda s: s.strip(), line.split(';'))
!     key = plist[0].lower()
      del plist[0]
      pdict = {}
      for p in plist:
!         i = p.find('=')
          if i >= 0:
!             name = p[:i].strip().lower ()
!             value = p[i+1:].strip()
              if len(value) >= 2 and value[0] == value[-1] == '"':
                  value = value[1:-1]
              pdict[name] = value
***************
*** 820,826 ****
          self.keep_blank_values = keep_blank_values
          self.strict_parsing = strict_parsing
          if environ.has_key('REQUEST_METHOD'):
!             method = string.upper(environ['REQUEST_METHOD'])
          if method == 'GET' or method == 'HEAD':
              if environ.has_key('QUERY_STRING'):
                  qs = environ['QUERY_STRING']
--- 820,826 ----
          self.keep_blank_values = keep_blank_values
          self.strict_parsing = strict_parsing
          if environ.has_key('REQUEST_METHOD'):
!             method = environ['REQUEST_METHOD'].upper()
          if method == 'GET' or method == 'HEAD':
              if environ.has_key('QUERY_STRING'):
                  qs = environ['QUERY_STRING']
***************
*** 884,890 ****
          clen = -1
          if self.headers.has_key('content-length'):
              try:
!                 clen = string.atoi(self.headers['content-length'])
              except:
                  pass
              if maxlen and clen > maxlen:
--- 884,890 ----
          clen = -1
          if self.headers.has_key('content-length'):
              try:
!                 clen = int(self.headers['content-length'])
              except:
                  pass
              if maxlen and clen > maxlen:
***************
*** 1033,1039 ****
                  break
              self.lines.append(line)
              if line[:2] == "--":
!                 strippedline = string.strip(line)
                  if strippedline == next:
                      break
                  if strippedline == last:
--- 1033,1039 ----
                  break
              self.lines.append(line)
              if line[:2] == "--":
!                 strippedline = line.strip()
                  if strippedline == next:
                      break
                  if strippedline == last:
***************
*** 1063,1069 ****
                  break
              self.lines.append(line)
              if line[:2] == "--":
!                 strippedline = string.strip(line)
                  if strippedline == next:
                      break
                  if strippedline == last:
--- 1063,1069 ----
                  break
              self.lines.append(line)
              if line[:2] == "--":
!                 strippedline = line.strip()
                  if strippedline == next:
                      break
                  if strippedline == last:
***************
*** 1171,1181 ****
      def __getitem__( self, key ):
          v = SvFormContentDict.__getitem__( self, key )
          if v[0] in string.digits+'+-.' : 
!             try:  return  string.atoi( v ) 
              except ValueError:
!                 try:    return string.atof( v )
                  except ValueError: pass
!         return string.strip(v)
      def values( self ):
          lis = [] 
          for key in self.keys():
--- 1171,1181 ----
      def __getitem__( self, key ):
          v = SvFormContentDict.__getitem__( self, key )
          if v[0] in string.digits+'+-.' : 
!             try:  return  int( v ) 
              except ValueError:
!                 try:    return float( v )
                  except ValueError: pass
!         return v.strip()
      def values( self ):
          lis = [] 
          for key in self.keys():
***************
*** 1211,1217 ****
      def length(self, key):
          return len(self.dict[key])
      def stripped(self, key):
!         if self.dict.has_key(key): return string.strip(self.dict[key][0])
          else: return None
      def pars(self):
          return self.dict
--- 1211,1217 ----
      def length(self, key):
          return len(self.dict[key])
      def stripped(self, key):
!         if self.dict.has_key(key): return self.dict[key][0].strip()
          else: return None
      def pars(self):
          return self.dict
***************
*** 1269,1275 ****
      list = traceback.format_tb(tb, limit) + \
             traceback.format_exception_only(type, value)
      print "<PRE>%s<B>%s</B></PRE>" % (
!         escape(string.join(list[:-1], "")),
          escape(list[-1]),
          )
      del tb
--- 1269,1275 ----
      list = traceback.format_tb(tb, limit) + \
             traceback.format_exception_only(type, value)
      print "<PRE>%s<B>%s</B></PRE>" % (
!         escape("".join(list[:-1])),
          escape(list[-1]),
          )
      del tb
***************
*** 1369,1379 ****
  
  def escape(s, quote=None):
      """Replace special characters '&', '<' and '>' by SGML entities."""
!     s = string.replace(s, "&", "&amp;") # Must be done first!
!     s = string.replace(s, "<", "&lt;")
!     s = string.replace(s, ">", "&gt;",)
      if quote:
!         s = string.replace(s, '"', "&quot;")
      return s
  
  
--- 1369,1378 ----
  
  def escape(s, quote=None):
      """Replace special characters '&', '<' and '>' by SGML entities."""
!     # Replacing "&" with "&amp" must be done first!
!     s = s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
      if quote:
!         s = s.replace('"', "&quot;")
      return s
  
  
Index: Lib/cmd.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/cmd.py,v
retrieving revision 1.17
diff -c -r1.17 cmd.py
*** cmd.py	2000/02/02 15:10:14	1.17
--- cmd.py	2000/04/11 11:56:41
***************
*** 89,95 ****
          pass
  
      def onecmd(self, line):
!         line = string.strip(line)
          if line == '?':
              line = 'help'
          elif line == '!':
--- 89,95 ----
          pass
  
      def onecmd(self, line):
!         line = line.strip()
          if line == '?':
              line = 'help'
          elif line == '!':
***************
*** 102,108 ****
          self.lastcmd = line
          i, n = 0, len(line)
          while i < n and line[i] in self.identchars: i = i+1
!         cmd, arg = line[:i], string.strip(line[i:])
          if cmd == '':
              return self.default(line)
          else:
--- 102,108 ----
          self.lastcmd = line
          i, n = 0, len(line)
          while i < n and line[i] in self.identchars: i = i+1
!         cmd, arg = line[:i], line[i:].strip()
          if cmd == '':
              return self.default(line)
          else:
Index: Lib/code.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/code.py,v
retrieving revision 1.9
diff -c -r1.9 code.py
*** code.py	2000/02/28 15:12:25	1.9
--- code.py	2000/04/11 11:56:41
***************
*** 6,12 ****
  
  
  import sys
- import string
  import traceback
  from codeop import compile_command
  
--- 6,11 ----
***************
*** 242,248 ****
  
          """
          self.buffer.append(line)
!         source = string.join(self.buffer, "\n")
          more = self.runsource(source, self.filename)
          if not more:
              self.resetbuffer()
--- 241,247 ----
  
          """
          self.buffer.append(line)
!         source = "\n".join(self.buffer)
          more = self.runsource(source, self.filename)
          if not more:
              self.resetbuffer()
Index: Lib/codeop.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/codeop.py,v
retrieving revision 1.1
diff -c -r1.1 codeop.py
*** codeop.py	1998/10/22 21:56:15	1.1
--- codeop.py	2000/04/11 11:56:41
***************
*** 1,7 ****
  """Utility to compile possibly incomplete Python source code."""
  
  import sys
- import string
  import traceback
  
  def compile_command(source, filename="<input>", symbol="single"):
--- 1,6 ----
***************
*** 47,54 ****
      """
  
      # Check for source consisting of only blank lines and comments
!     for line in string.split(source, "\n"):
!         line = string.strip(line)
          if line and line[0] != '#':
              break               # Leave it alone
      else:
--- 46,53 ----
      """
  
      # Check for source consisting of only blank lines and comments
!     for line in source.split("\n"):
!         line = line.strip()
          if line and line[0] != '#':
              break               # Leave it alone
      else:
Index: Lib/dis.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/dis.py,v
retrieving revision 1.21
diff -c -r1.21 dis.py
*** dis.py	2000/03/30 15:02:11	1.21
--- dis.py	2000/04/11 11:56:41
***************
*** 1,7 ****
  """Disassembler of Python byte code into mnemonics."""
  
  import sys
- import string
  import types
  
  def dis(x=None):
--- 1,6 ----
***************
*** 64,76 ****
  		else: print '   ',
  		if i in labels: print '>>',
  		else: print '  ',
! 		print string.rjust(`i`, 4),
! 		print string.ljust(opname[op], 20),
  		i = i+1
  		if op >= HAVE_ARGUMENT:
  			oparg = ord(code[i]) + ord(code[i+1])*256
  			i = i+2
! 			print string.rjust(`oparg`, 5),
  			if op in hasconst:
  				print '(' + `co.co_consts[oparg]` + ')',
  			elif op in hasname:
--- 63,75 ----
  		else: print '   ',
  		if i in labels: print '>>',
  		else: print '  ',
! 		print `i`.rjust(4),
! 		print opname[op].ljust(20),
  		i = i+1
  		if op >= HAVE_ARGUMENT:
  			oparg = ord(code[i]) + ord(code[i+1])*256
  			i = i+2
! 			print `oparg`.rjust(5),
  			if op in hasconst:
  				print '(' + `co.co_consts[oparg]` + ')',
  			elif op in hasname:
Index: Lib/dospath.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/dospath.py,v
retrieving revision 1.12
diff -c -r1.12 dospath.py
*** dospath.py	2000/02/04 15:39:29	1.12
--- dospath.py	2000/04/11 11:56:41
***************
*** 15,21 ****
      single '_', but this has been removed.  This functionality should 
      possibly be added as a new function."""
  
!     return string.lower(string.replace(s, "/", "\\"))
  
  
  def isabs(s):
--- 15,21 ----
      single '_', but this has been removed.  This functionality should 
      possibly be added as a new function."""
  
!     return s.replace(s, "/", "\\").lower()
  
  
  def isabs(s):
***************
*** 248,256 ****
              path = path[index + 1:]
              pathlen = len(path)
              try:
!                 index = string.index(path, '\'')
                  res = res + '\'' + path[:index + 1]
!             except string.index_error:
                  res = res + path
                  index = pathlen -1
          elif c == '$':  # variable or '$$'
--- 248,256 ----
              path = path[index + 1:]
              pathlen = len(path)
              try:
!                 index = path.index('\'')
                  res = res + '\'' + path[:index + 1]
!             except ValueError:
                  res = res + path
                  index = pathlen -1
          elif c == '$':  # variable or '$$'
***************
*** 261,271 ****
                  path = path[index+2:]
                  pathlen = len(path)
                  try:
!                     index = string.index(path, '}')
                      var = path[:index]
                      if os.environ.has_key(var):
                          res = res + os.environ[var]
!                 except string.index_error:
                      res = res + path
                      index = pathlen - 1
              else:
--- 261,271 ----
                  path = path[index+2:]
                  pathlen = len(path)
                  try:
!                     index = path.index('}')
                      var = path[:index]
                      if os.environ.has_key(var):
                          res = res + os.environ[var]
!                 except ValueError:
                      res = res + path
                      index = pathlen - 1
              else:
***************
*** 290,301 ****
      """Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
      Also, components of the path are silently truncated to 8+3 notation."""
  
!     path = string.replace(path, "/", "\\")
      prefix, path = splitdrive(path)
      while path[:1] == os.sep:
          prefix = prefix + os.sep
          path = path[1:]
!     comps = string.splitfields(path, os.sep)
      i = 0
      while i < len(comps):
          if comps[i] == '.':
--- 290,301 ----
      """Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
      Also, components of the path are silently truncated to 8+3 notation."""
  
!     path = path.replace("/", "\\")
      prefix, path = splitdrive(path)
      while path[:1] == os.sep:
          prefix = prefix + os.sep
          path = path[1:]
!     comps = path.split(os.sep)
      i = 0
      while i < len(comps):
          if comps[i] == '.':
***************
*** 307,313 ****
          elif comps[i] == '' and i > 0 and comps[i-1] <> '':
              del comps[i]
          elif '.' in comps[i]:
!             comp = string.splitfields(comps[i], '.')
              comps[i] = comp[0][:8] + '.' + comp[1][:3]
              i = i+1
          elif len(comps[i]) > 8:
--- 307,313 ----
          elif comps[i] == '' and i > 0 and comps[i-1] <> '':
              del comps[i]
          elif '.' in comps[i]:
!             comp = comps[i].split('.')
              comps[i] = comp[0][:8] + '.' + comp[1][:3]
              i = i+1
          elif len(comps[i]) > 8:
***************
*** 318,324 ****
      # If the path is now empty, substitute '.'
      if not prefix and not comps:
          comps.append('.')
!     return prefix + string.joinfields(comps, os.sep)
  
  
  
--- 318,324 ----
      # If the path is now empty, substitute '.'
      if not prefix and not comps:
          comps.append('.')
!     return prefix + os.sep.join(comps)
  
  
  
Index: Lib/formatter.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/formatter.py,v
retrieving revision 1.15
diff -c -r1.15 formatter.py
*** formatter.py	2000/02/04 15:39:29	1.15
--- formatter.py	2000/04/11 11:56:42
***************
*** 157,175 ****
                  label = s + label
              index = index + 1
          if case == 'I':
!             return string.upper(label)
          return label
  
      def add_flowing_data(self, data,
                           # These are only here to load them into locals:
!                          whitespace = string.whitespace,
!                          join = string.join, split = string.split):
          if not data: return
          # The following looks a bit convoluted but is a great improvement over
          # data = regsub.gsub('[' + string.whitespace + ']+', ' ', data)
          prespace = data[:1] in whitespace
          postspace = data[-1:] in whitespace
!         data = join(split(data))
          if self.nospace and not data:
              return
          elif prespace or self.softspace:
--- 157,174 ----
                  label = s + label
              index = index + 1
          if case == 'I':
!             return label.upper()
          return label
  
      def add_flowing_data(self, data,
                           # These are only here to load them into locals:
!                          whitespace = string.whitespace):
          if not data: return
          # The following looks a bit convoluted but is a great improvement over
          # data = regsub.gsub('[' + string.whitespace + ']+', ' ', data)
          prespace = data[:1] in whitespace
          postspace = data[-1:] in whitespace
!         data = ' '.join (data.split())
          if self.nospace and not data:
              return
          elif prespace or self.softspace:
***************
*** 369,379 ****
  
      def send_literal_data(self, data):
          self.file.write(data)
!         i = string.rfind(data, '\n')
          if i >= 0:
              self.col = 0
              data = data[i+1:]
!         data = string.expandtabs(data)
          self.col = self.col + len(data)
          self.atbreak = 0
  
--- 368,378 ----
  
      def send_literal_data(self, data):
          self.file.write(data)
!         i = data.rfind('\n')
          if i >= 0:
              self.col = 0
              data = data[i+1:]
!         data = data.expandtabs()
          self.col = self.col + len(data)
          self.atbreak = 0
  
***************
*** 383,389 ****
          col = self.col
          maxcol = self.maxcol
          write = self.file.write
!         for word in string.split(data):
              if atbreak:
                  if col + len(word) >= maxcol:
                      write('\n')
--- 382,388 ----
          col = self.col
          maxcol = self.maxcol
          write = self.file.write
!         for word in data.split():
              if atbreak:
                  if col + len(word) >= maxcol:
                      write('\n')
Index: Lib/ftplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/ftplib.py,v
retrieving revision 1.42
diff -c -r1.42 ftplib.py
*** ftplib.py	2000/03/28 21:45:45	1.42
--- ftplib.py	2000/04/11 11:56:42
***************
*** 37,43 ****
  
  import os
  import sys
- import string
  
  # Import SOCKS module if it exists, else standard socket module socket
  try:
--- 37,42 ----
***************
*** 235,244 ****
  
  	def sendport(self, host, port):
  		'''Send a PORT command with the current host and the given port number.'''
! 		hbytes = string.splitfields(host, '.')
  		pbytes = [`port/256`, `port%256`]
  		bytes = hbytes + pbytes
! 		cmd = 'PORT ' + string.joinfields(bytes, ',')
  		return self.voidcmd(cmd)
  
  	def makeport(self):
--- 234,243 ----
  
  	def sendport(self, host, port):
  		'''Send a PORT command with the current host and the given port number.'''
! 		hbytes = host.split('.')
  		pbytes = [`port/256`, `port%256`]
  		bytes = hbytes + pbytes
! 		cmd = 'PORT ' + ','.join(bytes)
  		return self.voidcmd(cmd)
  
  	def makeport(self):
***************
*** 448,454 ****
  		# Note that the RFC doesn't say anything about 'SIZE'
  		resp = self.sendcmd('SIZE ' + filename)
  		if resp[:3] == '213':
! 			return string.atoi(string.strip(resp[3:]))
  
  	def mkd(self, dirname):
  		'''Make a directory, return its full pathname.'''
--- 447,453 ----
  		# Note that the RFC doesn't say anything about 'SIZE'
  		resp = self.sendcmd('SIZE ' + filename)
  		if resp[:3] == '213':
! 			return int(resp[3:].strip())
  
  	def mkd(self, dirname):
  		'''Make a directory, return its full pathname.'''
***************
*** 492,498 ****
  		_150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORECASE)
  	m = _150_re.match(resp)
  	if m:
! 		return string.atoi(m.group(1))
  	return None
  
  
--- 491,497 ----
  		_150_re = re.compile("150 .* \((\d+) bytes\)", re.IGNORECASE)
  	m = _150_re.match(resp)
  	if m:
! 		return int(m.group(1))
  	return None
  
  
***************
*** 503,518 ****
  
  	if resp[:3] <> '227':
  		raise error_reply, resp
! 	left = string.find(resp, '(')
  	if left < 0: raise error_proto, resp
! 	right = string.find(resp, ')', left + 1)
  	if right < 0:
  		raise error_proto, resp	# should contain '(h1,h2,h3,h4,p1,p2)'
! 	numbers = string.split(resp[left+1:right], ',')
  	if len(numbers) <> 6:
  		raise error_proto, resp
! 	host = string.join(numbers[:4], '.')
! 	port = (string.atoi(numbers[4]) << 8) + string.atoi(numbers[5])
  	return host, port
  
  
--- 502,517 ----
  
  	if resp[:3] <> '227':
  		raise error_reply, resp
! 	left = resp.find('(')
  	if left < 0: raise error_proto, resp
! 	right = resp.find(')', left + 1)
  	if right < 0:
  		raise error_proto, resp	# should contain '(h1,h2,h3,h4,p1,p2)'
! 	numbers = resp[left+1:right].split(',')
  	if len(numbers) <> 6:
  		raise error_proto, resp
! 	host = '.'.join(numbers[:4])
! 	port = (int(numbers[4]) << 8) + int(numbers[5])
  	return host, port
  
  
***************
*** 590,602 ****
  		while 1:
  			line = fp.readline()
  			if not line: break
! 			if in_macro and string.strip(line):
  				macro_lines.append(line)
  				continue
  			elif in_macro:
  				self.__macros[macro_name] = tuple(macro_lines)
  				in_macro = 0
! 			words = string.split(line)
  			host = user = passwd = acct = None
  			default = 0
  			i = 0
--- 589,601 ----
  		while 1:
  			line = fp.readline()
  			if not line: break
! 			if in_macro and line.strip():
  				macro_lines.append(line)
  				continue
  			elif in_macro:
  				self.__macros[macro_name] = tuple(macro_lines)
  				in_macro = 0
! 			words = line.split()
  			host = user = passwd = acct = None
  			default = 0
  			i = 0
***************
*** 609,615 ****
  				if w1 == 'default':
  					default = 1
  				elif w1 == 'machine' and w2:
! 					host = string.lower(w2)
  					i = i + 1
  				elif w1 == 'login' and w2:
  					user = w2
--- 608,614 ----
  				if w1 == 'default':
  					default = 1
  				elif w1 == 'machine' and w2:
! 					host = w2.lower()
  					i = i + 1
  				elif w1 == 'login' and w2:
  					user = w2
***************
*** 651,657 ****
  		password, and the accounting field.
  
  		"""
! 		host = string.lower(host)
  		user = passwd = acct = None
  		if self.__hosts.has_key(host):
  			user, passwd, acct = self.__hosts[host]
--- 650,656 ----
  		password, and the accounting field.
  
  		"""
! 		host = host.lower()
  		user = passwd = acct = None
  		if self.__hosts.has_key(host):
  			user, passwd, acct = self.__hosts[host]
Index: Lib/gopherlib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/gopherlib.py,v
retrieving revision 1.7
diff -c -r1.7 gopherlib.py
*** gopherlib.py	2000/03/28 21:45:45	1.7
--- gopherlib.py	2000/04/11 11:56:42
***************
*** 1,7 ****
  """Gopher protocol client interface."""
  
- import string
- 
  # Default selector, host and port
  DEF_SELECTOR = '1/'
  DEF_HOST     = 'gopher.micro.umn.edu'
--- 1,5 ----
***************
*** 56,70 ****
  def send_selector(selector, host, port = 0):
      """Send a selector to a given host and port, return a file with the reply."""
      import socket
-     import string
      if not port:
!         i = string.find(host, ':')
          if i >= 0:
!             host, port = host[:i], string.atoi(host[i+1:])
      if not port:
          port = DEF_PORT
      elif type(port) == type(''):
!         port = string.atoi(port)
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      s.connect((host, port))
      s.send(selector + CRLF)
--- 54,67 ----
  def send_selector(selector, host, port = 0):
      """Send a selector to a given host and port, return a file with the reply."""
      import socket
      if not port:
!         i = host.find(':')
          if i >= 0:
!             host, port = host[:i], int(host[i+1:])
      if not port:
          port = DEF_PORT
      elif type(port) == type(''):
!         port = int(port)
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      s.connect((host, port))
      s.send(selector + CRLF)
***************
*** 96,102 ****
  
  def get_directory(f):
      """Get a directory in the form of a list of entries."""
-     import string
      list = []
      while 1:
          line = f.readline()
--- 93,98 ----
***************
*** 113,119 ****
              print '(Empty line from server)'
              continue
          gtype = line[0]
!         parts = string.splitfields(line[1:], TAB)
          if len(parts) < 4:
              print '(Bad line from server:', `line`, ')'
              continue
--- 109,115 ----
              print '(Empty line from server)'
              continue
          gtype = line[0]
!         parts = line[1:].split(TAB)
          if len(parts) < 4:
              print '(Bad line from server:', `line`, ')'
              continue
Index: Lib/gzip.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/gzip.py,v
retrieving revision 1.17
diff -c -r1.17 gzip.py
*** gzip.py	2000/02/04 15:39:29	1.17
--- gzip.py	2000/04/11 11:56:42
***************
*** 6,12 ****
  # based on Andrew Kuchling's minigzip.py distributed with the zlib module
  
  import time
- import string
  import zlib
  import struct
  import __builtin__
--- 6,11 ----
***************
*** 138,144 ****
              self.fileobj.write( self.compress.compress(data) )
  
      def writelines(self,lines):
!         self.write(string.join(lines))
  
      def read(self, size=-1):
          if self.extrasize <= 0 and self.fileobj is None:
--- 137,143 ----
              self.fileobj.write( self.compress.compress(data) )
  
      def writelines(self,lines):
!         self.write(' '.join (lines))
  
      def read(self, size=-1):
          if self.extrasize <= 0 and self.fileobj is None:
***************
*** 274,290 ****
          readsize = 100
          while 1:
              c = self.read(readsize)
!             i = string.find(c, '\n')
              if i >= 0 or c == '':
                  bufs.append(c[:i+1])
                  self._unread(c[i+1:])
!                 return string.join(bufs, '')
              bufs.append(c)
              readsize = readsize * 2
  
      def readlines(self, ignored=None):
          buf = self.read()
!         lines = string.split(buf, '\n')
          for i in range(len(lines)-1):
              lines[i] = lines[i] + '\n'
          if lines and not lines[-1]:
--- 273,289 ----
          readsize = 100
          while 1:
              c = self.read(readsize)
!             i = c.find('\n')
              if i >= 0 or c == '':
                  bufs.append(c[:i+1])
                  self._unread(c[i+1:])
!                 return ''.join(bufs)
              bufs.append(c)
              readsize = readsize * 2
  
      def readlines(self, ignored=None):
          buf = self.read()
!         lines = buf.split('\n')
          for i in range(len(lines)-1):
              lines[i] = lines[i] + '\n'
          if lines and not lines[-1]:
Index: Lib/htmllib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/htmllib.py,v
retrieving revision 1.14
diff -c -r1.14 htmllib.py
*** htmllib.py	1999/05/03 18:10:15	1.14
--- htmllib.py	2000/04/11 11:56:42
***************
*** 5,11 ****
  """
  
  
- import string
  from sgmllib import SGMLParser
  from formatter import AS_IS
  
--- 5,10 ----
***************
*** 49,55 ****
          data = self.savedata
          self.savedata = None
          if not self.nofill:
!             data = string.join(string.split(data))
          return data
  
      # --- Hooks for anchors; should probably be overridden
--- 48,54 ----
          data = self.savedata
          self.savedata = None
          if not self.nofill:
!             data = ''.join(data.split())
          return data
  
      # --- Hooks for anchors; should probably be overridden
***************
*** 320,332 ****
          name = ''
          type = ''
          for attrname, value in attrs:
!             value = string.strip(value)
              if attrname == 'href':
                  href = value
              if attrname == 'name':
                  name = value
              if attrname == 'type':
!                 type = string.lower(value)
          self.anchor_bgn(href, name, type)
  
      def end_a(self):
--- 319,331 ----
          name = ''
          type = ''
          for attrname, value in attrs:
!             value = value.strip()
              if attrname == 'href':
                  href = value
              if attrname == 'name':
                  name = value
              if attrname == 'type':
!                 type = value.lower()
          self.anchor_bgn(href, name, type)
  
      def end_a(self):
***************
*** 361,370 ****
              if attrname == 'src':
                  src = value
              if attrname == 'width':
!                 try: width = string.atoi(value)
                  except: pass
              if attrname == 'height':
!                 try: height = string.atoi(value)
                  except: pass
          self.handle_image(src, alt, ismap, align, width, height)
  
--- 360,369 ----
              if attrname == 'src':
                  src = value
              if attrname == 'width':
!                 try: width = int(value)
                  except: pass
              if attrname == 'height':
!                 try: height = int(value)
                  except: pass
          self.handle_image(src, alt, ismap, align, width, height)
  
Index: Lib/httplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/httplib.py,v
retrieving revision 1.15
diff -c -r1.15 httplib.py
*** httplib.py	2000/03/28 21:45:45	1.15
--- httplib.py	2000/04/11 11:56:43
***************
*** 30,36 ****
  
  import os
  import socket
- import string
  import mimetools
  
  try:
--- 30,35 ----
***************
*** 100,110 ****
  
          """
          if not port:
!             i = string.find(host, ':')
              if i >= 0:
                  host, port = host[:i], host[i+1:]
!                 try: port = string.atoi(port)
!                 except string.atoi_error:
                      raise socket.error, "nonnumeric port"
          if not port: port = HTTP_PORT
          self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--- 99,109 ----
  
          """
          if not port:
!             i = host.find(':')
              if i >= 0:
                  host, port = host[:i], host[i+1:]
!                 try: port = int(port)
!                 except ValueError:
                      raise socket.error, "nonnumeric port"
          if not port: port = HTTP_PORT
          self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
***************
*** 134,140 ****
          For example: h.putheader('Accept', 'text/html')
  
          """
!         str = '%s: %s\r\n' % (header, string.joinfields(args,'\r\n\t'))
          self.send(str)
  
      def endheaders(self):
--- 133,139 ----
          For example: h.putheader('Accept', 'text/html')
  
          """
!         str = '%s: %s\r\n' % (header, '\r\n\t'.join(args))
          self.send(str)
  
      def endheaders(self):
***************
*** 154,163 ****
          line = self.file.readline()
          if self.debuglevel > 0: print 'reply:', `line`
          try:
!             [ver, code, msg] = string.split(line, None, 2)
          except ValueError:
            try:
!               [ver, code] = string.split(line, None, 1)
                msg = ""
            except ValueError:
                self.headers = None
--- 153,162 ----
          line = self.file.readline()
          if self.debuglevel > 0: print 'reply:', `line`
          try:
!             [ver, code, msg] = line.split(None, 2)
          except ValueError:
            try:
!               [ver, code] = line.split(None, 1)
                msg = ""
            except ValueError:
                self.headers = None
***************
*** 165,172 ****
          if ver[:5] != 'HTTP/':
              self.headers = None
              return -1, line, self.headers
!         errcode = string.atoi(code)
!         errmsg = string.strip(msg)
          self.headers = mimetools.Message(self.file, 0)
          return errcode, errmsg, self.headers
  
--- 164,171 ----
          if ver[:5] != 'HTTP/':
              self.headers = None
              return -1, line, self.headers
!         errcode = int(code)
!         errmsg = msg.strip()
          self.headers = mimetools.Message(self.file, 0)
          return errcode, errmsg, self.headers
  
***************
*** 200,210 ****
  
              """
              if not port:
!                 i = string.find(host, ':')
                  if i >= 0:
                      host, port = host[:i], host[i+1:]
!                     try: port = string.atoi(port)
!                     except string.atoi_error:
                          raise socket.error, "nonnumeric port"
              if not port: port = HTTPS_PORT
              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--- 199,209 ----
  
              """
              if not port:
!                 i = host.find(':')
                  if i >= 0:
                      host, port = host[:i], host[i+1:]
!                     try: port = int(port)
!                     except ValueError:
                          raise socket.error, "nonnumeric port"
              if not port: port = HTTPS_PORT
              sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
***************
*** 243,249 ****
      print 'errmsg  =', errmsg
      print
      if headers:
!         for header in headers.headers: print string.strip(header)
      print
      print h.getfile().read()
      if hasattr(socket, "ssl"):
--- 242,248 ----
      print 'errmsg  =', errmsg
      print
      if headers:
!         for header in headers.headers: print header.strip()
      print
      print h.getfile().read()
      if hasattr(socket, "ssl"):
***************
*** 263,269 ****
          print 'errmsg  =', errmsg
          print
          if headers:
!             for header in headers.headers: print string.strip(header)
          print
          print h.getfile().read()
  
--- 262,268 ----
          print 'errmsg  =', errmsg
          print
          if headers:
!             for header in headers.headers: print header.strip()
          print
          print h.getfile().read()
  
Index: Lib/ihooks.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/ihooks.py,v
retrieving revision 1.9
diff -c -r1.9 ihooks.py
*** ihooks.py	1998/06/29 20:31:16	1.9
--- ihooks.py	2000/04/11 11:56:43
***************
*** 55,61 ****
  import imp
  import os
  import sys
- import string
  
  
  VERBOSE = 0
--- 55,60 ----
***************
*** 410,416 ****
              assert globals is parent.__dict__
              return parent
          if '.' in pname:
!             i = string.rfind(pname, '.')
              pname = pname[:i]
              parent = self.modules[pname]
              assert parent.__name__ == pname
--- 409,415 ----
              assert globals is parent.__dict__
              return parent
          if '.' in pname:
!             i = pname.rfind('.')
              pname = pname[:i]
              parent = self.modules[pname]
              assert parent.__name__ == pname
***************
*** 419,425 ****
  
      def find_head_package(self, parent, name):
          if '.' in name:
!             i = string.find(name, '.')
              head = name[:i]
              tail = name[i+1:]
          else:
--- 418,424 ----
  
      def find_head_package(self, parent, name):
          if '.' in name:
!             i = name.find('.')
              head = name[:i]
              tail = name[i+1:]
          else:
***************
*** 441,447 ****
      def load_tail(self, q, tail):
          m = q
          while tail:
!             i = string.find(tail, '.')
              if i < 0: i = len(tail)
              head, tail = tail[:i], tail[i+1:]
              mname = "%s.%s" % (m.__name__, head)
--- 440,446 ----
      def load_tail(self, q, tail):
          m = q
          while tail:
!             i = tail.find('.')
              if i < 0: i = len(tail)
              head, tail = tail[:i], tail[i+1:]
              mname = "%s.%s" % (m.__name__, head)
***************
*** 490,496 ****
          name = module.__name__
          if '.' not in name:
              return self.import_it(name, name, None)
!         i = string.rfind(name, '.')
          pname = name[:i]
          parent = self.modules[pname]
          return self.import_it(name[i+1:], name, parent)
--- 489,495 ----
          name = module.__name__
          if '.' not in name:
              return self.import_it(name, name, None)
!         i = name.rfind('.')
          pname = name[:i]
          parent = self.modules[pname]
          return self.import_it(name[i+1:], name, parent)
Index: Lib/imaplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/imaplib.py,v
retrieving revision 1.20
diff -c -r1.20 imaplib.py
*** imaplib.py	2000/03/28 21:45:46	1.20
--- imaplib.py	2000/04/11 11:56:43
***************
*** 17,23 ****
  
  __version__ = "2.36"
  
! import binascii, re, socket, string, time, random, sys
  
  #	Globals
  
--- 17,23 ----
  
  __version__ = "2.36"
  
! import binascii, re, socket, time, random, sys
  
  #	Globals
  
***************
*** 162,168 ****
  		self._simple_command(cap)
  		if not self.untagged_responses.has_key(cap):
  			raise self.error('no CAPABILITY response from server')
! 		self.capabilities = tuple(string.split(string.upper(self.untagged_responses[cap][-1])))
  
  		if __debug__:
  			if self.debug >= 3:
--- 162,168 ----
  		self._simple_command(cap)
  		if not self.untagged_responses.has_key(cap):
  			raise self.error('no CAPABILITY response from server')
! 		self.capabilities = tuple(self.untagged_responses[cap][-1].upper().split())
  
  		if __debug__:
  			if self.debug >= 3:
***************
*** 180,186 ****
  	def __getattr__(self, attr):
  		#	Allow UPPERCASE variants of IMAP4 command methods.
  		if Commands.has_key(attr):
! 			return eval("self.%s" % string.lower(attr))
  		raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
  
  
--- 180,186 ----
  	def __getattr__(self, attr):
  		#	Allow UPPERCASE variants of IMAP4 command methods.
  		if Commands.has_key(attr):
! 			return eval("self.%s" % attr.lower())
  		raise AttributeError("Unknown IMAP4 command: '%s'" % attr)
  
  
***************
*** 219,225 ****
  
  		(code, [data]) = <instance>.response(code)
  		"""
! 		return self._untagged_response(code, [None], string.upper(code))
  
  
  	def socket(self):
--- 219,225 ----
  
  		(code, [data]) = <instance>.response(code)
  		"""
! 		return self._untagged_response(code, [None], code.upper())
  
  
  	def socket(self):
***************
*** 273,279 ****
  		It should return None if the client abort response '*' should
  		be sent instead.
  		"""
! 		mech = string.upper(mechanism)
  		cap = 'AUTH=%s' % mech
  		if not cap in self.capabilities:
  			raise self.error("Server doesn't allow %s authentication." % mech)
--- 273,279 ----
  		It should return None if the client abort response '*' should
  		be sent instead.
  		"""
! 		mech = mechanism.upper()
  		cap = 'AUTH=%s' % mech
  		if not cap in self.capabilities:
  			raise self.error("Server doesn't allow %s authentication." % mech)
***************
*** 527,533 ****
  
  		Returns response appropriate to 'command'.
  		"""
! 		command = string.upper(command)
  		if not Commands.has_key(command):
  			raise self.error("Unknown IMAP4 UID command: %s" % command)
  		if self.state not in Commands[command]:
--- 527,533 ----
  
  		Returns response appropriate to 'command'.
  		"""
! 		command = command.upper()
  		if not Commands.has_key(command):
  			raise self.error("Unknown IMAP4 UID command: %s" % command)
  		if self.state not in Commands[command]:
***************
*** 719,725 ****
  
  				# Read literal direct from connection.
  
! 				size = string.atoi(self.mo.group('size'))
  				if __debug__:
  					if self.debug >= 4:
  						_mesg('read literal size %s' % size)
--- 719,725 ----
  
  				# Read literal direct from connection.
  
! 				size = int(self.mo.group('size'))
  				if __debug__:
  					if self.debug >= 4:
  						_mesg('read literal size %s' % size)
***************
*** 822,829 ****
  
  	def _quote(self, arg):
  
! 		arg = string.replace(arg, '\\', '\\\\')
! 		arg = string.replace(arg, '"', '\\"')
  
  		return '"%s"' % arg
  
--- 822,828 ----
  
  	def _quote(self, arg):
  
! 		arg = arg.replace('\\', '\\\\').replace('"', '\\"')
  
  		return '"%s"' % arg
  
***************
*** 910,916 ****
  	zonen = mo.group('zonen')
  
  	for name in ('day', 'year', 'hour', 'min', 'sec', 'zoneh', 'zonem'):
! 		exec "%s = string.atoi(mo.group('%s'))" % (name, name)
  
  	# INTERNALDATE timezone must be subtracted to get UT
  
--- 909,915 ----
  	zonen = mo.group('zonen')
  
  	for name in ('day', 'year', 'hour', 'min', 'sec', 'zoneh', 'zonem'):
! 		exec "%s = int(mo.group('%s'))" % (name, name)
  
  	# INTERNALDATE timezone must be subtracted to get UT
  
***************
*** 956,962 ****
  	if not mo:
  		return ()
  
! 	return tuple(string.split(mo.group('flags')))
  
  
  def Time2Internaldate(date_time):
--- 955,961 ----
  	if not mo:
  		return ()
  
! 	return tuple(mo.group('flags').split())
  
  
  def Time2Internaldate(date_time):
***************
*** 1000,1008 ****
  		l = dict.items()
  		if not l: return
  		t = '\n\t\t'
! 		j = string.join
! 		l = map(lambda x,j=j:'%s: "%s"' % (x[0], x[1][0] and j(x[1], '" "') or ''), l)
! 		_mesg('untagged responses dump:%s%s' % (t, j(l, t)))
  
  	_cmd_log = []		# Last `_cmd_log_len' interactions
  	_cmd_log_len = 10
--- 999,1006 ----
  		l = dict.items()
  		if not l: return
  		t = '\n\t\t'
! 		l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join (x[1]) or ''), l)
! 		_mesg('untagged responses dump:%s%s' % (t, t.join(l)))
  
  	_cmd_log = []		# Last `_cmd_log_len' interactions
  	_cmd_log_len = 10
***************
*** 1083,1089 ****
  		for ml in run('list', ('/tmp/', 'yy%')):
  			mo = re.match(r'.*"([^"]+)"$', ml)
  			if mo: path = mo.group(1)
! 			else: path = string.split(ml)[-1]
  			run('delete', (path,))
  
  		for cmd,args in test_seq2:
--- 1081,1087 ----
  		for ml in run('list', ('/tmp/', 'yy%')):
  			mo = re.match(r'.*"([^"]+)"$', ml)
  			if mo: path = mo.group(1)
! 			else: path = ml.split()[-1]
  			run('delete', (path,))
  
  		for cmd,args in test_seq2:
***************
*** 1092,1098 ****
  			if (cmd,args) != ('uid', ('SEARCH', 'ALL')):
  				continue
  
! 			uid = string.split(dat[-1])
  			if not uid: continue
  			run('uid', ('FETCH', '%s' % uid[-1],
  				'(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)'))
--- 1090,1096 ----
  			if (cmd,args) != ('uid', ('SEARCH', 'ALL')):
  				continue
  
! 			uid = dat[-1].split()
  			if not uid: continue
  			run('uid', ('FETCH', '%s' % uid[-1],
  				'(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)'))
Index: Lib/keyword.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/keyword.py,v
retrieving revision 1.8
diff -c -r1.8 keyword.py
*** keyword.py	2000/02/04 15:10:33	1.8
--- keyword.py	2000/04/11 11:56:43
***************
*** 50,56 ****
  iskeyword = kwdict.has_key
  
  def main():
!     import sys, re, string
  
      args = sys.argv[1:]
      iptfile = args and args[0] or "Python/graminit.c"
--- 50,56 ----
  iskeyword = kwdict.has_key
  
  def main():
!     import sys, re
  
      args = sys.argv[1:]
      iptfile = args and args[0] or "Python/graminit.c"
***************
*** 64,70 ****
      while 1:
          line = fp.readline()
          if not line: break
!         if string.find(line, '{1, "') > -1:
              match = strprog.search(line)
              if match:
                  lines.append("        '" + match.group(1) + "',\n")
--- 64,70 ----
      while 1:
          line = fp.readline()
          if not line: break
!         if line.find('{1, "') > -1:
              match = strprog.search(line)
              if match:
                  lines.append("        '" + match.group(1) + "',\n")
***************
*** 87,93 ****
  
      # write the output file
      fp = open(optfile, 'w')
!     fp.write(string.join(format, ''))
      fp.close()
  
  if __name__ == "__main__":
--- 87,93 ----
  
      # write the output file
      fp = open(optfile, 'w')
!     fp.write(''.join(format))
      fp.close()
  
  if __name__ == "__main__":
Index: Lib/knee.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/knee.py,v
retrieving revision 1.4
diff -c -r1.4 knee.py
*** knee.py	1998/03/26 21:12:20	1.4
--- knee.py	2000/04/11 11:56:44
***************
*** 7,13 ****
  
  """
  
! import sys, imp, __builtin__, string
  
  
  # Replacement for __import__()
--- 7,13 ----
  
  """
  
! import sys, imp, __builtin__
  
  
  # Replacement for __import__()
***************
*** 30,36 ****
          assert globals is parent.__dict__
          return parent
      if '.' in pname:
!         i = string.rfind(pname, '.')
          pname = pname[:i]
          parent = sys.modules[pname]
          assert parent.__name__ == pname
--- 30,36 ----
          assert globals is parent.__dict__
          return parent
      if '.' in pname:
!         i = pname.rfind('.')
          pname = pname[:i]
          parent = sys.modules[pname]
          assert parent.__name__ == pname
***************
*** 39,45 ****
  
  def find_head_package(parent, name):
      if '.' in name:
!         i = string.find(name, '.')
          head = name[:i]
          tail = name[i+1:]
      else:
--- 39,45 ----
  
  def find_head_package(parent, name):
      if '.' in name:
!         i = name.find('.')
          head = name[:i]
          tail = name[i+1:]
      else:
***************
*** 61,67 ****
  def load_tail(q, tail):
      m = q
      while tail:
!         i = string.find(tail, '.')
          if i < 0: i = len(tail)
          head, tail = tail[:i], tail[i+1:]
          mname = "%s.%s" % (m.__name__, head)
--- 61,67 ----
  def load_tail(q, tail):
      m = q
      while tail:
!         i = tail.find('.')
          if i < 0: i = len(tail)
          head, tail = tail[:i], tail[i+1:]
          mname = "%s.%s" % (m.__name__, head)
***************
*** 111,117 ****
      name = module.__name__
      if '.' not in name:
          return import_module(name, name, None)
!     i = string.rfind(name, '.')
      pname = name[:i]
      parent = sys.modules[pname]
      return import_module(name[i+1:], name, parent)
--- 111,117 ----
      name = module.__name__
      if '.' not in name:
          return import_module(name, name, None)
!     i = name.rfind('.')
      pname = name[:i]
      parent = sys.modules[pname]
      return import_module(name[i+1:], name, parent)
Index: Lib/locale.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/locale.py,v
retrieving revision 1.4
diff -c -r1.4 locale.py
*** locale.py	2000/02/04 15:39:29	1.4
--- locale.py	2000/04/11 11:56:44
***************
*** 3,9 ****
  # Author: Martin von Loewis
  
  from _locale import *
- import string
  
  #perform the grouping from right to left
  def _group(s):
--- 3,8 ----
***************
*** 34,40 ****
      but takes the current locale into account. 
      Grouping is applied if the third parameter is true."""
      result = f % val
!     fields = string.splitfields(result,".")
      if grouping:
          fields[0]=_group(fields[0])
      if len(fields)==2:
--- 33,39 ----
      but takes the current locale into account. 
      Grouping is applied if the third parameter is true."""
      result = f % val
!     fields = result.split(".")
      if grouping:
          fields[0]=_group(fields[0])
      if len(fields)==2:
***************
*** 48,67 ****
      """Convert float to integer, taking the locale into account."""
      return format("%.12g",val)
  
! def atof(str,func=string.atof):
      "Parses a string as a float according to the locale settings."
      #First, get rid of the grouping
!     s=string.splitfields(str,localeconv()['thousands_sep'])
!     str=string.join(s,"")
      #next, replace the decimal point with a dot
!     s=string.splitfields(str,localeconv()['decimal_point'])
!     str=string.join(s,'.')
      #finally, parse the string
      return func(str)
  
  def atoi(str):
      "Converts a string to an integer according to the locale settings."
!     return atof(str,string.atoi)
  
  def test():
      setlocale(LC_ALL,"")
--- 47,64 ----
      """Convert float to integer, taking the locale into account."""
      return format("%.12g",val)
  
! def atof(str,func=float):
      "Parses a string as a float according to the locale settings."
      #First, get rid of the grouping
!     str=str.replace(localeconv()['thousands_sep'], '')
      #next, replace the decimal point with a dot
!     str=str.replace(localeconv()['decimal_point'], '.')
      #finally, parse the string
      return func(str)
  
  def atoi(str):
      "Converts a string to an integer according to the locale settings."
!     return atof(str,int)
  
  def test():
      setlocale(LC_ALL,"")
Index: Lib/macpath.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/macpath.py,v
retrieving revision 1.21
diff -c -r1.21 macpath.py
*** macpath.py	2000/02/04 15:10:33	1.21
--- macpath.py	2000/04/11 11:56:44
***************
*** 1,15 ****
  """Pathname and path-related operations for the Macintosh."""
  
- import string
  import os
  from stat import *
  
  
  # Normalize the case of a pathname.  Dummy in Posix, but string.lower here.
  
! normcase = string.lower
  
- 
  def isabs(s):
      """Return true if a path is absolute.
      On the Mac, relative paths begin with a colon,
--- 1,14 ----
  """Pathname and path-related operations for the Macintosh."""
  
  import os
  from stat import *
  
  
  # Normalize the case of a pathname.  Dummy in Posix, but string.lower here.
  
! def normcase(path):
!     return path.lower ()
  
  def isabs(s):
      """Return true if a path is absolute.
      On the Mac, relative paths begin with a colon,
***************
*** 163,172 ****
      # XXX The Unix version doesn't raise an exception but simply
      # returns an unnormalized path.  Should do so here too.
  
-     import string
      if ':' not in s:
          return ':' + s
!     f = string.splitfields(s, ':')
      pre = []
      post = []
      if not f[0]:
--- 162,170 ----
      # XXX The Unix version doesn't raise an exception but simply
      # returns an unnormalized path.  Should do so here too.
  
      if ':' not in s:
          return ':' + s
!     f = s.split(':')
      pre = []
      post = []
      if not f[0]:
Index: Lib/macurl2path.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/macurl2path.py,v
retrieving revision 1.7
diff -c -r1.7 macurl2path.py
*** macurl2path.py	2000/02/04 15:39:29	1.7
--- macurl2path.py	2000/04/11 11:56:44
***************
*** 2,8 ****
  
  Do not import directly; use urllib instead."""
  
- import string
  import urllib
  import os
  
--- 2,7 ----
***************
*** 19,25 ****
      	pathname = pathname[2:]
      elif pathname[:2] == '//':
          raise RuntimeError, 'Cannot convert non-local URL to pathname'
!     components = string.split(pathname, '/')
      # Remove . and embedded ..
      i = 0
      while i < len(components):
--- 18,24 ----
      	pathname = pathname[2:]
      elif pathname[:2] == '//':
          raise RuntimeError, 'Cannot convert non-local URL to pathname'
!     components = pathname.split('/')
      # Remove . and embedded ..
      i = 0
      while i < len(components):
***************
*** 35,41 ****
              i = i+1
      if not components[0]:
          # Absolute unix path, don't start with colon
!         rv = string.join(components[1:], ':')
      else:
          # relative unix path, start with colon. First replace
          # leading .. by empty strings (giving ::file)
--- 34,40 ----
              i = i+1
      if not components[0]:
          # Absolute unix path, don't start with colon
!         rv = ':'.join(components[1:])
      else:
          # relative unix path, start with colon. First replace
          # leading .. by empty strings (giving ::file)
***************
*** 43,49 ****
          while i < len(components) and components[i] == '..':
              components[i] = ''
              i = i + 1
!         rv = ':' + string.join(components, ':')
      # and finally unquote slashes and other funny characters
      return urllib.unquote(rv)
  
--- 42,48 ----
          while i < len(components) and components[i] == '..':
              components[i] = ''
              i = i + 1
!         rv = ':' + ':'.join(components)
      # and finally unquote slashes and other funny characters
      return urllib.unquote(rv)
  
***************
*** 51,57 ****
      "convert mac pathname to /-delimited pathname"
      if '/' in pathname:
          raise RuntimeError, "Cannot convert pathname containing slashes"
!     components = string.split(pathname, ':')
      # Remove empty first and/or last component
      if components[0] == '':
          del components[0]
--- 50,56 ----
      "convert mac pathname to /-delimited pathname"
      if '/' in pathname:
          raise RuntimeError, "Cannot convert pathname containing slashes"
!     components = pathname.split(':')
      # Remove empty first and/or last component
      if components[0] == '':
          del components[0]
***************
*** 65,73 ****
      components = map(_pncomp2url, components)
  
      if os.path.isabs(pathname):
!         return '/' + string.join(components, '/')
      else:
!         return string.join(components, '/')
          
  def _pncomp2url(component):
  	component = urllib.quote(component[:31], safe='')  # We want to quote slashes
--- 64,72 ----
      components = map(_pncomp2url, components)
  
      if os.path.isabs(pathname):
!         return '/' + '/'.join(components)
      else:
!         return '/'.join(components)
          
  def _pncomp2url(component):
  	component = urllib.quote(component[:31], safe='')  # We want to quote slashes
Index: Lib/mailbox.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mailbox.py,v
retrieving revision 1.19
diff -c -r1.19 mailbox.py
*** mailbox.py	2000/04/04 03:31:39	1.19
--- mailbox.py	2000/04/11 11:56:44
***************
*** 177,196 ****
          # Qmail directory mailbox
  
          def __init__(self, dirname):
-                 import string
                  self.dirname = dirname
                  self.boxes = []
  
                  # check for new mail
                  newdir = os.path.join(self.dirname, 'new')
                  for file in os.listdir(newdir):
!                         if len(string.split(file, '.')) > 2:
                                  self.boxes.append(os.path.join(newdir, file))
  
                  # Now check for current mail in this maildir
                  curdir = os.path.join(self.dirname, 'cur')
                  for file in os.listdir(curdir):
!                         if len(string.split(file, '.')) > 2:
                                  self.boxes.append(os.path.join(curdir, file))
  
          def next(self):
--- 177,195 ----
          # Qmail directory mailbox
  
          def __init__(self, dirname):
                  self.dirname = dirname
                  self.boxes = []
  
                  # check for new mail
                  newdir = os.path.join(self.dirname, 'new')
                  for file in os.listdir(newdir):
!                         if len(file.split('.')) > 2:
                                  self.boxes.append(os.path.join(newdir, file))
  
                  # Now check for current mail in this maildir
                  curdir = os.path.join(self.dirname, 'cur')
                  for file in os.listdir(curdir):
!                         if len(file.split('.')) > 2:
                                  self.boxes.append(os.path.join(curdir, file))
  
          def next(self):
***************
*** 225,231 ****
  def _test():
          import time
          import sys
-         import string
          import os
  
          args = sys.argv[1:]
--- 224,229 ----
***************
*** 261,267 ****
                  if len(args) <= 1:
                          msg.fp = None
          if len(args) > 1:
!                 num = string.atoi(args[1])
                  print 'Message %d body:'%num
                  msg = msgs[num-1]
                  msg.rewindbody()
--- 259,265 ----
                  if len(args) <= 1:
                          msg.fp = None
          if len(args) > 1:
!                 num = int(args[1])
                  print 'Message %d body:'%num
                  msg = msgs[num-1]
                  msg.rewindbody()
Index: Lib/mailcap.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mailcap.py,v
retrieving revision 1.5
diff -c -r1.5 mailcap.py
*** mailcap.py	2000/02/04 15:10:33	1.5
--- mailcap.py	2000/04/11 11:56:44
***************
*** 1,7 ****
  """Mailcap file handling.  See RFC 1524."""
  
  import os
- import string
  
  
  # Part 1: top-level interface.
--- 1,6 ----
***************
*** 36,42 ****
      # XXX Actually, this is Unix-specific
      if os.environ.has_key('MAILCAPS'):
          str = os.environ['MAILCAPS']
!         mailcaps = string.splitfields(str, ':')
      else:
          if os.environ.has_key('HOME'):
              home = os.environ['HOME']
--- 35,41 ----
      # XXX Actually, this is Unix-specific
      if os.environ.has_key('MAILCAPS'):
          str = os.environ['MAILCAPS']
!         mailcaps = str.split(':')
      else:
          if os.environ.has_key('HOME'):
              home = os.environ['HOME']
***************
*** 64,70 ****
          line = fp.readline()
          if not line: break
          # Ignore comments and blank lines
!         if line[0] == '#' or string.strip(line) == '':
              continue
          nextline = line
          # Join continuation lines
--- 63,69 ----
          line = fp.readline()
          if not line: break
          # Ignore comments and blank lines
!         if line[0] == '#' or line.strip() == '':
              continue
          nextline = line
          # Join continuation lines
***************
*** 77,86 ****
          if not (key and fields):
              continue
          # Normalize the key
!         types = string.splitfields(key, '/')
          for j in range(len(types)):
!             types[j] = string.strip(types[j])
!         key = string.lower(string.joinfields(types, '/'))
          # Update the database
          if caps.has_key(key):
              caps[key].append(fields)
--- 76,85 ----
          if not (key and fields):
              continue
          # Normalize the key
!         types = key.split('/')
          for j in range(len(types)):
!             types[j] = types[j].strip()
!         key = '/'.join(types).lower()
          # Update the database
          if caps.has_key(key):
              caps[key].append(fields)
***************
*** 105,117 ****
      key, view, rest = fields[0], fields[1], fields[2:]
      fields = {'view': view}
      for field in rest:
!         i = string.find(field, '=')
          if i < 0:
              fkey = field
              fvalue = ""
          else:
!             fkey = string.strip(field[:i])
!             fvalue = string.strip(field[i+1:])
          if fields.has_key(fkey):
              # Ignore it
              pass
--- 104,116 ----
      key, view, rest = fields[0], fields[1], fields[2:]
      fields = {'view': view}
      for field in rest:
!         i = field.find('=')
          if i < 0:
              fkey = field
              fvalue = ""
          else:
!             fkey = field[:i].strip()
!             fvalue = field[i+1:].strip()
          if fields.has_key(fkey):
              # Ignore it
              pass
***************
*** 130,136 ****
              i = i+2
          else:
              i = i+1
!     return string.strip(line[start:i]), i
  
  
  # Part 3: using the database.
--- 129,135 ----
              i = i+2
          else:
              i = i+1
!     return line[start:i].strip(), i
  
  
  # Part 3: using the database.
***************
*** 159,165 ****
      entries = []
      if caps.has_key(MIMEtype):
          entries = entries + caps[MIMEtype]
!     MIMEtypes = string.splitfields(MIMEtype, '/')
      MIMEtype = MIMEtypes[0] + '/*'
      if caps.has_key(MIMEtype):
          entries = entries + caps[MIMEtype]
--- 158,164 ----
      entries = []
      if caps.has_key(MIMEtype):
          entries = entries + caps[MIMEtype]
!     MIMEtypes = MIMEtype.split('/')
      MIMEtype = MIMEtypes[0] + '/*'
      if caps.has_key(MIMEtype):
          entries = entries + caps[MIMEtype]
***************
*** 200,209 ****
      return res
  
  def findparam(name, plist):
!     name = string.lower(name) + '='
      n = len(name)
      for p in plist:
!         if string.lower(p[:n]) == name:
              return p[n:]
      return ''
  
--- 199,208 ----
      return res
  
  def findparam(name, plist):
!     name = name.lower() + '='
      n = len(name)
      for p in plist:
!         if p[:n].lower() == name:
              return p[n:]
      return ''
  
Index: Lib/mhlib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mhlib.py,v
retrieving revision 1.19
diff -c -r1.19 mhlib.py
*** mhlib.py	2000/02/04 15:10:33	1.19
--- mhlib.py	2000/04/11 11:56:45
***************
*** 214,220 ****
          """Create a new folder (or raise os.error if it cannot be created)."""
          protect = pickline(self.profile, 'Folder-Protect')
          if protect and isnumeric(protect):
!             mode = string.atoi(protect, 8)
          else:
              mode = FOLDER_PROTECT
          os.mkdir(os.path.join(self.getpath(), name), mode)
--- 214,220 ----
          """Create a new folder (or raise os.error if it cannot be created)."""
          protect = pickline(self.profile, 'Folder-Protect')
          if protect and isnumeric(protect):
!             mode = int(protect, 8)
          else:
              mode = FOLDER_PROTECT
          os.mkdir(os.path.join(self.getpath(), name), mode)
***************
*** 284,290 ****
          for name in os.listdir(self.getfullname()):
              if match(name):
                  append(name)
!         messages = map(string.atoi, messages)
          messages.sort()
          if messages:
              self.last = messages[-1]
--- 284,290 ----
          for name in os.listdir(self.getfullname()):
              if match(name):
                  append(name)
!         messages = map(int, messages)
          messages.sort()
          if messages:
              self.last = messages[-1]
***************
*** 303,314 ****
          while 1:
              line = f.readline()
              if not line: break
!             fields = string.splitfields(line, ':')
              if len(fields) <> 2:
                  self.error('bad sequence in %s: %s' %
!                           (fullname, string.strip(line)))
!             key = string.strip(fields[0])
!             value = IntSet(string.strip(fields[1]), ' ').tolist()
              sequences[key] = value
          return sequences
  
--- 303,314 ----
          while 1:
              line = f.readline()
              if not line: break
!             fields = line.split(':')
              if len(fields) <> 2:
                  self.error('bad sequence in %s: %s' %
!                           (fullname, line.strip()))
!             key = fields[0].strip()
!             value = IntSet(fields[1].strip(), ' ').tolist()
              sequences[key] = value
          return sequences
  
***************
*** 358,364 ****
          if seq == 'all':
              return all
          # Test for X:Y before X-Y because 'seq:-n' matches both
!         i = string.find(seq, ':')
          if i >= 0:
              head, dir, tail = seq[:i], '', seq[i+1:]
              if tail[:1] in '-+':
--- 358,364 ----
          if seq == 'all':
              return all
          # Test for X:Y before X-Y because 'seq:-n' matches both
!         i = seq.find(':')
          if i >= 0:
              head, dir, tail = seq[:i], '', seq[i+1:]
              if tail[:1] in '-+':
***************
*** 366,372 ****
              if not isnumeric(tail):
                  raise Error, "bad message list %s" % seq
              try:
!                 count = string.atoi(tail)
              except (ValueError, OverflowError):
                  # Can't use sys.maxint because of i+count below
                  count = len(all)
--- 366,372 ----
              if not isnumeric(tail):
                  raise Error, "bad message list %s" % seq
              try:
!                 count = int(tail)
              except (ValueError, OverflowError):
                  # Can't use sys.maxint because of i+count below
                  count = len(all)
***************
*** 396,402 ****
                      i = bisect(all, anchor-1)
                      return all[i:i+count]
          # Test for X-Y next
!         i = string.find(seq, '-')
          if i >= 0:
              begin = self._parseindex(seq[:i], all)
              end = self._parseindex(seq[i+1:], all)
--- 396,402 ----
                      i = bisect(all, anchor-1)
                      return all[i:i+count]
          # Test for X-Y next
!         i = seq.find('-')
          if i >= 0:
              begin = self._parseindex(seq[:i], all)
              end = self._parseindex(seq[i+1:], all)
***************
*** 429,435 ****
          """Internal: parse a message number (or cur, first, etc.)."""
          if isnumeric(seq):
              try:
!                 return string.atoi(seq)
              except (OverflowError, ValueError):
                  return sys.maxint
          if seq in ('cur', '.'):
--- 429,435 ----
          """Internal: parse a message number (or cur, first, etc.)."""
          if isnumeric(seq):
              try:
!                 return int(seq)
              except (OverflowError, ValueError):
                  return sys.maxint
          if seq in ('cur', '.'):
***************
*** 679,694 ****
          decide which headers to return (its argument is the header
          name converted to lower case)."""
          if not pred:
!             return string.joinfields(self.headers, '')
          headers = []
          hit = 0
          for line in self.headers:
              if line[0] not in string.whitespace:
!                 i = string.find(line, ':')
                  if i > 0:
!                     hit = pred(string.lower(line[:i]))
              if hit: headers.append(line)
!         return string.joinfields(headers, '')
  
      def getbodytext(self, decode = 1):
          """Return the message's body text as string.  This undoes a
--- 679,694 ----
          decide which headers to return (its argument is the header
          name converted to lower case)."""
          if not pred:
!             return ''.join(self.headers)
          headers = []
          hit = 0
          for line in self.headers:
              if line[0] not in string.whitespace:
!                 i = line.find(':')
                  if i > 0:
!                     hit = pred(line[:i].lower())
              if hit: headers.append(line)
!         return ''.join(headers)
  
      def getbodytext(self, decode = 1):
          """Return the message's body text as string.  This undoes a
***************
*** 883,895 ****
          self.normalize()
  
      def fromstring(self, data):
-         import string
          new = []
!         for part in string.splitfields(data, self.sep):
              list = []
!             for subp in string.splitfields(part, self.rng):
!                 s = string.strip(subp)
!                 list.append(string.atoi(s))
              if len(list) == 1:
                  new.append((list[0], list[0]))
              elif len(list) == 2 and list[0] <= list[1]:
--- 883,894 ----
          self.normalize()
  
      def fromstring(self, data):
          new = []
!         for part in data.split(self.sep):
              list = []
!             for subp in part.split(self.rng):
!                 s = subp.strip()
!                 list.append(int(s))
              if len(list) == 1:
                  new.append((list[0], list[0]))
              elif len(list) == 2 and list[0] <= list[1]:
***************
*** 919,925 ****
                  if not line or line[0] not in string.whitespace:
                      break
                  text = text + line
!             return string.strip(text)
      return None
  
  def updateline(file, key, value, casefold = 1):
--- 918,924 ----
                  if not line or line[0] not in string.whitespace:
                      break
                  text = text + line
!             return text.strip()
      return None
  
  def updateline(file, key, value, casefold = 1):
***************
*** 994,1000 ****
          except Error, msg:
              print "Error:", msg
          stuff = os.popen("pick %s 2>/dev/null" % `seq`).read()
!         list = map(string.atoi, string.split(stuff))
          print list, "<-- pick"
      do('f.listmessages()')
  
--- 993,999 ----
          except Error, msg:
              print "Error:", msg
          stuff = os.popen("pick %s 2>/dev/null" % `seq`).read()
!         list = map(int, stuff.split())
          print list, "<-- pick"
      do('f.listmessages()')
  
Index: Lib/mimetools.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mimetools.py,v
retrieving revision 1.17
diff -c -r1.17 mimetools.py
*** mimetools.py	2000/04/04 20:53:07	1.17
--- mimetools.py	2000/04/11 11:56:45
***************
*** 3,9 ****
  
  import os
  import rfc822
- import string
  import tempfile
  
  
--- 3,8 ----
***************
*** 25,41 ****
  		if str == None:
  			str = 'text/plain'
  		if ';' in str:
! 			i = string.index(str, ';')
  			self.plisttext = str[i:]
  			str = str[:i]
  		else:
  			self.plisttext = ''
! 		fields = string.splitfields(str, '/')
  		for i in range(len(fields)):
! 			fields[i] = string.lower(string.strip(fields[i]))
! 		self.type = string.joinfields(fields, '/')
  		self.maintype = fields[0]
! 		self.subtype = string.joinfields(fields[1:], '/')
  
  	def parseplist(self):
  		str = self.plisttext
--- 24,40 ----
  		if str == None:
  			str = 'text/plain'
  		if ';' in str:
! 			i = str.index(';')
  			self.plisttext = str[i:]
  			str = str[:i]
  		else:
  			self.plisttext = ''
! 		fields = str.split('/')
  		for i in range(len(fields)):
! 			fields[i] = fields[i].strip().lower()
! 		self.type = '/'.join(fields)
  		self.maintype = fields[0]
! 		self.subtype = '/'.join(fields[1:])
  
  	def parseplist(self):
  		str = self.plisttext
***************
*** 44,65 ****
  			str = str[1:]
  			if ';' in str:
  				# XXX Should parse quotes!
! 				end = string.index(str, ';')
  			else:
  				end = len(str)
  			f = str[:end]
  			if '=' in f:
! 				i = string.index(f, '=')
! 				f = string.lower(string.strip(f[:i])) + \
! 					'=' + string.strip(f[i+1:])
! 			self.plist.append(string.strip(f))
  			str = str[end:]
  
  	def getplist(self):
  		return self.plist
  
  	def getparam(self, name):
! 		name = string.lower(name) + '='
  		n = len(name)
  		for p in self.plist:
  			if p[:n] == name:
--- 43,64 ----
  			str = str[1:]
  			if ';' in str:
  				# XXX Should parse quotes!
! 				end = str.index(';')
  			else:
  				end = len(str)
  			f = str[:end]
  			if '=' in f:
! 				i = f.index('=')
! 				f = f[:i].strip().lower() + \
! 					'=' + f[i+1:].strip()
! 			self.plist.append(f.strip())
  			str = str[end:]
  
  	def getplist(self):
  		return self.plist
  
  	def getparam(self, name):
! 		name = name.lower() + '='
  		n = len(name)
  		for p in self.plist:
  			if p[:n] == name:
***************
*** 69,83 ****
  	def getparamnames(self):
  		result = []
  		for p in self.plist:
! 			i = string.find(p, '=')
  			if i >= 0:
! 				result.append(string.lower(p[:i]))
  		return result
  
  	def getencoding(self):
  		if self.encodingheader == None:
  			return '7bit'
! 		return string.lower(self.encodingheader)
  
  	def gettype(self):
  		return self.type
--- 68,82 ----
  	def getparamnames(self):
  		result = []
  		for p in self.plist:
! 			i = p.find('=')
  			if i >= 0:
! 				result.append(p[:i].lower())
  		return result
  
  	def getencoding(self):
  		if self.encodingheader == None:
  			return '7bit'
! 		return self.encodingheader.lower()
  
  	def gettype(self):
  		return self.type
Index: Lib/mimetypes.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mimetypes.py,v
retrieving revision 1.11
diff -c -r1.11 mimetypes.py
*** mimetypes.py	2000/02/10 17:17:13	1.11
--- mimetypes.py	2000/04/11 11:56:45
***************
*** 23,29 ****
  
  """
  
- import string
  import posixpath
  import urllib
  
--- 23,28 ----
***************
*** 62,72 ****
          # data      := *urlchar
          # parameter := attribute "=" value
          # type/subtype defaults to "text/plain"
!         comma = string.find(url, ',')
          if comma < 0:
              # bad data URL
              return None, None
!         semi = string.find(url, ';', 0, comma)
          if semi >= 0:
              type = url[:semi]
          else:
--- 61,71 ----
          # data      := *urlchar
          # parameter := attribute "=" value
          # type/subtype defaults to "text/plain"
!         comma = url.find(',')
          if comma < 0:
              # bad data URL
              return None, None
!         semi = url.find(';', 0, comma)
          if semi >= 0:
              type = url[:semi]
          else:
***************
*** 84,91 ****
          encoding = None
      if types_map.has_key(ext):
          return types_map[ext], encoding
!     elif types_map.has_key(string.lower(ext)):
!         return types_map[string.lower(ext)], encoding
      else:
          return None, encoding
  
--- 83,90 ----
          encoding = None
      if types_map.has_key(ext):
          return types_map[ext], encoding
!     elif types_map.has_key(ext.lower()):
!         return types_map[ext.lower()], encoding
      else:
          return None, encoding
  
***************
*** 101,107 ****
      global inited
      if not inited:
          init()
!     type = string.lower(type)
      for ext, stype in types_map.items():
          if type == stype:
              return ext
--- 100,106 ----
      global inited
      if not inited:
          init()
!     type = type.lower()
      for ext, stype in types_map.items():
          if type == stype:
              return ext
***************
*** 125,131 ****
      while 1:
          line = f.readline()
          if not line: break
!         words = string.split(line)
          for i in range(len(words)):
              if words[i][0] == '#':
                  del words[i:]
--- 124,130 ----
      while 1:
          line = f.readline()
          if not line: break
!         words = line.split()
          for i in range(len(words)):
              if words[i][0] == '#':
                  del words[i:]
Index: Lib/mimify.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/mimify.py,v
retrieving revision 1.15
diff -c -r1.15 mimify.py
*** mimify.py	2000/02/04 15:39:29	1.15
--- mimify.py	2000/04/11 11:56:45
***************
*** 27,33 ****
  QUOTE = '> '		# string replies are quoted with
  # End configure
  
! import re, string
  
  qp = re.compile('^content-transfer-encoding:\\s*quoted-printable', re.I)
  base64_re = re.compile('^content-transfer-encoding:\\s*base64', re.I)
--- 27,33 ----
  QUOTE = '> '		# string replies are quoted with
  # End configure
  
! import re
  
  qp = re.compile('^content-transfer-encoding:\\s*quoted-printable', re.I)
  base64_re = re.compile('^content-transfer-encoding:\\s*base64', re.I)
***************
*** 94,100 ****
  		if res is None:
  			break
  		newline = newline + line[pos:res.start(0)] + \
! 			  chr(string.atoi(res.group(1), 16))
  		pos = res.end(0)
  	return newline + line[pos:]
  
--- 94,100 ----
  		if res is None:
  			break
  		newline = newline + line[pos:res.start(0)] + \
! 			  chr(int(res.group(1), 16))
  		pos = res.end(0)
  	return newline + line[pos:]
  
***************
*** 108,114 ****
  			break
  		match = res.group(1)
  		# convert underscores to spaces (before =XX conversion!)
! 		match = string.join(string.split(match, '_'), ' ')
  		newline = newline + line[pos:res.start(0)] + mime_decode(match)
  		pos = res.end(0)
  	return newline + line[pos:]
--- 108,114 ----
  			break
  		match = res.group(1)
  		# convert underscores to spaces (before =XX conversion!)
! 		match = match.replace('_', ' ')
  		newline = newline + line[pos:res.start(0)] + mime_decode(match)
  		pos = res.end(0)
  	return newline + line[pos:]
***************
*** 230,243 ****
  	pos = 0
  	if len(line) >= 5 and line[:5] == 'From ':
  		# quote 'From ' at the start of a line for stupid mailers
! 		newline = string.upper('=%02x' % ord('F'))
  		pos = 1
  	while 1:
  		res = reg.search(line, pos)
  		if res is None:
  			break
  		newline = newline + line[pos:res.start(0)] + \
! 			  string.upper('=%02x' % ord(res.group(0)))
  		pos = res.end(0)
  	line = newline + line[pos:]
  
--- 230,243 ----
  	pos = 0
  	if len(line) >= 5 and line[:5] == 'From ':
  		# quote 'From ' at the start of a line for stupid mailers
! 		newline = str('=%02x' % ord('F')).upper()
  		pos = 1
  	while 1:
  		res = reg.search(line, pos)
  		if res is None:
  			break
  		newline = newline + line[pos:res.start(0)] + \
! 			  str('=%02x' % ord(res.group(0))).upper()
  		pos = res.end(0)
  	line = newline + line[pos:]
  
***************
*** 344,350 ****
  		if chrset_res:
  			if has_iso_chars:
  				# change us-ascii into iso-8859-1
! 				if string.lower(chrset_res.group(2)) == 'us-ascii':
  					line = '%s%s%s' % (chrset_res.group(1),
  							   CHARSET,
  							   chrset_res.group(3))
--- 344,350 ----
  		if chrset_res:
  			if has_iso_chars:
  				# change us-ascii into iso-8859-1
! 				if chrset_res.group(2).lower() == 'us-ascii':
  					line = '%s%s%s' % (chrset_res.group(1),
  							   CHARSET,
  							   chrset_res.group(3))
***************
*** 445,451 ****
  			encode = unmimify
  		elif o == '-l':
  			try:
! 				MAXLEN = string.atoi(a)
  			except:
  				print usage
  				sys.exit(1)
--- 445,451 ----
  			encode = unmimify
  		elif o == '-l':
  			try:
! 				MAXLEN = int(a)
  			except:
  				print usage
  				sys.exit(1)
Index: Lib/multifile.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/multifile.py,v
retrieving revision 1.9
diff -c -r1.9 multifile.py
*** multifile.py	2000/02/04 15:10:33	1.9
--- multifile.py	2000/04/11 11:56:46
***************
*** 118,124 ****
  		return list
  
  	def read(self): # Note: no size argument -- read until EOF only!
! 		return string.joinfields(self.readlines(), '')
  
  	def next(self):
  		while self.readline(): pass
--- 118,124 ----
  		return list
  
  	def read(self): # Note: no size argument -- read until EOF only!
! 		return ''.join(self.readlines())
  
  	def next(self):
  		while self.readline(): pass
Index: Lib/nntplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/nntplib.py,v
retrieving revision 1.19
diff -c -r1.19 nntplib.py
*** nntplib.py	2000/03/28 21:45:46	1.19
--- nntplib.py	2000/04/11 11:56:46
***************
*** 31,37 ****
  # Imports
  import re
  import socket
- import string
  
  
  
--- 31,36 ----
***************
*** 244,250 ****
  		resp, list = self.longcmd('LIST')
  		for i in range(len(list)):
  			# Parse lines into "group last first flag"
! 			list[i] = tuple(string.split(list[i]))
  		return resp, list
  
  	def group(self, name):
--- 243,249 ----
  		resp, list = self.longcmd('LIST')
  		for i in range(len(list)):
  			# Parse lines into "group last first flag"
! 			list[i] = tuple(list[i].split())
  		return resp, list
  
  	def group(self, name):
***************
*** 260,266 ****
  		resp = self.shortcmd('GROUP ' + name)
  		if resp[:3] <> '211':
  			raise NNTPReplyError(resp)
! 		words = string.split(resp)
  		count = first = last = 0
  		n = len(words)
  		if n > 1:
--- 259,265 ----
  		resp = self.shortcmd('GROUP ' + name)
  		if resp[:3] <> '211':
  			raise NNTPReplyError(resp)
! 		words = resp.split()
  		count = first = last = 0
  		n = len(words)
  		if n > 1:
***************
*** 270,276 ****
  				if n > 3:
  					last = words[3]
  					if n > 4:
! 						name = string.lower(words[4])
  		return resp, count, first, last, name
  
  	def help(self):
--- 269,275 ----
  				if n > 3:
  					last = words[3]
  					if n > 4:
! 						name = words[4].lower()
  		return resp, count, first, last, name
  
  	def help(self):
***************
*** 284,290 ****
  		"""Internal: parse the response of a STAT, NEXT or LAST command."""
  		if resp[:2] <> '22':
  			raise NNTPReplyError(resp)
! 		words = string.split(resp)
  		nr = 0
  		id = ''
  		n = len(words)
--- 283,289 ----
  		"""Internal: parse the response of a STAT, NEXT or LAST command."""
  		if resp[:2] <> '22':
  			raise NNTPReplyError(resp)
! 		words = resp.split()
  		nr = 0
  		id = ''
  		n = len(words)
***************
*** 391,404 ****
  		resp, lines = self.longcmd('XOVER ' + start + '-' + end)
  		xover_lines = []
  		for line in lines:
! 			elem = string.splitfields(line,"\t")
  			try:
  				xover_lines.append((elem[0],
  						    elem[1],
  						    elem[2],
  						    elem[3],
  						    elem[4],
! 						    string.split(elem[5]),
  						    elem[6],
  						    elem[7]))
  			except IndexError:
--- 390,403 ----
  		resp, lines = self.longcmd('XOVER ' + start + '-' + end)
  		xover_lines = []
  		for line in lines:
! 			elem = line.split("\t")
  			try:
  				xover_lines.append((elem[0],
  						    elem[1],
  						    elem[2],
  						    elem[3],
  						    elem[4],
! 						    elem[5].split(),
  						    elem[6],
  						    elem[7]))
  			except IndexError:
***************
*** 416,422 ****
  		resp, raw_lines = self.longcmd('XGTITLE ' + group)
  		lines = []
  		for raw_line in raw_lines:
! 			match = line_pat.search(string.strip(raw_line))
  			if match:
  				lines.append(match.group(1, 2))
  		return resp, lines
--- 415,421 ----
  		resp, raw_lines = self.longcmd('XGTITLE ' + group)
  		lines = []
  		for raw_line in raw_lines:
! 			match = line_pat.search(raw_line.strip())
  			if match:
  				lines.append(match.group(1, 2))
  		return resp, lines
***************
*** 432,438 ****
  		if resp[:3] <> '223':
  			raise NNTPReplyError(resp)
  		try:
! 			[resp_num, path] = string.split(resp)
  		except ValueError:
  			raise NNTPReplyError(resp)
  		else:
--- 431,437 ----
  		if resp[:3] <> '223':
  			raise NNTPReplyError(resp)
  		try:
! 			[resp_num, path] = resp.split()
  		except ValueError:
  			raise NNTPReplyError(resp)
  		else:
***************
*** 449,455 ****
  		resp = self.shortcmd("DATE")
  		if resp[:3] <> '111':
  			raise NNTPReplyError(resp)
! 		elem = string.split(resp)
  		if len(elem) != 2:
  			raise NNTPDataError(resp)
  		date = elem[1][2:8]
--- 448,454 ----
  		resp = self.shortcmd("DATE")
  		if resp[:3] <> '111':
  			raise NNTPReplyError(resp)
! 		elem = resp.split()
  		if len(elem) != 2:
  			raise NNTPDataError(resp)
  		date = elem[1][2:8]
Index: Lib/ntpath.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/ntpath.py,v
retrieving revision 1.23
diff -c -r1.23 ntpath.py
*** ntpath.py	2000/02/17 17:30:40	1.23
--- ntpath.py	2000/04/11 11:56:46
***************
*** 18,24 ****
      """Normalize case of pathname.
  
      Makes all characters lowercase and all slashes into backslashes."""
!     return string.lower(string.replace(s, "/", "\\"))
  
  
  # Return whether a path is absolute.
--- 18,24 ----
      """Normalize case of pathname.
  
      Makes all characters lowercase and all slashes into backslashes."""
!     return s.replace("/", "\\").lower()
  
  
  # Return whether a path is absolute.
***************
*** 77,87 ****
          # \\machine\mountpoint\directories...
          #           directory ^^^^^^^^^^^^^^^
          normp = normcase(p)
!         index = string.find(normp, '\\', 2)
          if index == -1:
              ##raise RuntimeError, 'illegal UNC path: "' + p + '"'
              return ("", p)
!         index = string.find(normp, '\\', index + 1)
          if index == -1:
              index = len(p)
          return p[:index], p[index:]
--- 77,87 ----
          # \\machine\mountpoint\directories...
          #           directory ^^^^^^^^^^^^^^^
          normp = normcase(p)
!         index = normp.find('\\', 2)
          if index == -1:
              ##raise RuntimeError, 'illegal UNC path: "' + p + '"'
              return ("", p)
!         index = normp.find('\\', index + 1)
          if index == -1:
              index = len(p)
          return p[:index], p[index:]
***************
*** 331,339 ****
              path = path[index + 1:]
              pathlen = len(path)
              try:
!                 index = string.index(path, '\'')
                  res = res + '\'' + path[:index + 1]
!             except string.index_error:
                  res = res + path
                  index = pathlen -1
          elif c == '$':  # variable or '$$'
--- 331,339 ----
              path = path[index + 1:]
              pathlen = len(path)
              try:
!                 index = path.index('\'')
                  res = res + '\'' + path[:index + 1]
!             except ValueError:
                  res = res + path
                  index = pathlen -1
          elif c == '$':  # variable or '$$'
***************
*** 344,354 ****
                  path = path[index+2:]
                  pathlen = len(path)
                  try:
!                     index = string.index(path, '}')
                      var = path[:index]
                      if os.environ.has_key(var):
                          res = res + os.environ[var]
!                 except string.index_error:
                      res = res + path
                      index = pathlen - 1
              else:
--- 344,354 ----
                  path = path[index+2:]
                  pathlen = len(path)
                  try:
!                     index = path.index('}')
                      var = path[:index]
                      if os.environ.has_key(var):
                          res = res + os.environ[var]
!                 except ValueError:
                      res = res + path
                      index = pathlen - 1
              else:
***************
*** 375,386 ****
  
  def normpath(path):
      """Normalize path, eliminating double slashes, etc."""
!     path = string.replace(path, "/", "\\")
      prefix, path = splitdrive(path)
      while path[:1] == os.sep:
          prefix = prefix + os.sep
          path = path[1:]
!     comps = string.splitfields(path, os.sep)
      i = 0
      while i < len(comps):
          if comps[i] == '.':
--- 375,386 ----
  
  def normpath(path):
      """Normalize path, eliminating double slashes, etc."""
!     path = path.replace("/", "\\")
      prefix, path = splitdrive(path)
      while path[:1] == os.sep:
          prefix = prefix + os.sep
          path = path[1:]
!     comps = path.split(os.sep)
      i = 0
      while i < len(comps):
          if comps[i] == '.':
***************
*** 395,401 ****
      # If the path is now empty, substitute '.'
      if not prefix and not comps:
          comps.append('.')
!     return prefix + string.joinfields(comps, os.sep)
  
  
  # Return an absolute path.
--- 395,401 ----
      # If the path is now empty, substitute '.'
      if not prefix and not comps:
          comps.append('.')
!     return prefix + os.sep.join(comps)
  
  
  # Return an absolute path.
Index: Lib/nturl2path.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/nturl2path.py,v
retrieving revision 1.5
diff -c -r1.5 nturl2path.py
*** nturl2path.py	2000/02/04 15:10:33	1.5
--- nturl2path.py	2000/04/11 11:56:46
***************
*** 16,30 ****
  	        # convert this to \\host\path\on\remote\host
  	        # (notice halving of slashes at the start of the path)
  	        url = url[2:]
! 	    components = string.split(url, '/')
  	    # make sure not to convert quoted slashes :-)
! 	    return urllib.unquote(string.join(components, '\\'))
! 	comp = string.split(url, '|')
  	if len(comp) != 2 or comp[0][-1] not in string.letters:
  		error = 'Bad URL: ' + url
  		raise IOError, error
! 	drive = string.upper(comp[0][-1])
! 	components = string.split(comp[1], '/')
  	path = drive + ':'
  	for  comp in components:
  		if comp:
--- 16,30 ----
  	        # convert this to \\host\path\on\remote\host
  	        # (notice halving of slashes at the start of the path)
  	        url = url[2:]
! 	    components = url.split('/')
  	    # make sure not to convert quoted slashes :-)
! 	    return urllib.unquote('\\'.join(components))
! 	comp = url.split('|')
  	if len(comp) != 2 or comp[0][-1] not in string.letters:
  		error = 'Bad URL: ' + url
  		raise IOError, error
! 	drive = comp[0][-1].upper()
! 	components = comp[1].split('/')
  	path = drive + ':'
  	for  comp in components:
  		if comp:
***************
*** 40,46 ****
  		///C|/foo/bar/spam.foo
  	"""
  
! 	import string, urllib
  	if not ':' in p:
  	    # No drive specifier, just convert slashes and quote the name
  	    if p[:2] == '\\\\':
--- 40,46 ----
  		///C|/foo/bar/spam.foo
  	"""
  
! 	import urllib
  	if not ':' in p:
  	    # No drive specifier, just convert slashes and quote the name
  	    if p[:2] == '\\\\':
***************
*** 48,62 ****
  	        # convert this to ////host/path/on/remote/host
  	        # (notice doubling of slashes at the start of the path)
  	        p = '\\\\' + p
! 	    components = string.split(p, '\\')
! 	    return urllib.quote(string.join(components, '/'))
! 	comp = string.split(p, ':')
  	if len(comp) != 2 or len(comp[0]) > 1:
  		error = 'Bad path: ' + p
  		raise IOError, error
  
! 	drive = urllib.quote(string.upper(comp[0]))
! 	components = string.split(comp[1], '\\')
  	path = '///' + drive + '|'
  	for comp in components:
  		if comp:
--- 48,62 ----
  	        # convert this to ////host/path/on/remote/host
  	        # (notice doubling of slashes at the start of the path)
  	        p = '\\\\' + p
! 	    components = p.split('\\')
! 	    return urllib.quote('/'.join(components))
! 	comp = p.split(':')
  	if len(comp) != 2 or len(comp[0]) > 1:
  		error = 'Bad path: ' + p
  		raise IOError, error
  
! 	drive = urllib.quote(comp[0].upper())
! 	components = comp[1].split('\\')
  	path = '///' + drive + '|'
  	for comp in components:
  		if comp:
Index: Lib/pdb.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/pdb.py,v
retrieving revision 1.43
diff -c -r1.43 pdb.py
*** pdb.py	2000/03/06 20:39:59	1.43
--- pdb.py	2000/04/11 11:56:47
***************
*** 4,10 ****
  
  # (See pdb.doc for documentation.)
  
- import string
  import sys
  import linecache
  import cmd
--- 4,9 ----
***************
*** 151,176 ****
  		"""Handle alias expansion and ';;' separator."""
  		if not line:
  			return line
! 		args = string.split(line)
  		while self.aliases.has_key(args[0]):
  			line = self.aliases[args[0]]
  			ii = 1
  			for tmpArg in args[1:]:
! 				line = string.replace(line, "%" + str(ii),
! 						      tmpArg)
  				ii = ii + 1
! 			line = string.replace(line, "%*",
! 					      string.join(args[1:], ' '))
! 			args = string.split(line)
  		# split into ';;' separated commands
  		# unless it's an alias command
  		if args[0] != 'alias':
! 			marker = string.find(line, ';;')
  			if marker >= 0:
  				# queue up everything after marker
! 				next = string.lstrip(line[marker+2:])
  				self.cmdqueue.append(next)
! 				line = string.rstrip(line[:marker])
  		return line
  
  	# Command definitions, called by cmdloop()
--- 150,173 ----
  		"""Handle alias expansion and ';;' separator."""
  		if not line:
  			return line
! 		args = line.split()
  		while self.aliases.has_key(args[0]):
  			line = self.aliases[args[0]]
  			ii = 1
  			for tmpArg in args[1:]:
! 				line = line.replace("%" + str(ii), tmpArg)
  				ii = ii + 1
! 			line = line.replace("%*", ' '.join(args[1:]))
! 			args = line.split()
  		# split into ';;' separated commands
  		# unless it's an alias command
  		if args[0] != 'alias':
! 			marker = line.find(';;')
  			if marker >= 0:
  				# queue up everything after marker
! 				next = line[marker+2:].lstrip()
  				self.cmdqueue.append(next)
! 				line = line[:marker].rstrip()
  		return line
  
  	# Command definitions, called by cmdloop()
***************
*** 196,210 ****
  		filename = None
  		lineno = None
  		cond = None
! 		comma = string.find(arg, ',')
  		if comma > 0:
  			# parse stuff after comma: "condition"
! 			cond = string.lstrip(arg[comma+1:])
! 			arg = string.rstrip(arg[:comma])
  		# parse stuff before comma: [filename:]lineno | function
! 		colon = string.rfind(arg, ':')
  		if colon >= 0:
! 			filename = string.rstrip(arg[:colon])
  			f = self.lookupmodule(filename)
  			if not f:
  				print '*** ', `filename`,
--- 193,207 ----
  		filename = None
  		lineno = None
  		cond = None
! 		comma = arg.find(',')
  		if comma > 0:
  			# parse stuff after comma: "condition"
! 			cond = arg[comma+1:].lstrip()
! 			arg = arg[:comma].rstrip()
  		# parse stuff before comma: [filename:]lineno | function
! 		colon = arg.rfind(':')
  		if colon >= 0:
! 			filename = arg[:colon].rstrip()
  			f = self.lookupmodule(filename)
  			if not f:
  				print '*** ', `filename`,
***************
*** 212,218 ****
  				return
  			else:
  				filename = f
! 			arg = string.lstrip(arg[colon+1:])
  			try:
  				lineno = int(arg)
  			except ValueError, msg:
--- 209,215 ----
  				return
  			else:
  				filename = f
! 			arg = arg[colon+1:].lstrip()
  			try:
  				lineno = int(arg)
  			except ValueError, msg:
***************
*** 276,292 ****
  	def lineinfo(self, identifier):
  		failed = (None, None, None)
  		# Input is identifier, may be in single quotes
! 		idstring = string.split(identifier, "'")
  		if len(idstring) == 1:
  			# not in single quotes
! 			id = string.strip(idstring[0])
  		elif len(idstring) == 3:
  			# quoted
! 			id = string.strip(idstring[1])
  		else:
  			return failed
  		if id == '': return failed
! 		parts = string.split(id, '.')
  		# Protection for derived debuggers
  		if parts[0] == 'self':
  			del parts[0]
--- 273,289 ----
  	def lineinfo(self, identifier):
  		failed = (None, None, None)
  		# Input is identifier, may be in single quotes
! 		idstring = identifier.split("'")
  		if len(idstring) == 1:
  			# not in single quotes
! 			id = idstring[0].strip()
  		elif len(idstring) == 3:
  			# quoted
! 			id = idstring[1].strip()
  		else:
  			return failed
  		if id == '': return failed
! 		parts = id.split('.')
  		# Protection for derived debuggers
  		if parts[0] == 'self':
  			del parts[0]
***************
*** 318,324 ****
  		if not line:
  			print 'End of file'
  			return 0
! 		line = string.strip(line)
  		# Don't allow setting breakpoint at a blank line
  		if ( not line or (line[0] == '#') or
  		     (line[:3] == '"""') or line[:3] == "'''" ):
--- 315,321 ----
  		if not line:
  			print 'End of file'
  			return 0
! 		line = line.strip()
  		# Don't allow setting breakpoint at a blank line
  		if ( not line or (line[0] == '#') or
  		     (line[:3] == '"""') or line[:3] == "'''" ):
***************
*** 354,374 ****
  				if not line:
  					print 'end of file'
  					return 0
! 				line = string.strip(line)
  				if not line: continue	# Blank line
  				if brackets <= 0 and line[0] not in ('#','"',"'"):
  					break
  		return lineno
  
  	def do_enable(self, arg):
! 		args = string.split(arg)
  		for i in args:
  			bp = bdb.Breakpoint.bpbynumber[int(i)]
  			if bp:
  				bp.enable()
  
  	def do_disable(self, arg):
! 		args = string.split(arg)
  		for i in args:
  			bp = bdb.Breakpoint.bpbynumber[int(i)]
  			if bp:
--- 351,371 ----
  				if not line:
  					print 'end of file'
  					return 0
! 				line = line.strip()
  				if not line: continue	# Blank line
  				if brackets <= 0 and line[0] not in ('#','"',"'"):
  					break
  		return lineno
  
  	def do_enable(self, arg):
! 		args = arg.split()
  		for i in args:
  			bp = bdb.Breakpoint.bpbynumber[int(i)]
  			if bp:
  				bp.enable()
  
  	def do_disable(self, arg):
! 		args = arg.split()
  		for i in args:
  			bp = bdb.Breakpoint.bpbynumber[int(i)]
  			if bp:
***************
*** 376,383 ****
  
  	def do_condition(self, arg):
  		# arg is breakpoint number and condition
! 		args = string.split(arg, ' ', 1)
! 		bpnum = int(string.strip(args[0]))
  		try:
  			cond = args[1]
  		except:
--- 373,380 ----
  
  	def do_condition(self, arg):
  		# arg is breakpoint number and condition
! 		args = arg.split(' ', 1)
! 		bpnum = int(args[0].strip())
  		try:
  			cond = args[1]
  		except:
***************
*** 391,400 ****
  
  	def do_ignore(self,arg):
  		"""arg is bp number followed by ignore count."""
! 		args = string.split(arg)
! 		bpnum = int(string.strip(args[0]))
  		try:
! 			count = int(string.strip(args[1]))
  		except:
  			count = 0
  		bp = bdb.Breakpoint.bpbynumber[bpnum]
--- 388,397 ----
  
  	def do_ignore(self,arg):
  		"""arg is bp number followed by ignore count."""
! 		args = arg.split()
! 		bpnum = int(args[0].strip())
  		try:
! 			count = int(args[1].strip())
  		except:
  			count = 0
  		bp = bdb.Breakpoint.bpbynumber[bpnum]
***************
*** 421,433 ****
  				reply = raw_input('Clear all breaks? ')
  			except EOFError:
  				reply = 'no'
! 			reply = string.lower(string.strip(reply))
  			if reply in ('y', 'yes'):
  				self.clear_all_breaks()
  			return
  		if ':' in arg:
  			# Make sure it works for "clear C:\foo\bar.py:12"
! 			i = string.rfind(arg, ':')
  			filename = arg[:i]
  			arg = arg[i+1:]
  			try:
--- 418,430 ----
  				reply = raw_input('Clear all breaks? ')
  			except EOFError:
  				reply = 'no'
! 			reply = reply.strip().lower()
  			if reply in ('y', 'yes'):
  				self.clear_all_breaks()
  			return
  		if ':' in arg:
  			# Make sure it works for "clear C:\foo\bar.py:12"
! 			i = arg.rfind(':')
  			filename = arg[:i]
  			arg = arg[i+1:]
  			try:
***************
*** 438,444 ****
  				err = self.clear_break(filename, lineno)
  			if err: print '***', err
  			return
! 		numberlist = string.split(arg)
  		for i in numberlist:
  			err = self.clear_bpbynumber(i)
  			if err:
--- 435,441 ----
  				err = self.clear_break(filename, lineno)
  			if err: print '***', err
  			return
! 		numberlist = arg.split()
  		for i in numberlist:
  			err = self.clear_bpbynumber(i)
  			if err:
***************
*** 564,570 ****
  					print '[EOF]'
  					break
  				else:
! 					s = string.rjust(`lineno`, 3)
  					if len(s) < 4: s = s + ' '
  					if lineno in breaklist: s = s + 'B'
  					else: s = s + ' '
--- 561,567 ----
  					print '[EOF]'
  					break
  				else:
! 					s = `lineno`.rjust(3)
  					if len(s) < 4: s = s + ' '
  					if lineno in breaklist: s = s + 'B'
  					else: s = s + ' '
***************
*** 604,610 ****
  		print type(value)
  
  	def do_alias(self, arg):
! 		args = string.split (arg)
  		if len(args) == 0:
  			keys = self.aliases.keys()
  			keys.sort()
--- 601,607 ----
  		print type(value)
  
  	def do_alias(self, arg):
! 		args = arg.split ()
  		if len(args) == 0:
  			keys = self.aliases.keys()
  			keys.sort()
***************
*** 614,623 ****
  		if self.aliases.has_key(args[0]) and len (args) == 1:
  			print "%s = %s" % (args[0], self.aliases[args[0]])
  		else:
! 			self.aliases[args[0]] = string.join(args[1:], ' ')
  
  	def do_unalias(self, arg):
! 		args = string.split (arg)
  		if len(args) == 0: return
  		if self.aliases.has_key(args[0]):
  			del self.aliases[args[0]]
--- 611,620 ----
  		if self.aliases.has_key(args[0]) and len (args) == 1:
  			print "%s = %s" % (args[0], self.aliases[args[0]])
  		else:
! 			self.aliases[args[0]] = ' '.join(args[1:])
  
  	def do_unalias(self, arg):
! 		args = arg.split ()
  		if len(args) == 0: return
  		if self.aliases.has_key(args[0]):
  			del self.aliases[args[0]]
Index: Lib/pickle.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/pickle.py,v
retrieving revision 1.37
diff -c -r1.37 pickle.py
*** pickle.py	2000/03/10 23:20:09	1.37
--- pickle.py	2000/04/11 11:56:48
***************
*** 27,33 ****
  
  from types import *
  from copy_reg import dispatch_table, safe_constructors
- import string
  import marshal
  import sys
  import struct
--- 27,32 ----
***************
*** 548,554 ****
      dispatch[NONE] = load_none
  
      def load_int(self):
!         self.append(string.atoi(self.readline()[:-1]))
      dispatch[INT] = load_int
  
      def load_binint(self):
--- 547,553 ----
      dispatch[NONE] = load_none
  
      def load_int(self):
!         self.append(int(self.readline()[:-1]))
      dispatch[INT] = load_int
  
      def load_binint(self):
***************
*** 564,574 ****
      dispatch[BININT2] = load_binint2
   
      def load_long(self):
!         self.append(string.atol(self.readline()[:-1], 0))
      dispatch[LONG] = load_long
  
      def load_float(self):
!         self.append(string.atof(self.readline()[:-1]))
      dispatch[FLOAT] = load_float
  
      def load_binfloat(self, unpack=struct.unpack):
--- 563,573 ----
      dispatch[BININT2] = load_binint2
   
      def load_long(self):
!         self.append(long(self.readline()[:-1], 0))
      dispatch[LONG] = load_long
  
      def load_float(self):
!         self.append(float(self.readline()[:-1]))
      dispatch[FLOAT] = load_float
  
      def load_binfloat(self, unpack=struct.unpack):
Index: Lib/popen2.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/popen2.py,v
retrieving revision 1.9
diff -c -r1.9 popen2.py
*** popen2.py	2000/02/04 15:10:34	1.9
--- popen2.py	2000/04/11 11:56:48
***************
*** 8,14 ****
  
  import os
  import sys
- import string
  
  MAXFD = 256     # Max number of file descriptors (os.getdtablesize()???)
  
--- 8,13 ----
Index: Lib/poplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/poplib.py,v
retrieving revision 1.8
diff -c -r1.8 poplib.py
*** poplib.py	2000/03/28 21:45:46	1.8
--- poplib.py	2000/04/11 11:56:48
***************
*** 15,21 ****
  
  # Imports
  
! import regex, socket, string
  
  # Exception raised when an error or invalid response is received:
  
--- 15,21 ----
  
  # Imports
  
! import regex, socket
  
  # Exception raised when an error or invalid response is received:
  
***************
*** 189,198 ****
  		Result is tuple of 2 ints (message count, mailbox size)
  		"""
  		retval = self._shortcmd('STAT')
! 		rets = string.split(retval)
  		#if self._debugging: print '*stat*', `rets`
! 		numMessages = string.atoi(rets[1])
! 		sizeMessages = string.atoi(rets[2])
  		return (numMessages, sizeMessages)
  
  
--- 189,198 ----
  		Result is tuple of 2 ints (message count, mailbox size)
  		"""
  		retval = self._shortcmd('STAT')
! 		rets = retval.split()
  		#if self._debugging: print '*stat*', `rets`
! 		numMessages = int(rets[1])
! 		sizeMessages = int(rets[2])
  		return (numMessages, sizeMessages)
  
  
***************
*** 277,283 ****
  			raise error_proto('-ERR APOP not supported by server')
  		import md5
  		digest = md5.new(self.timestamp.group(1)+secret).digest()
! 		digest = string.join(map(lambda x:'%02x'%ord(x), digest), '')
  		return self._shortcmd('APOP %s %s' % (user, digest))
  
  
--- 277,283 ----
  			raise error_proto('-ERR APOP not supported by server')
  		import md5
  		digest = md5.new(self.timestamp.group(1)+secret).digest()
! 		digest = ''.join(map(lambda x:'%02x'%ord(x), digest))
  		return self._shortcmd('APOP %s %s' % (user, digest))
  
  
Index: Lib/posixpath.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/posixpath.py,v
retrieving revision 1.30
diff -c -r1.30 posixpath.py
*** posixpath.py	2000/02/29 13:31:16	1.30
--- posixpath.py	2000/04/11 11:56:48
***************
*** 57,64 ****
  def split(p):
      """Split a pathname.  Returns tuple "(head, tail)" where "tail" is 
  everything after the final slash.  Either part may be empty"""
!     import string
!     i = string.rfind(p, '/') + 1
      head, tail = p[:i], p[i:]
      if head and head <> '/'*len(head):
          while head[-1] == '/':
--- 57,63 ----
  def split(p):
      """Split a pathname.  Returns tuple "(head, tail)" where "tail" is 
  everything after the final slash.  Either part may be empty"""
!     i = p.rfind('/') + 1
      head, tail = p[:i], p[i:]
      if head and head <> '/'*len(head):
          while head[-1] == '/':
***************
*** 342,354 ****
  
  def normpath(path):
      """Normalize path, eliminating double slashes, etc."""
-     import string
      # Treat initial slashes specially
      slashes = ''
      while path[:1] == '/':
          slashes = slashes + '/'
          path = path[1:]
!     comps = string.splitfields(path, '/')
      i = 0
      while i < len(comps):
          if comps[i] == '.':
--- 341,352 ----
  
  def normpath(path):
      """Normalize path, eliminating double slashes, etc."""
      # Treat initial slashes specially
      slashes = ''
      while path[:1] == '/':
          slashes = slashes + '/'
          path = path[1:]
!     comps = path.split('/')
      i = 0
      while i < len(comps):
          if comps[i] == '.':
***************
*** 365,371 ****
      # If the path is now empty, substitute '.'
      if not comps and not slashes:
          comps.append('.')
!     return slashes + string.joinfields(comps, '/')
  
  
  def abspath(path):
--- 363,369 ----
      # If the path is now empty, substitute '.'
      if not comps and not slashes:
          comps.append('.')
!     return slashes + '/'.join(comps)
  
  
  def abspath(path):
Index: Lib/pstats.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/pstats.py,v
retrieving revision 1.7
diff -c -r1.7 pstats.py
*** pstats.py	2000/02/04 15:10:34	1.7
--- pstats.py	2000/04/11 11:56:49
***************
*** 34,40 ****
  
  import os
  import time
- import string
  import marshal
  import re
  
--- 34,39 ----
***************
*** 392,402 ****
  		return self
  
  	def print_call_heading(self, name_size, column_title):
! 		print string.ljust("Function ", name_size) + column_title
  
  
  	def print_call_line(self, name_size, source, call_dict):
! 		print string.ljust(func_std_string(source), name_size),
  		if not call_dict:
  			print "--"
  			return
--- 391,401 ----
  		return self
  
  	def print_call_heading(self, name_size, column_title):
! 		print "Function ".ljust(name_size) + column_title
  
  
  	def print_call_line(self, name_size, source, call_dict):
! 		print func_std_string(source).ljust(name_size),
  		if not call_dict:
  			print "--"
  			return
***************
*** 414,424 ****
  
  
  	def print_title(self):
! 		print string.rjust('ncalls', 9),
! 		print string.rjust('tottime', 8),
! 		print string.rjust('percall', 8),
! 		print string.rjust('cumtime', 8),
! 		print string.rjust('percall', 8),
  		print 'filename:lineno(function)'
  
  
--- 413,423 ----
  
  
  	def print_title(self):
! 		print 'ncalls'.rjust(9),
! 		print 'tottime'.rjust(8),
! 		print 'percall'.rjust(8),
! 		print 'cumtime'.rjust(8),
! 		print 'percall'.rjust(8),
  		print 'filename:lineno(function)'
  
  
***************
*** 427,433 ****
  		c = `nc`
  		if nc != cc:
  			c = c + '/' + `cc`
! 		print string.rjust(c, 9),
  		print f8(tt),
  		if nc == 0:
  			print ' '*8,
--- 426,432 ----
  		c = `nc`
  		if nc != cc:
  			c = c + '/' + `cc`
! 		print c.rjust(9),
  		print f8(tt),
  		if nc == 0:
  			print ' '*8,
***************
*** 522,526 ****
  #**************************************************************************
  
  def f8(x):
! 	return string.rjust(fpformat.fix(x, 3), 8)
  
--- 521,525 ----
  #**************************************************************************
  
  def f8(x):
! 	return fpformat.fix(x, 3).rjust(8)
  
Index: Lib/py_compile.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/py_compile.py,v
retrieving revision 1.15
diff -c -r1.15 py_compile.py
*** py_compile.py	2000/02/04 15:10:34	1.15
--- py_compile.py	2000/04/11 11:56:49
***************
*** 54,63 ****
      try:
          codeobject = __builtin__.compile(codestring, dfile or file, 'exec')
      except SyntaxError, detail:
!         import traceback, sys, string
          lines = traceback.format_exception_only(SyntaxError, detail)
          for line in lines:
!             sys.stderr.write(string.replace(line, 'File "<string>"',
                                              'File "%s"' % (dfile or file)))
          return
      if not cfile:
--- 54,63 ----
      try:
          codeobject = __builtin__.compile(codestring, dfile or file, 'exec')
      except SyntaxError, detail:
!         import traceback, sys
          lines = traceback.format_exception_only(SyntaxError, detail)
          for line in lines:
!             sys.stderr.write(line.replace('File "<string>"',
                                              'File "%s"' % (dfile or file)))
          return
      if not cfile:
Index: Lib/pyclbr.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/pyclbr.py,v
retrieving revision 1.15
diff -c -r1.15 pyclbr.py
*** pyclbr.py	2000/02/04 15:39:30	1.15
--- pyclbr.py	2000/04/11 11:56:49
***************
*** 57,63 ****
  import sys
  import imp
  import re
- import string
  
  TABWIDTH = 8
  
--- 57,62 ----
***************
*** 160,170 ****
  
  	dict = {}
  
! 	i = string.rfind(module, '.')
  	if i >= 0:
  		# Dotted module name
! 		package = string.strip(module[:i])
! 		submodule = string.strip(module[i+1:])
  		parent = readmodule(package, path, inpackage)
  		child = readmodule(submodule, parent['__path__'], 1)
  		return child
--- 159,169 ----
  
  	dict = {}
  
! 	i = module.rfind('.')
  	if i >= 0:
  		# Dotted module name
! 		package = module[:i].strip()
! 		submodule = module[i+1:].strip()
  		parent = readmodule(package, path, inpackage)
  		child = readmodule(submodule, parent['__path__'], 1)
  		return child
***************
*** 210,218 ****
  	# when we need a line number we simply string.count the number of
  	# newlines in the string since the last time we did this; i.e.,
  	#    lineno = lineno + \
! 	#             string.count(src, '\n', last_lineno_pos, here)
  	#    last_lineno_pos = here
- 	countnl = string.count
  	lineno, last_lineno_pos = 1, 0
  	i = 0
  	while 1:
--- 209,216 ----
  	# when we need a line number we simply string.count the number of
  	# newlines in the string since the last time we did this; i.e.,
  	#    lineno = lineno + \
! 	#             src.count('\n', last_lineno_pos, here)
  	#    last_lineno_pos = here
  	lineno, last_lineno_pos = 1, 0
  	i = 0
  	while 1:
***************
*** 226,233 ****
  			thisindent = _indent(m.group("MethodIndent"))
  			meth_name = m.group("MethodName")
  			lineno = lineno + \
! 				 countnl(src, '\n',
! 					 last_lineno_pos, start)
  			last_lineno_pos = start
  			# close all classes indented at least as much
  			while classstack and \
--- 224,230 ----
  			thisindent = _indent(m.group("MethodIndent"))
  			meth_name = m.group("MethodName")
  			lineno = lineno + \
! 				 src.count('\n', last_lineno_pos, start)
  			last_lineno_pos = start
  			# close all classes indented at least as much
  			while classstack and \
***************
*** 254,274 ****
  			      classstack[-1][1] >= thisindent:
  				del classstack[-1]
  			lineno = lineno + \
! 				 countnl(src, '\n', last_lineno_pos, start)
  			last_lineno_pos = start
  			class_name = m.group("ClassName")
  			inherit = m.group("ClassSupers")
  			if inherit:
  				# the class inherits from other classes
! 				inherit = string.strip(inherit[1:-1])
  				names = []
! 				for n in string.splitfields(inherit, ','):
! 					n = string.strip(n)
  					if dict.has_key(n):
  						# we know this super class
  						n = dict[n]
  					else:
! 						c = string.splitfields(n, '.')
  						if len(c) > 1:
  							# super class
  							# is of the
--- 251,271 ----
  			      classstack[-1][1] >= thisindent:
  				del classstack[-1]
  			lineno = lineno + \
! 				 src.count('\n', last_lineno_pos, start)
  			last_lineno_pos = start
  			class_name = m.group("ClassName")
  			inherit = m.group("ClassSupers")
  			if inherit:
  				# the class inherits from other classes
! 				inherit = inherit[1:-1].strip()
  				names = []
! 				for n in inherit.split(','):
! 					n = n.strip()
  					if dict.has_key(n):
  						# we know this super class
  						n = dict[n]
  					else:
! 						c = n.split('.')
  						if len(c) > 1:
  							# super class
  							# is of the
***************
*** 291,298 ****
  
  		elif m.start("Import") >= 0:
  			# import module
! 			for n in string.split(m.group("ImportList"), ','):
! 				n = string.strip(n)
  				try:
  					# recursively read the imported module
  					d = readmodule(n, path, inpackage)
--- 288,295 ----
  
  		elif m.start("Import") >= 0:
  			# import module
! 			for n in m.group("ImportList").split(','):
! 				n = n.strip()
  				try:
  					# recursively read the imported module
  					d = readmodule(n, path, inpackage)
***************
*** 303,309 ****
  		elif m.start("ImportFrom") >= 0:
  			# from module import stuff
  			mod = m.group("ImportFromPath")
! 			names = string.split(m.group("ImportFromList"), ',')
  			try:
  				# recursively read the imported module
  				d = readmodule(mod, path, inpackage)
--- 300,306 ----
  		elif m.start("ImportFrom") >= 0:
  			# from module import stuff
  			mod = m.group("ImportFromPath")
! 			names = m.group("ImportFromList").split(',')
  			try:
  				# recursively read the imported module
  				d = readmodule(mod, path, inpackage)
***************
*** 314,320 ****
  			# imported module to our name space if they
  			# were mentioned in the list
  			for n in names:
! 				n = string.strip(n)
  				if d.has_key(n):
  					dict[n] = d[n]
  				elif n == '*':
--- 311,317 ----
  			# imported module to our name space if they
  			# were mentioned in the list
  			for n in names:
! 				n = n.strip()
  				if d.has_key(n):
  					dict[n] = d[n]
  				elif n == '*':
***************
*** 332,336 ****
  
  	return dict
  
! def _indent(ws, _expandtabs=string.expandtabs):
! 	return len(_expandtabs(ws, TABWIDTH))
--- 329,333 ----
  
  	return dict
  
! def _indent(ws):
! 	return len(ws.expandtabs(TABWIDTH))
Index: Lib/re.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/re.py,v
retrieving revision 1.35
diff -c -r1.35 re.py
*** re.py	1999/11/15 14:19:15	1.35
--- re.py	2000/04/11 11:56:49
***************
*** 229,235 ****
          if char not in alphanum:
              if char=='\000': result[i] = '\\000'
              else: result[i] = '\\'+char
!     return string.join(result, '')
  
  def compile(pattern, flags=0):
      """compile(pattern[, flags]) -> RegexObject
--- 229,235 ----
          if char not in alphanum:
              if char=='\000': result[i] = '\\000'
              else: result[i] = '\\'+char
!     return ''.join(result)
  
  def compile(pattern, flags=0):
      """compile(pattern[, flags]) -> RegexObject
***************
*** 398,404 ****
                  append(source[lastmatch:pos])
              n = n + 1
          append(source[pos:])
!         return (string.join(results, ''), n)
                                                                              
      def split(self, source, maxsplit=0):
          """split(source[, maxsplit=0]) -> list of strings
--- 398,404 ----
                  append(source[lastmatch:pos])
              n = n + 1
          append(source[pos:])
!         return (''.join(results), n)
                                                                              
      def split(self, source, maxsplit=0):
          """split(source[, maxsplit=0]) -> list of strings
Index: Lib/regsub.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/regsub.py,v
retrieving revision 1.7
diff -c -r1.7 regsub.py
*** regsub.py	2000/02/04 15:28:40	1.7
--- regsub.py	2000/04/11 11:56:49
***************
*** 100,110 ****
  # Capitalize words split using a pattern
  
  def capwords(str, pat='[^a-zA-Z0-9_]+'):
- 	import string
  	words = splitx(str, pat)
  	for i in range(0, len(words), 2):
! 		words[i] = string.capitalize(words[i])
! 	return string.joinfields(words, "")
  
  
  # Internal subroutines:
--- 100,109 ----
  # Capitalize words split using a pattern
  
  def capwords(str, pat='[^a-zA-Z0-9_]+'):
  	words = splitx(str, pat)
  	for i in range(0, len(words), 2):
! 		words[i] = words[i].capitalize()
! 	return "".join(words)
  
  
  # Internal subroutines:
Index: Lib/repr.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/repr.py,v
retrieving revision 1.6
diff -c -r1.6 repr.py
*** repr.py	2000/02/04 15:28:40	1.6
--- repr.py	2000/04/11 11:56:50
***************
*** 1,7 ****
  """Redo the `...` (representation) but with limits on most sizes."""
  
- import string
- 
  class Repr:
  	def __init__(self):
  		self.maxlevel = 6
--- 1,5 ----
***************
*** 16,23 ****
  	def repr1(self, x, level):
  		typename = `type(x)`[7:-2] # "<type '......'>"
  		if ' ' in typename:
! 			parts = string.split(typename)
! 			typename = string.joinfields(parts, '_')
  		if hasattr(self, 'repr_' + typename):
  			return getattr(self, 'repr_' + typename)(x, level)
  		else:
--- 14,21 ----
  	def repr1(self, x, level):
  		typename = `type(x)`[7:-2] # "<type '......'>"
  		if ' ' in typename:
! 			parts = typename.split()
! 			typename = '_'.join(parts)
  		if hasattr(self, 'repr_' + typename):
  			return getattr(self, 'repr_' + typename)(x, level)
  		else:
Index: Lib/rfc822.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/rfc822.py,v
retrieving revision 1.46
diff -c -r1.46 rfc822.py
*** rfc822.py	2000/02/10 17:17:14	1.46
--- rfc822.py	2000/04/11 11:56:50
***************
*** 145,152 ****
              if headerseen and line[0] in ' \t':
                  # It's a continuation line.
                  list.append(line)
!                 x = (self.dict[headerseen] + "\n " + string.strip(line))
!                 self.dict[headerseen] = string.strip(x)
                  continue
              elif self.iscomment(line):
                  # It's a comment.  Ignore it.
--- 145,152 ----
              if headerseen and line[0] in ' \t':
                  # It's a continuation line.
                  list.append(line)
!                 x = (self.dict[headerseen] + "\n " + line.strip())
!                 self.dict[headerseen] = x.strip()
                  continue
              elif self.iscomment(line):
                  # It's a comment.  Ignore it.
***************
*** 158,164 ****
              if headerseen:
                  # It's a legal header line, save it.
                  list.append(line)
!                 self.dict[headerseen] = string.strip(line[len(headerseen)+1:])
                  continue
              else:
                  # It's not a header line; throw it back and stop here.
--- 158,164 ----
              if headerseen:
                  # It's a legal header line, save it.
                  list.append(line)
!                 self.dict[headerseen] = line[len(headerseen)+1:].strip()
                  continue
              else:
                  # It's not a header line; throw it back and stop here.
***************
*** 182,190 ****
          You may override this method in order to use Message parsing
          on tagged data in RFC822-like formats with special header formats.
          """
!         i = string.find(line, ':')
          if i > 0:
!             return string.lower(line[:i])
          else:
              return None
      
--- 182,190 ----
          You may override this method in order to use Message parsing
          on tagged data in RFC822-like formats with special header formats.
          """
!         i = line.find(':')
          if i > 0:
!             return line[:i].lower()
          else:
              return None
      
***************
*** 219,230 ****
          times, all occurrences are returned.  Case is not
          important in the header name.
          """
!         name = string.lower(name) + ':'
          n = len(name)
          list = []
          hit = 0
          for line in self.headers:
!             if string.lower(line[:n]) == name:
                  hit = 1
              elif line[:1] not in string.whitespace:
                  hit = 0
--- 219,230 ----
          times, all occurrences are returned.  Case is not
          important in the header name.
          """
!         name = name.lower() + ':'
          n = len(name)
          list = []
          hit = 0
          for line in self.headers:
!             if line[:n].lower() == name:
                  hit = 1
              elif line[:1] not in string.whitespace:
                  hit = 0
***************
*** 239,245 ****
          only the first matching header (and its continuation
          lines).
          """
!         name = string.lower(name) + ':'
          n = len(name)
          list = []
          hit = 0
--- 239,245 ----
          only the first matching header (and its continuation
          lines).
          """
!         name = name.lower() + ':'
          n = len(name)
          list = []
          hit = 0
***************
*** 247,253 ****
              if hit:
                  if line[:1] not in string.whitespace:
                      break
!             elif string.lower(line[:n]) == name:
                  hit = 1
              if hit:
                  list.append(line)
--- 247,253 ----
              if hit:
                  if line[:1] not in string.whitespace:
                      break
!             elif line[:n].lower() == name:
                  hit = 1
              if hit:
                  list.append(line)
***************
*** 267,273 ****
          if not list:
              return None
          list[0] = list[0][len(name) + 1:]
!         return string.joinfields(list, '')
      
      def getheader(self, name, default=None):
          """Get the header value for a name.
--- 267,273 ----
          if not list:
              return None
          list[0] = list[0][len(name) + 1:]
!         return ''.join(list)
      
      def getheader(self, name, default=None):
          """Get the header value for a name.
***************
*** 278,284 ****
          version which finds the *last* such header.
          """
          try:
!             return self.dict[string.lower(name)]
          except KeyError:
              return default
      get = getheader
--- 278,284 ----
          version which finds the *last* such header.
          """
          try:
!             return self.dict[name.lower()]
          except KeyError:
              return default
      get = getheader
***************
*** 297,309 ****
          for s in self.getallmatchingheaders(name):
              if s[0] in string.whitespace:
                  if current:
!                     current = "%s\n %s" % (current, string.strip(s))
                  else:
!                     current = string.strip(s)
              else:
                  if have_header:
                      result.append(current)
!                 current = string.strip(s[string.find(s, ":") + 1:])
                  have_header = 1
          if have_header:
              result.append(current)
--- 297,309 ----
          for s in self.getallmatchingheaders(name):
              if s[0] in string.whitespace:
                  if current:
!                     current = "%s\n %s" % (current, s.strip())
                  else:
!                     current = s.strip()
              else:
                  if have_header:
                      result.append(current)
!                 current = s[s.find(":") + 1:].strip()
                  have_header = 1
          if have_header:
              result.append(current)
***************
*** 337,347 ****
              else:
                  if raw:
                      raw.append(', ')
!                 i = string.find(h, ':')
                  if i > 0:
                      addr = h[i+1:]
                  raw.append(addr)
!         alladdrs = string.join(raw, '')
          a = AddrlistClass(alladdrs)
          return a.getaddrlist()
      
--- 337,347 ----
              else:
                  if raw:
                      raw.append(', ')
!                 i = h.find(':')
                  if i > 0:
                      addr = h[i+1:]
                  raw.append(addr)
!         alladdrs = ''.join(raw)
          a = AddrlistClass(alladdrs)
          return a.getaddrlist()
      
***************
*** 379,385 ****
      
      def __getitem__(self, name):
          """Get a specific header, as from a dictionary."""
!         return self.dict[string.lower(name)]
  
      def __setitem__(self, name, value):
          """Set the value of a header.
--- 379,385 ----
      
      def __getitem__(self, name):
          """Get a specific header, as from a dictionary."""
!         return self.dict[name.lower()]
  
      def __setitem__(self, name, value):
          """Set the value of a header.
***************
*** 389,403 ****
          rather than where the altered header was.
          """
          del self[name] # Won't fail if it doesn't exist
!         self.dict[string.lower(name)] = value
          text = name + ": " + value
!         lines = string.split(text, "\n")
          for line in lines:
              self.headers.append(line + "\n")
      
      def __delitem__(self, name):
          """Delete all occurrences of a specific header, if it is present."""
!         name = string.lower(name)
          if not self.dict.has_key(name):
              return
          del self.dict[name]
--- 389,403 ----
          rather than where the altered header was.
          """
          del self[name] # Won't fail if it doesn't exist
!         self.dict[name.lower()] = value
          text = name + ": " + value
!         lines = text.split("\n")
          for line in lines:
              self.headers.append(line + "\n")
      
      def __delitem__(self, name):
          """Delete all occurrences of a specific header, if it is present."""
!         name = name.lower()
          if not self.dict.has_key(name):
              return
          del self.dict[name]
***************
*** 407,413 ****
          hit = 0
          for i in range(len(self.headers)):
              line = self.headers[i]
!             if string.lower(line[:n]) == name:
                  hit = 1
              elif line[:1] not in string.whitespace:
                  hit = 0
--- 407,413 ----
          hit = 0
          for i in range(len(self.headers)):
              line = self.headers[i]
!             if line[:n].lower() == name:
                  hit = 1
              elif line[:1] not in string.whitespace:
                  hit = 0
***************
*** 419,425 ****
  
      def has_key(self, name):
          """Determine whether a message contains the named header."""
!         return self.dict.has_key(string.lower(name))
      
      def keys(self):
          """Get all of a message's header field names."""
--- 419,425 ----
  
      def has_key(self, name):
          """Determine whether a message contains the named header."""
!         return self.dict.has_key(name.lower())
      
      def keys(self):
          """Get all of a message's header field names."""
***************
*** 462,476 ****
  
  def quote(str):
      """Add quotes around a string."""
!     return '"%s"' % string.join(
!     string.split(
!     string.join(
!     string.split(str, '\\'),
!     '\\\\'),
!     '"'),
!     '\\"')
  
- 
  def parseaddr(address):
      """Parse an address into a (realname, mailaddr) tuple."""
      a = AddrlistClass(address)
--- 462,469 ----
  
  def quote(str):
      """Add quotes around a string."""
!     return '"%s"' % str.replace ('\\', '\\\\').replace ('"', '\\"')
  
  def parseaddr(address):
      """Parse an address into a (realname, mailaddr) tuple."""
      a = AddrlistClass(address)
***************
*** 539,545 ****
          if self.pos >= len(self.field):
              # Bad email address technically, no domain.
              if plist:
!                 returnlist = [(string.join(self.commentlist), plist[0])]
              
          elif self.field[self.pos] in '.@':
              # email address is just an addrspec
--- 532,538 ----
          if self.pos >= len(self.field):
              # Bad email address technically, no domain.
              if plist:
!                 returnlist = [(' '.join(self.commentlist), plist[0])]
              
          elif self.field[self.pos] in '.@':
              # email address is just an addrspec
***************
*** 547,553 ****
              self.pos = oldpos
              self.commentlist = oldcl
              addrspec = self.getaddrspec()
!             returnlist = [(string.join(self.commentlist), addrspec)]
              
          elif self.field[self.pos] == ':':
              # address is a group
--- 540,546 ----
              self.pos = oldpos
              self.commentlist = oldcl
              addrspec = self.getaddrspec()
!             returnlist = [(' '.join(self.commentlist), addrspec)]
              
          elif self.field[self.pos] == ':':
              # address is a group
***************
*** 567,579 ****
              routeaddr = self.getrouteaddr()
              
              if self.commentlist:
!                 returnlist = [(string.join(plist) + ' (' + \
!                          string.join(self.commentlist) + ')', routeaddr)]
!             else: returnlist = [(string.join(plist), routeaddr)]
              
          else:
              if plist:
!                 returnlist = [(string.join(self.commentlist), plist[0])]
              elif self.field[self.pos] in self.specials:
                  self.pos = self.pos + 1
          
--- 560,572 ----
              routeaddr = self.getrouteaddr()
              
              if self.commentlist:
!                 returnlist = [(' '.join(plist) + ' (' + \
!                          ' '.join(self.commentlist) + ')', routeaddr)]
!             else: returnlist = [(' '.join(plist), routeaddr)]
              
          else:
              if plist:
!                 returnlist = [(' '.join(self.commentlist), plist[0])]
              elif self.field[self.pos] in self.specials:
                  self.pos = self.pos + 1
          
***************
*** 632,643 ****
              self.gotonext()
          
          if self.pos >= len(self.field) or self.field[self.pos] != '@':
!             return string.join(aslist, '')
          
          aslist.append('@')
          self.pos = self.pos + 1
          self.gotonext()
!         return string.join(aslist, '') + self.getdomain()
      
      def getdomain(self):
          """Get the complete domain name from an address."""
--- 625,636 ----
              self.gotonext()
          
          if self.pos >= len(self.field) or self.field[self.pos] != '@':
!             return ''.join(aslist)
          
          aslist.append('@')
          self.pos = self.pos + 1
          self.gotonext()
!         return ''.join(aslist) + self.getdomain()
      
      def getdomain(self):
          """Get the complete domain name from an address."""
***************
*** 655,661 ****
              elif self.field[self.pos] in self.atomends:
                  break
              else: sdlist.append(self.getatom())
!         return string.join(sdlist, '')
      
      def getdelimited(self, beginchar, endchars, allowcomments = 1):
          """Parse a header fragment delimited by special characters.
--- 648,654 ----
              elif self.field[self.pos] in self.atomends:
                  break
              else: sdlist.append(self.getatom())
!         return ''.join(sdlist)
      
      def getdelimited(self, beginchar, endchars, allowcomments = 1):
          """Parse a header fragment delimited by special characters.
***************
*** 691,697 ****
                  slist.append(self.field[self.pos])
              self.pos = self.pos + 1
          
!         return string.join(slist, '')
      
      def getquote(self):
          """Get a quote-delimited fragment from self's field."""
--- 684,690 ----
                  slist.append(self.field[self.pos])
              self.pos = self.pos + 1
          
!         return ''.join(slist)
      
      def getquote(self):
          """Get a quote-delimited fragment from self's field."""
***************
*** 715,721 ****
              else: atomlist.append(self.field[self.pos])
              self.pos = self.pos + 1
          
!         return string.join(atomlist, '')
      
      def getphraselist(self):
          """Parse a sequence of RFC-822 phrases.
--- 708,714 ----
              else: atomlist.append(self.field[self.pos])
              self.pos = self.pos + 1
          
!         return ''.join(atomlist)
      
      def getphraselist(self):
          """Parse a sequence of RFC-822 phrases.
***************
*** 752,758 ****
          return len(self.addresslist)
  
      def __str__(self):
!         return string.joinfields(map(dump_address_pair, self.addresslist),", ")
  
      def __add__(self, other):
          # Set union
--- 745,751 ----
          return len(self.addresslist)
  
      def __str__(self):
!         return ", ".join(map(dump_address_pair, self.addresslist))
  
      def __add__(self, other):
          # Set union
***************
*** 810,826 ****
      
      Accounts for military timezones.
      """
!     data = string.split(data)
!     if data[0][-1] in (',', '.') or string.lower(data[0]) in _daynames:
          # There's a dayname here. Skip it
          del data[0]
      if len(data) == 3: # RFC 850 date, deprecated
!         stuff = string.split(data[0], '-')
          if len(stuff) == 3:
              data = stuff + data[1:]
      if len(data) == 4:
          s = data[3]
!         i = string.find(s, '+')
          if i > 0:
              data[3:] = [s[:i], s[i+1:]]
          else:
--- 803,819 ----
      
      Accounts for military timezones.
      """
!     data = data.split()
!     if data[0][-1] in (',', '.') or data[0].lower() in _daynames:
          # There's a dayname here. Skip it
          del data[0]
      if len(data) == 3: # RFC 850 date, deprecated
!         stuff = data[0].split('-')
          if len(stuff) == 3:
              data = stuff + data[1:]
      if len(data) == 4:
          s = data[3]
!         i = s.find('+')
          if i > 0:
              data[3:] = [s[:i], s[i+1:]]
          else:
***************
*** 829,844 ****
          return None
      data = data[:5]
      [dd, mm, yy, tm, tz] = data
!     mm = string.lower(mm)
      if not mm in _monthnames:
!         dd, mm = mm, string.lower(dd)
          if not mm in _monthnames:
              return None
      mm = _monthnames.index(mm)+1
      if mm > 12: mm = mm - 12
      if dd[-1] == ',':
          dd = dd[:-1]
!     i = string.find(yy, ':')
      if i > 0:
          yy, tm = tm, yy
      if yy[-1] == ',':
--- 822,837 ----
          return None
      data = data[:5]
      [dd, mm, yy, tm, tz] = data
!     mm = mm.lower()
      if not mm in _monthnames:
!         dd, mm = mm, dd.lower()
          if not mm in _monthnames:
              return None
      mm = _monthnames.index(mm)+1
      if mm > 12: mm = mm - 12
      if dd[-1] == ',':
          dd = dd[:-1]
!     i = yy.find(':')
      if i > 0:
          yy, tm = tm, yy
      if yy[-1] == ',':
***************
*** 847,853 ****
          yy, tz = tz, yy
      if tm[-1] == ',':
          tm = tm[:-1]
!     tm = string.splitfields(tm, ':')
      if len(tm) == 2:
          [thh, tmm] = tm
          tss = '0'
--- 840,846 ----
          yy, tz = tz, yy
      if tm[-1] == ',':
          tm = tm[:-1]
!     tm = tm.split(':')
      if len(tm) == 2:
          [thh, tmm] = tm
          tss = '0'
***************
*** 856,876 ****
      else:
          return None
      try:
!         yy = string.atoi(yy)
!         dd = string.atoi(dd)
!         thh = string.atoi(thh)
!         tmm = string.atoi(tmm)
!         tss = string.atoi(tss)
!     except string.atoi_error:
          return None
      tzoffset=None
!     tz=string.upper(tz)
      if _timezones.has_key(tz):
          tzoffset=_timezones[tz]
      else:
          try: 
!             tzoffset=string.atoi(tz)
!         except string.atoi_error: 
              pass
      # Convert a timezone offset into seconds ; -0500 -> -18000
      if tzoffset:
--- 849,869 ----
      else:
          return None
      try:
!         yy = int(yy)
!         dd = int(dd)
!         thh = int(thh)
!         tmm = int(tmm)
!         tss = int(tss)
!     except ValueError:
          return None
      tzoffset=None
!     tz=tz.upper()
      if _timezones.has_key(tz):
          tzoffset=_timezones[tz]
      else:
          try: 
!             tzoffset=int(tz)
!         except ValueError: 
              pass
      # Convert a timezone offset into seconds ; -0500 -> -18000
      if tzoffset:
Index: Lib/robotparser.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/robotparser.py,v
retrieving revision 1.3
diff -c -r1.3 robotparser.py
*** robotparser.py	2000/03/27 19:29:31	1.3
--- robotparser.py	2000/04/11 11:56:50
***************
*** 30,36 ****
  
      def parse(self, lines):
          """parse the input lines from a robot.txt file"""
!         import string, re
          active = []
          for line in lines:
              if self.debug: print '>', line,
--- 30,36 ----
  
      def parse(self, lines):
          """parse the input lines from a robot.txt file"""
!         import re
          active = []
          for line in lines:
              if self.debug: print '>', line,
***************
*** 39,50 ****
                  active = []
                  continue
              # remove optional comment and strip line
!             line = string.strip(line[:string.find(line, '#')])
              if not line:
                  continue
              line = re.split(' *: *', line)
              if len(line) == 2:
!                 line[0] = string.lower(line[0])
                  if line[0] == 'user-agent':
                      # this record applies to this user agent
                      if self.debug: print '>> user-agent:', line[1]
--- 39,50 ----
                  active = []
                  continue
              # remove optional comment and strip line
!             line = line[:line.find('#')].strip()
              if not line:
                  continue
              line = re.split(' *: *', line)
              if len(line) == 2:
!                 line[0] = line[0].lower()
                  if line[0] == 'user-agent':
                      # this record applies to this user agent
                      if self.debug: print '>> user-agent:', line[1]
Index: Lib/sgmllib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/sgmllib.py,v
retrieving revision 1.19
diff -c -r1.19 sgmllib.py
*** sgmllib.py	2000/02/04 15:28:40	1.19
--- sgmllib.py	2000/04/11 11:56:51
***************
*** 220,226 ****
              if not match:
                  return -1
              tag, data = match.group(1, 2)
!             tag = string.lower(tag)
              self.finish_shorttag(tag, data)
              k = match.end(0)
              return k
--- 220,226 ----
              if not match:
                  return -1
              tag, data = match.group(1, 2)
!             tag = tag.lower()
              self.finish_shorttag(tag, data)
              k = match.end(0)
              return k
***************
*** 240,246 ****
              if not match:
                  raise RuntimeError, 'unexpected call to parse_starttag'
              k = match.end(0)
!             tag = string.lower(rawdata[i+1:k])
              self.lasttag = tag
          while k < j:
              match = attrfind.match(rawdata, k)
--- 240,246 ----
              if not match:
                  raise RuntimeError, 'unexpected call to parse_starttag'
              k = match.end(0)
!             tag = rawdata[i+1:k].lower()
              self.lasttag = tag
          while k < j:
              match = attrfind.match(rawdata, k)
***************
*** 251,257 ****
              elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
                   attrvalue[:1] == '"' == attrvalue[-1:]:
                  attrvalue = attrvalue[1:-1]
!             attrs.append((string.lower(attrname), attrvalue))
              k = match.end(0)
          if rawdata[j] == '>':
              j = j+1
--- 251,257 ----
              elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
                   attrvalue[:1] == '"' == attrvalue[-1:]:
                  attrvalue = attrvalue[1:-1]
!             attrs.append((attrname.lower(), attrvalue))
              k = match.end(0)
          if rawdata[j] == '>':
              j = j+1
***************
*** 265,271 ****
          if not match:
              return -1
          j = match.start(0)
!         tag = string.lower(string.strip(rawdata[i+2:j]))
          if rawdata[j] == '>':
              j = j+1
          self.finish_endtag(tag)
--- 265,271 ----
          if not match:
              return -1
          j = match.start(0)
!         tag = rawdata[i+2:j].strip().lower()
          if rawdata[j] == '>':
              j = j+1
          self.finish_endtag(tag)
***************
*** 344,351 ****
      # Example -- handle character reference, no need to override
      def handle_charref(self, name):
          try:
!             n = string.atoi(name)
!         except string.atoi_error:
              self.unknown_charref(name)
              return
          if not 0 <= n <= 255:
--- 344,351 ----
      # Example -- handle character reference, no need to override
      def handle_charref(self, name):
          try:
!             n = int(name)
!         except ValueError:
              self.unknown_charref(name)
              return
          if not 0 <= n <= 255:
Index: Lib/smtplib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/smtplib.py,v
retrieving revision 1.23
diff -c -r1.23 smtplib.py
*** smtplib.py	2000/03/28 21:45:46	1.23
--- smtplib.py	2000/04/11 11:56:51
***************
*** 40,46 ****
  # This was modified from the Python 1.5 library HTTP lib.
  
  import socket
- import string
  import re
  import rfc822
  import types
--- 40,45 ----
***************
*** 204,214 ****
  
          """
          if not port:
!             i = string.find(host, ':')
              if i >= 0:
                  host, port = host[:i], host[i+1:]
!                 try: port = string.atoi(port)
!                 except string.atoi_error:
                      raise socket.error, "nonnumeric port"
          if not port: port = SMTP_PORT
          self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--- 203,213 ----
  
          """
          if not port:
!             i = host.find(':')
              if i >= 0:
                  host, port = host[:i], host[i+1:]
!                 try: port = int(port)
!                 except ValueError:
                      raise socket.error, "nonnumeric port"
          if not port: port = SMTP_PORT
          self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
***************
*** 259,270 ****
                  self.close()
                  raise SMTPServerDisconnected("Connection unexpectedly closed")
              if self.debuglevel > 0: print 'reply:', `line`
!             resp.append(string.strip(line[4:]))
              code=line[:3]
              # Check that the error code is syntactically correct.
              # Don't attempt to read a continuation line if it is broken.
              try:
!                 errcode = string.atoi(code)
              except ValueError:
                  errcode = -1
                  break
--- 258,269 ----
                  self.close()
                  raise SMTPServerDisconnected("Connection unexpectedly closed")
              if self.debuglevel > 0: print 'reply:', `line`
!             resp.append(line[4:].strip())
              code=line[:3]
              # Check that the error code is syntactically correct.
              # Don't attempt to read a continuation line if it is broken.
              try:
!                 errcode = int(code)
              except ValueError:
                  errcode = -1
                  break
***************
*** 272,278 ****
              if line[3:4]!="-":
                  break
  
!         errmsg = string.join(resp,"\n")
          if self.debuglevel > 0: 
              print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg)
          return errcode, errmsg
--- 271,277 ----
              if line[3:4]!="-":
                  break
  
!         errmsg = "\n".join(resp)
          if self.debuglevel > 0: 
              print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg)
          return errcode, errmsg
***************
*** 288,294 ****
          Hostname to send for this command defaults to the FQDN of the local
          host.
          """
!         name=string.strip(name)
          if len(name)==0:
              name = socket.gethostname()
              try:
--- 287,293 ----
          Hostname to send for this command defaults to the FQDN of the local
          host.
          """
!         name=name.strip()
          if len(name)==0:
              name = socket.gethostname()
              try:
***************
*** 305,311 ****
          Hostname to send for this command defaults to the FQDN of the local
          host.
          """
!         name=string.strip(name)
          if len(name)==0:
              name = socket.gethostname()
              try:
--- 304,310 ----
          Hostname to send for this command defaults to the FQDN of the local
          host.
          """
!         name=name.strip()
          if len(name)==0:
              name = socket.gethostname()
              try:
***************
*** 324,342 ****
              return (code,msg)
          self.does_esmtp=1
          #parse the ehlo responce -ddm
!         resp=string.split(self.ehlo_resp,'\n')
          del resp[0]
          for each in resp:
              m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each)
              if m:
!                 feature=string.lower(m.group("feature"))
!                 params=string.strip(m.string[m.end("feature"):])
                  self.esmtp_features[feature]=params
          return (code,msg)
  
      def has_extn(self, opt):
          """Does the server support a given SMTP service extension?"""
!         return self.esmtp_features.has_key(string.lower(opt))
  
      def help(self, args=''):
          """SMTP 'help' command.
--- 323,341 ----
              return (code,msg)
          self.does_esmtp=1
          #parse the ehlo responce -ddm
!         resp=self.ehlo_resp.split('\n')
          del resp[0]
          for each in resp:
              m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each)
              if m:
!                 feature=m.group("feature").lower()
!                 params=m.string[m.end("feature"):].strip()
                  self.esmtp_features[feature]=params
          return (code,msg)
  
      def has_extn(self, opt):
          """Does the server support a given SMTP service extension?"""
!         return self.esmtp_features.has_key(opt.lower())
  
      def help(self, args=''):
          """SMTP 'help' command.
***************
*** 356,362 ****
          """SMTP 'mail' command -- begins mail xfer session."""
          optionlist = ''
          if options and self.does_esmtp:
!             optionlist = ' ' + string.join(options, ' ')
          self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist))
          return self.getreply()
  
--- 355,361 ----
          """SMTP 'mail' command -- begins mail xfer session."""
          optionlist = ''
          if options and self.does_esmtp:
!             optionlist = ' ' + ' '.join(options)
          self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender) ,optionlist))
          return self.getreply()
  
***************
*** 364,370 ****
          """SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
          optionlist = ''
          if options and self.does_esmtp:
!             optionlist = ' ' + string.join(options, ' ')
          self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist))
          return self.getreply()
  
--- 363,369 ----
          """SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
          optionlist = ''
          if options and self.does_esmtp:
!             optionlist = ' ' + ' '.join(options)
          self.putcmd("rcpt","TO:%s%s" % (quoteaddr(recip),optionlist))
          return self.getreply()
  
***************
*** 521,530 ****
  
      def prompt(prompt):
          sys.stdout.write(prompt + ": ")
!         return string.strip(sys.stdin.readline())
  
      fromaddr = prompt("From")
!     toaddrs  = string.splitfields(prompt("To"), ',')
      print "Enter message, end with ^D:"
      msg = ''
      while 1:
--- 520,529 ----
  
      def prompt(prompt):
          sys.stdout.write(prompt + ": ")
!         return sys.stdin.readline().strip()
  
      fromaddr = prompt("From")
!     toaddrs  = prompt("To").split(',')
      print "Enter message, end with ^D:"
      msg = ''
      while 1:
Index: Lib/sre_compile.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/sre_compile.py,v
retrieving revision 1.3
diff -c -r1.3 sre_compile.py
*** sre_compile.py	2000/04/10 17:10:48	1.3
--- sre_compile.py	2000/04/11 11:56:51
***************
*** 17,23 ****
  # FIXME: <fl> formalize (objectify?) and document the compiler code
  # format, so that other frontends can use this compiler
  
! import array, string, sys
  
  import _sre
  
--- 17,23 ----
  # FIXME: <fl> formalize (objectify?) and document the compiler code
  # format, so that other frontends can use this compiler
  
! import array, sys
  
  import _sre
  
***************
*** 49,55 ****
  
  def _lower(literal):
      # return _sre._lower(literal) # FIXME
!     return string.lower(literal)
  
  def _compile(code, pattern, flags):
      append = code.append
--- 49,55 ----
  
  def _lower(literal):
      # return _sre._lower(literal) # FIXME
!     return literal.lower()
  
  def _compile(code, pattern, flags):
      append = code.append
Index: Lib/sre_constants.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/sre_constants.py,v
retrieving revision 1.3
diff -c -r1.3 sre_constants.py
*** sre_constants.py	2000/04/10 17:10:48	1.3
--- sre_constants.py	2000/04/11 11:56:51
***************
*** 120,131 ****
  }
  
  if __name__ == "__main__":
-     import string
      items = CODES.items()
      items.sort(lambda a, b: cmp(a[1], b[1]))
      f = open("sre_constants.h", "w")
      f.write("/* generated by sre_constants.py */\n")
      for k, v in items:
! 	f.write("#define SRE_OP_" + string.upper(k) + " " + str(v) + "\n")
      f.close()
      print "done"
--- 120,130 ----
  }
  
  if __name__ == "__main__":
      items = CODES.items()
      items.sort(lambda a, b: cmp(a[1], b[1]))
      f = open("sre_constants.h", "w")
      f.write("/* generated by sre_constants.py */\n")
      for k, v in items:
! 	f.write("#define SRE_OP_" + k.upper() + " " + str(v) + "\n")
      f.close()
      print "done"
Index: Lib/tabnanny.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/tabnanny.py,v
retrieving revision 1.10
diff -c -r1.10 tabnanny.py
*** tabnanny.py	2000/02/23 15:32:19	1.10
--- tabnanny.py	2000/04/11 11:56:52
***************
*** 12,18 ****
  
  import os
  import sys
- import string
  import getopt
  import tokenize
  
--- 12,17 ----
***************
*** 236,247 ****
          return a
  
  def format_witnesses(w):
-     import string
      firsts = map(lambda tup: str(tup[0]), w)
      prefix = "at tab size"
      if len(w) > 1:
          prefix = prefix + "s"
!     return prefix + " " + string.join(firsts, ', ')
  
  # The collection of globals, the reset_globals() function, and the
  # tokeneater() function, depend on which version of tokenize is
--- 235,245 ----
          return a
  
  def format_witnesses(w):
      firsts = map(lambda tup: str(tup[0]), w)
      prefix = "at tab size"
      if len(w) > 1:
          prefix = prefix + "s"
!     return prefix + " " + ', '.join(firsts)
  
  # The collection of globals, the reset_globals() function, and the
  # tokeneater() function, depend on which version of tokenize is
Index: Lib/telnetlib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/telnetlib.py,v
retrieving revision 1.7
diff -c -r1.7 telnetlib.py
*** telnetlib.py	1998/12/23 23:04:17	1.7
--- telnetlib.py	2000/04/11 11:56:52
***************
*** 40,46 ****
  import sys
  import socket
  import select
- import string
  
  # Tunable parameters
  DEBUGLEVEL = 0
--- 40,45 ----
***************
*** 187,193 ****
  
          """
          if IAC in buffer:
!             buffer = string.replace(buffer, IAC, IAC+IAC)
          self.msg("send %s", `buffer`)
          self.sock.send(buffer)
  
--- 186,192 ----
  
          """
          if IAC in buffer:
!             buffer = buffer.replace(IAC, IAC+IAC)
          self.msg("send %s", `buffer`)
          self.sock.send(buffer)
  
***************
*** 201,207 ****
          """
          n = len(match)
          self.process_rawq()
!         i = string.find(self.cookedq, match)
          if i >= 0:
              i = i+n
              buf = self.cookedq[:i]
--- 200,206 ----
          """
          n = len(match)
          self.process_rawq()
!         i = self.cookedq.find(match)
          if i >= 0:
              i = i+n
              buf = self.cookedq[:i]
***************
*** 215,221 ****
              i = max(0, len(self.cookedq)-n)
              self.fill_rawq()
              self.process_rawq()
!             i = string.find(self.cookedq, match, i)
              if i >= 0:
                  i = i+n
                  buf = self.cookedq[:i]
--- 214,220 ----
              i = max(0, len(self.cookedq)-n)
              self.fill_rawq()
              self.process_rawq()
!             i = self.cookedq.find(match, i)
              if i >= 0:
                  i = i+n
                  buf = self.cookedq[:i]
Index: Lib/token.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/token.py,v
retrieving revision 1.7
diff -c -r1.7 token.py
*** token.py	2000/02/04 15:28:41	1.7
--- token.py	2000/04/11 11:56:52
***************
*** 71,77 ****
  
  def main():
      import re
-     import string
      import sys
      args = sys.argv[1:]
      inFileName = args and args[0] or "Include/token.h"
--- 71,76 ----
***************
*** 83,89 ****
      except IOError, err:
          sys.stdout.write("I/O error: %s\n" % str(err))
          sys.exit(1)
!     lines = string.splitfields(fp.read(), "\n")
      fp.close()
      prog = re.compile(
          "#define[ \t][ \t]*([A-Z][A-Z_]*)[ \t][ \t]*([0-9][0-9]*)",
--- 82,88 ----
      except IOError, err:
          sys.stdout.write("I/O error: %s\n" % str(err))
          sys.exit(1)
!     lines = fp.read().split("\n")
      fp.close()
      prog = re.compile(
          "#define[ \t][ \t]*([A-Z][A-Z_]*)[ \t][ \t]*([0-9][0-9]*)",
***************
*** 93,99 ****
          match = prog.match(line)
          if match:
              name, val = match.group(1, 2)
!             val = string.atoi(val)
              tokens[val] = name          # reverse so we can sort them...
      keys = tokens.keys()
      keys.sort()
--- 92,98 ----
          match = prog.match(line)
          if match:
              name, val = match.group(1, 2)
!             val = int(val)
              tokens[val] = name          # reverse so we can sort them...
      keys = tokens.keys()
      keys.sort()
***************
*** 103,109 ****
      except IOError, err:
          sys.stderr.write("I/O error: %s\n" % str(err))
          sys.exit(2)
!     format = string.splitfields(fp.read(), "\n")
      fp.close()
      try:
          start = format.index("#--start constants--") + 1
--- 102,108 ----
      except IOError, err:
          sys.stderr.write("I/O error: %s\n" % str(err))
          sys.exit(2)
!     format = fp.read().split("\n")
      fp.close()
      try:
          start = format.index("#--start constants--") + 1
***************
*** 120,126 ****
      except IOError, err:
          sys.stderr.write("I/O error: %s\n" % str(err))
          sys.exit(4)
!     fp.write(string.joinfields(format, "\n"))
      fp.close()
  
  
--- 119,125 ----
      except IOError, err:
          sys.stderr.write("I/O error: %s\n" % str(err))
          sys.exit(4)
!     fp.write("\n".join(format))
      fp.close()
  
  
Index: Lib/tokenize.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/tokenize.py,v
retrieving revision 1.12
diff -c -r1.12 tokenize.py
*** tokenize.py	1998/04/03 16:05:38	1.12
--- tokenize.py	2000/04/11 11:56:52
***************
*** 26,32 ****
  #     Imagnumber is new.  Expfloat is corrected to reject '0e4'.
  # Note: to quote a backslash in a regex, it must be doubled in a r'aw' string.
  
! def group(*choices): return '(' + string.join(choices, '|') + ')'
  def any(*choices): return apply(group, choices) + '*'
  def maybe(*choices): return apply(group, choices) + '?'
  
--- 26,32 ----
  #     Imagnumber is new.  Expfloat is corrected to reject '0e4'.
  # Note: to quote a backslash in a regex, it must be doubled in a r'aw' string.
  
! def group(*choices): return '(' + '|'.join(choices) + ')'
  def any(*choices): return apply(group, choices) + '*'
  def maybe(*choices): return apply(group, choices) + '?'
  
Index: Lib/traceback.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/traceback.py,v
retrieving revision 1.15
diff -c -r1.15 traceback.py
*** traceback.py	2000/04/10 16:29:29	1.15
--- traceback.py	2000/04/11 11:56:53
***************
*** 18,24 ****
  		_print(file,
  		       '  File "%s", line %d, in %s' % (filename,lineno,name))
  		if line:
! 			_print(file, '    %s' % string.strip(line))
  
  def format_list(extracted_list):
  	"""Given a list of tuples as returned by extract_tb() or
--- 18,24 ----
  		_print(file,
  		       '  File "%s", line %d, in %s' % (filename,lineno,name))
  		if line:
! 			_print(file, '    %s' % line.strip())
  
  def format_list(extracted_list):
  	"""Given a list of tuples as returned by extract_tb() or
***************
*** 31,37 ****
  	for filename, lineno, name, line in extracted_list:
  		item = '  File "%s", line %d, in %s\n' % (filename,lineno,name)
  		if line:
! 			item = item + '    %s\n' % string.strip(line)
  		list.append(item)
  	return list
  	
--- 31,37 ----
  	for filename, lineno, name, line in extracted_list:
  		item = '  File "%s", line %d, in %s\n' % (filename,lineno,name)
  		if line:
! 			item = item + '    %s\n' % line.strip()
  		list.append(item)
  	return list
  	
***************
*** 56,62 ****
  		_print(file,
  		       '  File "%s", line %d, in %s' % (filename,lineno,name))
  		line = linecache.getline(filename, lineno)
! 		if line: _print(file, '    ' + string.strip(line))
  		tb = tb.tb_next
  		n = n+1
  
--- 56,62 ----
  		_print(file,
  		       '  File "%s", line %d, in %s' % (filename,lineno,name))
  		line = linecache.getline(filename, lineno)
! 		if line: _print(file, '    ' + line.strip())
  		tb = tb.tb_next
  		n = n+1
  
***************
*** 85,91 ****
  		filename = co.co_filename
  		name = co.co_name
  		line = linecache.getline(filename, lineno)
! 		if line: line = string.strip(line)
  		else: line = None
  		list.append((filename, lineno, name, line))
  		tb = tb.tb_next
--- 85,91 ----
  		filename = co.co_filename
  		name = co.co_name
  		line = linecache.getline(filename, lineno)
! 		if line: line = line.strip()
  		else: line = None
  		list.append((filename, lineno, name, line))
  		tb = tb.tb_next
***************
*** 157,163 ****
  				while i < len(line) and \
  				      line[i] in string.whitespace:
  					i = i+1
! 				list.append('    %s\n' % string.strip(line))
  				s = '    '
  				for c in line[i:offset-1]:
  					if c in string.whitespace:
--- 157,163 ----
  				while i < len(line) and \
  				      line[i] in string.whitespace:
  					i = i+1
! 				list.append('    %s\n' % line.strip())
  				s = '    '
  				for c in line[i:offset-1]:
  					if c in string.whitespace:
***************
*** 236,242 ****
  		filename = co.co_filename
  		name = co.co_name
  		line = linecache.getline(filename, lineno)
! 		if line: line = string.strip(line)
  		else: line = None
  		list.append((filename, lineno, name, line))
  		f = f.f_back
--- 236,242 ----
  		filename = co.co_filename
  		name = co.co_name
  		line = linecache.getline(filename, lineno)
! 		if line: line = line.strip()
  		else: line = None
  		list.append((filename, lineno, name, line))
  		f = f.f_back
Index: Lib/urllib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/urllib.py,v
retrieving revision 1.91
diff -c -r1.91 urllib.py
*** urllib.py	2000/02/04 15:28:41	1.91
--- urllib.py	2000/04/11 11:56:53
***************
*** 150,156 ****
          self.type = type
          if '-' in name:
              # replace - with _
!             name = string.join(string.split(name, '-'), '_')
          if not hasattr(self, name):
              if data is None:
                  return self.open_unknown(fullurl)
--- 150,156 ----
          self.type = type
          if '-' in name:
              # replace - with _
!             name = name.replace ('-', '_')
          if not hasattr(self, name):
              if data is None:
                  return self.open_unknown(fullurl)
***************
*** 239,245 ****
              urltype, rest = splittype(selector)
              url = rest
              user_passwd = None
!             if string.lower(urltype) != 'http':
                  realhost = None
              else:
                  realhost, rest = splithost(rest)
--- 239,245 ----
              urltype, rest = splittype(selector)
              url = rest
              user_passwd = None
!             if urltype.lower() != 'http':
                  realhost = None
              else:
                  realhost, rest = splithost(rest)
***************
*** 251,257 ****
          if not host: raise IOError, ('http error', 'no host given')
          if user_passwd:
              import base64
!             auth = string.strip(base64.encodestring(user_passwd))
          else:
              auth = None
          h = httplib.HTTP(host)
--- 251,257 ----
          if not host: raise IOError, ('http error', 'no host given')
          if user_passwd:
              import base64
!             auth = base64.encodestring(user_passwd).strip()
          else:
              auth = None
          h = httplib.HTTP(host)
***************
*** 308,314 ****
              else:
                  host, selector = url
                  urltype, rest = splittype(selector)
!                 if string.lower(urltype) == 'https':
                      realhost, rest = splithost(rest)
                      user_passwd, realhost = splituser(realhost)
                      if user_passwd:
--- 308,314 ----
              else:
                  host, selector = url
                  urltype, rest = splittype(selector)
!                 if urltype.lower() == 'https':
                      realhost, rest = splithost(rest)
                      user_passwd, realhost = splituser(realhost)
                      if user_passwd:
***************
*** 317,323 ****
              if not host: raise IOError, ('https error', 'no host given')
              if user_passwd:
                  import base64
!                 auth = string.strip(base64.encodestring(user_passwd))
              else:
                  auth = None
              h = httplib.HTTPS(host, 0,
--- 317,323 ----
              if not host: raise IOError, ('https error', 'no host given')
              if user_passwd:
                  import base64
!                 auth = base64.encodestring(user_passwd).strip()
              else:
                  auth = None
              h = httplib.HTTPS(host, 0,
***************
*** 399,409 ****
              port = int(port)
          path, attrs = splitattr(path)
          path = unquote(path)
!         dirs = string.splitfields(path, '/')
          dirs, file = dirs[:-1], dirs[-1]
          if dirs and not dirs[0]: dirs = dirs[1:]
          if dirs and not dirs[0]: dirs[0] = '/'
!         key = (user, host, port, string.joinfields(dirs, '/'))
          # XXX thread unsafe!
          if len(self.ftpcache) > MAXFTPCACHE:
              # Prune the cache, rather arbitrarily
--- 399,409 ----
              port = int(port)
          path, attrs = splitattr(path)
          path = unquote(path)
!         dirs = path.split('/')
          dirs, file = dirs[:-1], dirs[-1]
          if dirs and not dirs[0]: dirs = dirs[1:]
          if dirs and not dirs[0]: dirs[0] = '/'
!         key = (user, host, port, '/'.join(dirs))
          # XXX thread unsafe!
          if len(self.ftpcache) > MAXFTPCACHE:
              # Prune the cache, rather arbitrarily
***************
*** 420,428 ****
              else: type = 'I'
              for attr in attrs:
                  attr, value = splitvalue(attr)
!                 if string.lower(attr) == 'type' and \
                     value in ('a', 'A', 'i', 'I', 'd', 'D'):
!                     type = string.upper(value)
              (fp, retrlen) = self.ftpcache[key].retrfile(file, type)
              if retrlen is not None and retrlen >= 0:
                  import mimetools, StringIO
--- 420,428 ----
              else: type = 'I'
              for attr in attrs:
                  attr, value = splitvalue(attr)
!                 if attr.lower() == 'type' and \
                     value in ('a', 'A', 'i', 'I', 'd', 'D'):
!                     type = value.upper()
              (fp, retrlen) = self.ftpcache[key].retrfile(file, type)
              if retrlen is not None and retrlen >= 0:
                  import mimetools, StringIO
***************
*** 445,456 ****
          # parameter := attribute "=" value
          import StringIO, mimetools, time
          try:
!             [type, data] = string.split(url, ',', 1)
          except ValueError:
              raise IOError, ('data error', 'bad data URL')
          if not type:
              type = 'text/plain;charset=US-ASCII'
!         semi = string.rfind(type, ';')
          if semi >= 0 and '=' not in type[semi:]:
              encoding = type[semi+1:]
              type = type[:semi]
--- 445,456 ----
          # parameter := attribute "=" value
          import StringIO, mimetools, time
          try:
!             [type, data] = url.split(',', 1)
          except ValueError:
              raise IOError, ('data error', 'bad data URL')
          if not type:
              type = 'text/plain;charset=US-ASCII'
!         semi = type.rfind(';')
          if semi >= 0 and '=' not in type[semi:]:
              encoding = type[semi+1:]
              type = type[:semi]
***************
*** 468,474 ****
          msg.append('Content-length: %d' % len(data))
          msg.append('')
          msg.append(data)
!         msg = string.join(msg, '\n')
          f = StringIO.StringIO(msg)
          headers = mimetools.Message(f, 0)
          f.fileno = None     # needed for addinfourl
--- 468,474 ----
          msg.append('Content-length: %d' % len(data))
          msg.append('')
          msg.append(data)
!         msg = '\n'.join(msg)
          f = StringIO.StringIO(msg)
          headers = mimetools.Message(f, 0)
          f.fileno = None     # needed for addinfourl
***************
*** 518,524 ****
              match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
              if match:
                  scheme, realm = match.groups()
!                 if string.lower(scheme) == 'basic':
                     name = 'retry_' + self.type + '_basic_auth'
                     if data is None:
                         return getattr(self,name)(url, realm)
--- 518,524 ----
              match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
              if match:
                  scheme, realm = match.groups()
!                 if scheme.lower() == 'basic':
                     name = 'retry_' + self.type + '_basic_auth'
                     if data is None:
                         return getattr(self,name)(url, realm)
***************
*** 527,533 ****
  
      def retry_http_basic_auth(self, url, realm, data=None):
          host, selector = splithost(url)
!         i = string.find(host, '@') + 1
          host = host[i:]
          user, passwd = self.get_user_passwd(host, realm, i)
          if not (user or passwd): return None
--- 527,533 ----
  
      def retry_http_basic_auth(self, url, realm, data=None):
          host, selector = splithost(url)
!         i = host.find('@') + 1
          host = host[i:]
          user, passwd = self.get_user_passwd(host, realm, i)
          if not (user or passwd): return None
***************
*** 540,546 ****
     
      def retry_https_basic_auth(self, url, realm, data=None):
              host, selector = splithost(url)
!             i = string.find(host, '@') + 1
              host = host[i:]
              user, passwd = self.get_user_passwd(host, realm, i)
              if not (user or passwd): return None
--- 540,546 ----
     
      def retry_https_basic_auth(self, url, realm, data=None):
              host, selector = splithost(url)
!             i = host.find('@') + 1
              host = host[i:]
              user, passwd = self.get_user_passwd(host, realm, i)
              if not (user or passwd): return None
***************
*** 549,555 ****
              return self.open_https(newurl)
  
      def get_user_passwd(self, host, realm, clear_cache = 0):
!         key = realm + '@' + string.lower(host)
          if self.auth_cache.has_key(key):
              if clear_cache:
                  del self.auth_cache[key]
--- 549,555 ----
              return self.open_https(newurl)
  
      def get_user_passwd(self, host, realm, clear_cache = 0):
!         key = realm + '@' + host.lower()
          if self.auth_cache.has_key(key):
              if clear_cache:
                  del self.auth_cache[key]
***************
*** 774,780 ****
              i = len(basepath)
          else:
              # else replace last component
!             i = string.rfind(basepath, '/')
          if i < 0:
              # basepath not absolute
              if host:
--- 774,780 ----
              i = len(basepath)
          else:
              # else replace last component
!             i = basepath.rfind('/')
          if i < 0:
              # basepath not absolute
              if host:
***************
*** 789,795 ****
          # Interpret ../ (important because of symlinks)
          while basepath and path[:3] == '../':
              path = path[3:]
!             i = string.rfind(basepath[:-1], '/')
              if i > 0:
                  basepath = basepath[:i+1]
              elif i == 0:
--- 789,795 ----
          # Interpret ../ (important because of symlinks)
          while basepath and path[:3] == '../':
              path = path[3:]
!             i = basepath[:-1].rfind('/')
              if i > 0:
                  basepath = basepath[:i+1]
              elif i == 0:
***************
*** 823,832 ****
  
  def unwrap(url):
      """unwrap('<URL:type://host/path>') --> 'type://host/path'."""
!     url = string.strip(url)
      if url[:1] == '<' and url[-1:] == '>':
!         url = string.strip(url[1:-1])
!     if url[:4] == 'URL:': url = string.strip(url[4:])
      return url
  
  _typeprog = None
--- 823,832 ----
  
  def unwrap(url):
      """unwrap('<URL:type://host/path>') --> 'type://host/path'."""
!     url = url.strip()
      if url[:1] == '<' and url[-1:] == '>':
!         url = url[1:-1].strip()
!     if url[:4] == 'URL:': url = url[4:].strip()
      return url
  
  _typeprog = None
***************
*** 907,915 ****
      if match:
          host, port = match.group(1, 2)
          try:
!             if not port: raise string.atoi_error, "no digits"
!             nport = string.atoi(port)
!         except string.atoi_error:
              nport = None
          return host, nport
      return host, defport
--- 907,915 ----
      if match:
          host, port = match.group(1, 2)
          try:
!             if not port: raise ValueError, "no digits"
!             nport = int(port)
!         except ValueError:
              nport = None
          return host, nport
      return host, defport
***************
*** 941,947 ****
  def splitattr(url):
      """splitattr('/path;attr1=value1;attr2=value2;...') ->
          '/path', ['attr1=value1', 'attr2=value2', ...]."""
!     words = string.splitfields(url, ';')
      return words[0], words[1:]
  
  _valueprog = None
--- 941,947 ----
  def splitattr(url):
      """splitattr('/path;attr1=value1;attr2=value2;...') ->
          '/path', ['attr1=value1', 'attr2=value2', ...]."""
!     words = url.split(';')
      return words[0], words[1:]
  
  _valueprog = None
***************
*** 965,972 ****
  def unquote(s):
      """unquote('abc%20def') -> 'abc def'."""
      mychr = chr
!     myatoi = string.atoi
!     list = string.split(s, '%')
      res = [list[0]]
      myappend = res.append
      del list[0]
--- 965,972 ----
  def unquote(s):
      """unquote('abc%20def') -> 'abc def'."""
      mychr = chr
!     myatoi = int
!     list = s.split('%')
      res = [list[0]]
      myappend = res.append
      del list[0]
***************
*** 979,990 ****
                  myappend('%' + item)
          else:
              myappend('%' + item)
!     return string.join(res, "")
  
  def unquote_plus(s):
      if '+' in s:
          # replace '+' with ' '
!         s = string.join(string.split(s, '+'), ' ')
      return unquote(s)
  
  always_safe = string.letters + string.digits + '_,.-'
--- 979,990 ----
                  myappend('%' + item)
          else:
              myappend('%' + item)
!     return "".join(res)
  
  def unquote_plus(s):
      if '+' in s:
          # replace '+' with ' '
! 	s = s.replace('+', ' ')
      return unquote(s)
  
  always_safe = string.letters + string.digits + '_,.-'
***************
*** 997,1012 ****
          c = res[i]
          if c not in safe:
              res[i] = '%%%02x' % ord(c)
!     return string.joinfields(res, '')
  
  def quote_plus(s, safe = '/'):
      # XXX Can speed this up an order of magnitude
      if ' ' in s:
          # replace ' ' with '+'
!         l = string.split(s, ' ')
          for i in range(len(l)):
              l[i] = quote(l[i], safe)
!         return string.join(l, '+')
      else:
          return quote(s, safe)
  
--- 997,1012 ----
          c = res[i]
          if c not in safe:
              res[i] = '%%%02x' % ord(c)
!     return ''.join(res)
  
  def quote_plus(s, safe = '/'):
      # XXX Can speed this up an order of magnitude
      if ' ' in s:
          # replace ' ' with '+'
!         l = s.split(' ')
          for i in range(len(l)):
              l[i] = quote(l[i], safe)
!         return '+'.join(l)
      else:
          return quote(s, safe)
  
***************
*** 1017,1023 ****
          k = quote_plus(str(k))
          v = quote_plus(str(v))
          l.append(k + '=' + v)
!     return string.join(l, '&')
  
  
  # Proxy handling
--- 1017,1023 ----
          k = quote_plus(str(k))
          v = quote_plus(str(v))
          l.append(k + '=' + v)
!     return '&'.join(l)
  
  
  # Proxy handling
***************
*** 1064,1070 ****
          """
          proxies = {}
          for name, value in os.environ.items():
!             name = string.lower(name)
              if value and name[-6:] == '_proxy':
                  proxies[name[:-6]] = value
          return proxies
--- 1064,1070 ----
          """
          proxies = {}
          for name, value in os.environ.items():
!             name = name.lower()
              if value and name[-6:] == '_proxy':
                  proxies[name[:-6]] = value
          return proxies
***************
*** 1119,1125 ****
              del fp
              if '\r' in data:
                  table = string.maketrans("", "")
!                 data = string.translate(data, table, "\r")
              print data
              fn, h = None, None
          print '-'*40
--- 1119,1125 ----
              del fp
              if '\r' in data:
                  table = string.maketrans("", "")
!                 data = data.translate(table, "\r")
              print data
              fn, h = None, None
          print '-'*40
Index: Lib/urllib2.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/urllib2.py,v
retrieving revision 1.3
diff -c -r1.3 urllib2.py
*** urllib2.py	2000/02/10 17:17:14	1.3
--- urllib2.py	2000/04/11 11:56:54
***************
*** 85,91 ****
  # gopher can return a socket.error
  # check digest against correct (i.e. non-apache) implementation
  
- import string
  import socket
  import UserDict
  import httplib
--- 85,90 ----
***************
*** 262,274 ****
                      self.handle_open[protocol] = [handler]
                  added = 1
                  continue
!             i = string.find(meth, '_')
!             j = string.find(meth[i+1:], '_') + i + 1
              if j != -1 and meth[i+1:j] == 'error':
                  proto = meth[:i]
                  kind = meth[j+1:]
                  try:
!                     kind = string.atoi(kind)
                  except ValueError:
                      pass
                  dict = self.handle_error.get(proto, {})
--- 261,273 ----
                      self.handle_open[protocol] = [handler]
                  added = 1
                  continue
!             i = meth.find('_')
!             j = meth[i+1:].find('_') + i + 1
              if j != -1 and meth[i+1:j] == 'error':
                  proto = meth[:i]
                  kind = meth[j+1:]
                  try:
!                     kind = int(kind)
                  except ValueError:
                      pass
                  dict = self.handle_error.get(proto, {})
***************
*** 593,599 ****
              mo = HTTPBasicAuthHandler.rx.match(authreq)
              if mo:
                  scheme, realm = mo.groups()
!                 if string.lower(scheme) == 'basic':
                      return self.retry_http_basic_auth(req, realm)
  
      def retry_http_basic_auth(self, req, realm):
--- 592,598 ----
              mo = HTTPBasicAuthHandler.rx.match(authreq)
              if mo:
                  scheme, realm = mo.groups()
!                 if scheme.lower() == 'basic':
                      return self.retry_http_basic_auth(req, realm)
  
      def retry_http_basic_auth(self, req, realm):
***************
*** 607,613 ****
          user,pw = self.passwd.find_user_password(realm, host)
          if pw:
              raw = "%s:%s" % (user, pw)
!             auth = string.strip(base64.encodestring(raw))
              req.add_header('Authorization', 'Basic %s' % auth)
              resp = self.parent.open(req)
              self.__current_realm = None
--- 606,612 ----
          user,pw = self.passwd.find_user_password(realm, host)
          if pw:
              raw = "%s:%s" % (user, pw)
!             auth = base64.encodestring(raw).strip()
              req.add_header('Authorization', 'Basic %s' % auth)
              resp = self.parent.open(req)
              self.__current_realm = None
***************
*** 632,643 ****
          # XXX could be mult. headers
          authreq = headers.get('www-authenticate', None)
          if authreq:
!             kind = string.split(authreq)[0]
              if kind == 'Digest':
                  return self.retry_http_digest_auth(req, authreq)
  
      def retry_http_digest_auth(self, req, auth):
!         token, challenge = string.split(auth, ' ', 1)
          chal = parse_keqv_list(parse_http_list(challenge))
          auth = self.get_authorization(req, chal)
          if auth:
--- 631,642 ----
          # XXX could be mult. headers
          authreq = headers.get('www-authenticate', None)
          if authreq:
!             kind = authreq.split()[0]
              if kind == 'Digest':
                  return self.retry_http_digest_auth(req, authreq)
  
      def retry_http_digest_auth(self, req, auth):
!         token, challenge = auth.split(' ', 1)
          chal = parse_keqv_list(parse_http_list(challenge))
          auth = self.get_authorization(req, chal)
          if auth:
***************
*** 717,723 ****
          hexrep.append(hex(n)[-1])
          n = ord(c) & 0xf
          hexrep.append(hex(n)[-1])
!     return string.join(hexrep, '')
          
          
  class HTTPHandler(BaseHandler):
--- 716,722 ----
          hexrep.append(hex(n)[-1])
          n = ord(c) & 0xf
          hexrep.append(hex(n)[-1])
!     return ''.join(hexrep)
          
          
  class HTTPHandler(BaseHandler):
***************
*** 768,774 ****
      """Parse list of key=value strings where keys are not duplicated."""
      parsed = {}
      for elt in l:
!         k, v = string.split(elt, '=', 1)
          if v[0] == '"' and v[-1] == '"':
              v = v[1:-1]
          parsed[k] = v
--- 767,773 ----
      """Parse list of key=value strings where keys are not duplicated."""
      parsed = {}
      for elt in l:
!         k, v = elt.split('=', 1)
          if v[0] == '"' and v[-1] == '"':
              v = v[1:-1]
          parsed[k] = v
***************
*** 790,797 ****
      start = 0
      while i < end:
          cur = s[i:]
!         c = string.find(cur, ',')
!         q = string.find(cur, '"')
          if c == -1:
              list.append(s[start:])
              break
--- 789,796 ----
      start = 0
      while i < end:
          cur = s[i:]
!         c = cur.find(',')
!         q = cur.find('"')
          if c == -1:
              list.append(s[start:])
              break
***************
*** 818,824 ****
              else:
                  inquote = 1
                  i = i + q + 1
!     return map(string.strip, list)
  
  class FileHandler(BaseHandler):
      # Use local file or FTP depending on form of URL
--- 817,823 ----
              else:
                  inquote = 1
                  i = i + q + 1
!     return map(lambda s: s.strip(), list)
  
  class FileHandler(BaseHandler):
      # Use local file or FTP depending on form of URL
***************
*** 865,871 ****
              port = ftplib.FTP_PORT
          path, attrs = splitattr(req.get_selector())
          path = unquote(path)
!         dirs = string.splitfields(path, '/')
          dirs, file = dirs[:-1], dirs[-1]
          if dirs and not dirs[0]:
              dirs = dirs[1:]
--- 864,870 ----
              port = ftplib.FTP_PORT
          path, attrs = splitattr(req.get_selector())
          path = unquote(path)
!         dirs = path.split('/')
          dirs, file = dirs[:-1], dirs[-1]
          if dirs and not dirs[0]:
              dirs = dirs[1:]
***************
*** 875,883 ****
              type = file and 'I' or 'D'
              for attr in attrs:
                  attr, value = splitattr(attr)
!                 if string.lower(attr) == 'type' and \
                     value in ('a', 'A', 'i', 'I', 'd', 'D'):
!                     type = string.upper(value)
              fp, retrlen = fw.retrfile(file, type)
              if retrlen is not None and retrlen >= 0:
                  sf = StringIO('Content-Length: %d\n' % retrlen)
--- 874,882 ----
              type = file and 'I' or 'D'
              for attr in attrs:
                  attr, value = splitattr(attr)
!                 if attr.lower() == 'type' and \
                     value in ('a', 'A', 'i', 'I', 'd', 'D'):
!                     type = value.upper()
              fp, retrlen = fw.retrfile(file, type)
              if retrlen is not None and retrlen >= 0:
                  sf = StringIO('Content-Length: %d\n' % retrlen)
Index: Lib/urlparse.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/urlparse.py,v
retrieving revision 1.23
diff -c -r1.23 urlparse.py
*** urlparse.py	2000/04/10 17:02:46	1.23
--- urlparse.py	2000/04/11 11:56:54
***************
*** 6,12 ****
  
  # Standard/builtin Python modules
  import string
- from string import join, split, rfind
  
  # A classification of schemes ('' means apply by default)
  uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'wais', 'file',
--- 6,11 ----
***************
*** 54,82 ****
  		return cached
  	if len(_parse_cache) >= MAX_CACHE_SIZE:	# avoid runaway growth
  		clear_cache()
- 	find = string.find
  	netloc = path = params = query = fragment = ''
! 	i = find(url, ':')
  	if i > 0:
  		if url[:i] == 'http': # optimize the common case
! 			scheme = string.lower(url[:i])
  			url = url[i+1:]
  			if url[:2] == '//':
! 				i = find(url, '/', 2)
  				if i < 0:
  					i = len(url)
  				netloc = url[2:i]
  				url = url[i:]
  			if allow_fragments:
! 				i = string.rfind(url, '#')
  				if i >= 0:
  					fragment = url[i+1:]
  					url = url[:i]
! 			i = find(url, '?')
  			if i >= 0:
  				query = url[i+1:]
  				url = url[:i]
! 			i = find(url, ';')
  			if i >= 0:
  				params = url[i+1:]
  				url = url[:i]
--- 53,80 ----
  		return cached
  	if len(_parse_cache) >= MAX_CACHE_SIZE:	# avoid runaway growth
  		clear_cache()
  	netloc = path = params = query = fragment = ''
! 	i = url.find(':')
  	if i > 0:
  		if url[:i] == 'http': # optimize the common case
! 			scheme = url[:i].lower()
  			url = url[i+1:]
  			if url[:2] == '//':
! 				i = url.find('/', 2)
  				if i < 0:
  					i = len(url)
  				netloc = url[2:i]
  				url = url[i:]
  			if allow_fragments:
! 				i = url.rfind('#')
  				if i >= 0:
  					fragment = url[i+1:]
  					url = url[:i]
! 			i = url.find('?')
  			if i >= 0:
  				query = url[i+1:]
  				url = url[:i]
! 			i = url.find(';')
  			if i >= 0:
  				params = url[i+1:]
  				url = url[:i]
***************
*** 87,109 ****
  			if c not in scheme_chars:
  				break
  		else:
! 			scheme, url = string.lower(url[:i]), url[i+1:]
  	if scheme in uses_netloc:
  		if url[:2] == '//':
! 			i = find(url, '/', 2)
  			if i < 0:
  				i = len(url)
  			netloc, url = url[2:i], url[i:]
  	if allow_fragments and scheme in uses_fragment:
! 		i = string.rfind(url, '#')
  		if i >= 0:
  			url, fragment = url[:i], url[i+1:]
  	if scheme in uses_query:
! 		i = find(url, '?')
  		if i >= 0:
  			url, query = url[:i], url[i+1:]
  	if scheme in uses_params:
! 		i = find(url, ';')
  		if i >= 0:
  			url, params = url[:i], url[i+1:]
  	tuple = scheme, netloc, url, params, query, fragment
--- 85,107 ----
  			if c not in scheme_chars:
  				break
  		else:
! 			scheme, url = url[:i].lower(), url[i+1:]
  	if scheme in uses_netloc:
  		if url[:2] == '//':
! 			i = url.find('/', 2)
  			if i < 0:
  				i = len(url)
  			netloc, url = url[2:i], url[i:]
  	if allow_fragments and scheme in uses_fragment:
! 		i = url.rfind('#')
  		if i >= 0:
  			url, fragment = url[:i], url[i+1:]
  	if scheme in uses_query:
! 		i = url.find('?')
  		if i >= 0:
  			url, query = url[:i], url[i+1:]
  	if scheme in uses_params:
! 		i = url.find(';')
  		if i >= 0:
  			url, params = url[:i], url[i+1:]
  	tuple = scheme, netloc, url, params, query, fragment
***************
*** 151,157 ****
  	if not path:
  		return urlunparse((scheme, netloc, bpath,
  				   params, query or bquery, fragment))
! 	segments = split(bpath, '/')[:-1] + split(path, '/')
  	# XXX The stuff below is bogus in various ways...
  	if segments[-1] == '.':
  		segments[-1] = ''
--- 149,155 ----
  	if not path:
  		return urlunparse((scheme, netloc, bpath,
  				   params, query or bquery, fragment))
! 	segments = bpath.split('/')[:-1] + path.split('/')
  	# XXX The stuff below is bogus in various ways...
  	if segments[-1] == '.':
  		segments[-1] = ''
***************
*** 171,177 ****
  		segments[-1] = ''
  	elif len(segments) >= 2 and segments[-1] == '..':
  		segments[-2:] = ['']
! 	return urlunparse((scheme, netloc, join(segments, '/'),
  			   params, query, fragment))
  
  def urldefrag(url):
--- 169,175 ----
  		segments[-1] = ''
  	elif len(segments) >= 2 and segments[-1] == '..':
  		segments[-2:] = ['']
! 	return urlunparse((scheme, netloc, '/'.join(segments),
  			   params, query, fragment))
  
  def urldefrag(url):
***************
*** 236,242 ****
  	while 1:
  		line = fp.readline()
  		if not line: break
! 		words = string.split(line)
  		if not words:
  			continue
  		url = words[0]
--- 234,240 ----
  	while 1:
  		line = fp.readline()
  		if not line: break
! 		words = line.split()
  		if not words:
  			continue
  		url = words[0]
Index: Lib/uu.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/uu.py,v
retrieving revision 1.11
diff -c -r1.11 uu.py
*** uu.py	2000/02/04 15:28:42	1.11
--- uu.py	2000/04/11 11:56:54
***************
*** 32,38 ****
  
  import binascii
  import os
- import string
  import sys
  
  Error = 'uu.Error'
--- 32,37 ----
***************
*** 96,112 ****
              raise Error, 'No valid begin line found in input file'
          if hdr[:5] != 'begin':
              continue
!         hdrfields = string.split(hdr)
          if len(hdrfields) == 3 and hdrfields[0] == 'begin':
              try:
!                 string.atoi(hdrfields[1], 8)
                  break
              except ValueError:
                  pass
      if out_file == None:
          out_file = hdrfields[2]
      if mode == None:
!         mode = string.atoi(hdrfields[1], 8)
      #
      # Open the output file
      #
--- 95,111 ----
              raise Error, 'No valid begin line found in input file'
          if hdr[:5] != 'begin':
              continue
!         hdrfields = hdr.split()
          if len(hdrfields) == 3 and hdrfields[0] == 'begin':
              try:
!                 int(hdrfields[1], 8)
                  break
              except ValueError:
                  pass
      if out_file == None:
          out_file = hdrfields[2]
      if mode == None:
!         mode = int(hdrfields[1], 8)
      #
      # Open the output file
      #
Index: Lib/xmllib.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/xmllib.py,v
retrieving revision 1.17
diff -c -r1.17 xmllib.py
*** xmllib.py	2000/02/04 15:39:30	1.17
--- xmllib.py	2000/04/11 11:56:55
***************
*** 190,198 ****
              post = data[i:]
              if str[0] == '#':
                  if str[1] == 'x':
!                     str = chr(string.atoi(str[2:], 16))
                  else:
!                     str = chr(string.atoi(str[1:]))
                  data = pre + str + post
                  i = res.start(0)+len(str)
              elif all:
--- 190,198 ----
              post = data[i:]
              if str[0] == '#':
                  if str[1] == 'x':
!                     str = chr(int(str[2:], 16))
                  else:
!                     str = chr(int(str[1:]))
                  data = pre + str + post
                  i = res.start(0)+len(str)
              elif all:
***************
*** 221,227 ****
              if self.nomoretags:
                  data = rawdata[i:n]
                  self.handle_data(data)
!                 self.lineno = self.lineno + string.count(data, '\n')
                  i = n
                  break
              res = interesting.search(rawdata, i)
--- 221,227 ----
              if self.nomoretags:
                  data = rawdata[i:n]
                  self.handle_data(data)
!                 self.lineno = self.lineno + data.count('\n')
                  i = n
                  break
              res = interesting.search(rawdata, i)
***************
*** 239,245 ****
                  if not self.__accept_utf8 and illegal.search(data):
                      self.syntax_error('illegal character in content')
                  self.handle_data(data)
!                 self.lineno = self.lineno + string.count(data, '\n')
              i = j
              if i == n: break
              if rawdata[i] == '<':
--- 239,245 ----
                  if not self.__accept_utf8 and illegal.search(data):
                      self.syntax_error('illegal character in content')
                  self.handle_data(data)
!                 self.lineno = self.lineno + data.count('\n')
              i = j
              if i == n: break
              if rawdata[i] == '<':
***************
*** 247,283 ****
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + string.count(data, '\n')
                          i = i+1
                          continue
                      k = self.parse_starttag(i)
                      if k < 0: break
                      self.__seen_starttag = 1
!                     self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
                      i = k
                      continue
                  if endtagopen.match(rawdata, i):
                      k = self.parse_endtag(i)
                      if k < 0: break
!                     self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
                      i =  k
                      continue
                  if commentopen.match(rawdata, i):
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + string.count(data, '\n')
                          i = i+1
                          continue
                      k = self.parse_comment(i)
                      if k < 0: break
!                     self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
                      i = k
                      continue
                  if cdataopen.match(rawdata, i):
                      k = self.parse_cdata(i)
                      if k < 0: break
!                     self.lineno = self.lineno + string.count(rawdata[i:i], '\n')
                      i = k
                      continue
                  res = xmldecl.match(rawdata, i)
--- 247,283 ----
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + data.count('\n')
                          i = i+1
                          continue
                      k = self.parse_starttag(i)
                      if k < 0: break
                      self.__seen_starttag = 1
!                     self.lineno = self.lineno + rawdata[i:k].count('\n')
                      i = k
                      continue
                  if endtagopen.match(rawdata, i):
                      k = self.parse_endtag(i)
                      if k < 0: break
!                     self.lineno = self.lineno + rawdata[i:k].count('\n')
                      i =  k
                      continue
                  if commentopen.match(rawdata, i):
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + data.count('\n')
                          i = i+1
                          continue
                      k = self.parse_comment(i)
                      if k < 0: break
!                     self.lineno = self.lineno + rawdata[i:k].count('\n')
                      i = k
                      continue
                  if cdataopen.match(rawdata, i):
                      k = self.parse_cdata(i)
                      if k < 0: break
!                     self.lineno = self.lineno + rawdata[i:i].count('\n')
                      i = k
                      continue
                  res = xmldecl.match(rawdata, i)
***************
*** 298,304 ****
                  if res:
                      k = self.parse_proc(i)
                      if k < 0: break
!                     self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
                      i = k
                      continue
                  res = doctype.match(rawdata, i)
--- 298,304 ----
                  if res:
                      k = self.parse_proc(i)
                      if k < 0: break
!                     self.lineno = self.lineno + rawdata[i:k].count('\n')
                      i = k
                      continue
                  res = doctype.match(rawdata, i)
***************
*** 306,312 ****
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + string.count(data, '\n')
                          i = i+1
                          continue
                      if self.__seen_doctype:
--- 306,312 ----
                      if self.literal:
                          data = rawdata[i]
                          self.handle_data(data)
!                         self.lineno = self.lineno + data.count('\n')
                          i = i+1
                          continue
                      if self.__seen_doctype:
***************
*** 317,324 ****
                      if k < 0: break
                      self.__seen_doctype = res.group('name')
                      if self.__map_case:
!                         self.__seen_doctype = string.lower(self.__seen_doctype)
!                     self.lineno = self.lineno + string.count(rawdata[i:k], '\n')
                      i = k
                      continue
              elif rawdata[i] == '&':
--- 317,324 ----
                      if k < 0: break
                      self.__seen_doctype = res.group('name')
                      if self.__map_case:
!                         self.__seen_doctype = self.__seen_doctype.lower()
!                     self.lineno = self.lineno + rawdata[i:k].count('\n')
                      i = k
                      continue
              elif rawdata[i] == '&':
***************
*** 336,342 ****
                      if not self.stack:
                          self.syntax_error('data not in content')
                      self.handle_charref(res.group('char')[:-1])
!                     self.lineno = self.lineno + string.count(res.group(0), '\n')
                      continue
                  res = entityref.match(rawdata, i)
                  if res is not None:
--- 336,342 ----
                      if not self.stack:
                          self.syntax_error('data not in content')
                      self.handle_charref(res.group('char')[:-1])
!                     self.lineno = self.lineno + res.group(0).count('\n')
                      continue
                  res = entityref.match(rawdata, i)
                  if res is not None:
***************
*** 346,359 ****
                          i = i-1
                      name = res.group('name')
                      if self.__map_case:
!                         name = string.lower(name)
                      if self.entitydefs.has_key(name):
                          self.rawdata = rawdata = rawdata[:res.start(0)] + self.entitydefs[name] + rawdata[i:]
                          n = len(rawdata)
                          i = res.start(0)
                      else:
                          self.unknown_entityref(name)
!                     self.lineno = self.lineno + string.count(res.group(0), '\n')
                      continue
              elif rawdata[i] == ']':
                  if self.literal:
--- 346,359 ----
                          i = i-1
                      name = res.group('name')
                      if self.__map_case:
!                         name = name.lower()
                      if self.entitydefs.has_key(name):
                          self.rawdata = rawdata = rawdata[:res.start(0)] + self.entitydefs[name] + rawdata[i:]
                          n = len(rawdata)
                          i = res.start(0)
                      else:
                          self.unknown_entityref(name)
!                     self.lineno = self.lineno + res.group(0).count('\n')
                      continue
              elif rawdata[i] == ']':
                  if self.literal:
***************
*** 382,388 ****
              if not self.__accept_utf8 and illegal.search(data):
                  self.syntax_error('illegal character in content')
              self.handle_data(data)
!             self.lineno = self.lineno + string.count(data, '\n')
              self.rawdata = rawdata[i+1:]
              return self.goahead(end)
          self.rawdata = rawdata[i:]
--- 382,388 ----
              if not self.__accept_utf8 and illegal.search(data):
                  self.syntax_error('illegal character in content')
              self.handle_data(data)
!             self.lineno = self.lineno + data.count('\n')
              self.rawdata = rawdata[i+1:]
              return self.goahead(end)
          self.rawdata = rawdata[i:]
***************
*** 418,428 ****
          n = len(rawdata)
          name = res.group('name')
          if self.__map_case:
!             name = string.lower(name)
          pubid, syslit = res.group('pubid', 'syslit')
          if pubid is not None:
              pubid = pubid[1:-1]         # remove quotes
!             pubid = string.join(string.split(pubid)) # normalize
          if syslit is not None: syslit = syslit[1:-1] # remove quotes
          j = k = res.end(0)
          if k >= n:
--- 418,428 ----
          n = len(rawdata)
          name = res.group('name')
          if self.__map_case:
!             name = name.lower()
          pubid, syslit = res.group('pubid', 'syslit')
          if pubid is not None:
              pubid = pubid[1:-1]         # remove quotes
!             pubid = ' '.join(pubid.split()) # normalize
          if syslit is not None: syslit = syslit[1:-1] # remove quotes
          j = k = res.end(0)
          if k >= n:
***************
*** 492,498 ****
          k = res.end(0)
          name = res.group(0)
          if self.__map_case:
!             name = string.lower(name)
          if name == 'xml:namespace':
              self.syntax_error('old-fashioned namespace declaration')
              self.__use_namespaces = -1
--- 492,498 ----
          k = res.end(0)
          name = res.group(0)
          if self.__map_case:
!             name = name.lower()
          if name == 'xml:namespace':
              self.syntax_error('old-fashioned namespace declaration')
              self.__use_namespaces = -1
***************
*** 517,523 ****
                  self.syntax_error('xml:namespace prefix not unique')
              self.__namespaces[prefix] = attrdict['ns']
          else:
!             if string.lower(name) == 'xml':
                  self.syntax_error('illegal processing instruction target name')
              self.handle_proc(name, rawdata[k:j])
          return end.end(0)
--- 517,523 ----
                  self.syntax_error('xml:namespace prefix not unique')
              self.__namespaces[prefix] = attrdict['ns']
          else:
!             if name.lower() == 'xml':
                  self.syntax_error('illegal processing instruction target name')
              self.handle_proc(name, rawdata[k:j])
          return end.end(0)
***************
*** 533,539 ****
                  break
              attrname, attrvalue = res.group('name', 'value')
              if self.__map_case:
!                 attrname = string.lower(attrname)
              i = res.end(0)
              if attrvalue is None:
                  self.syntax_error("no value specified for attribute `%s'" % attrname)
--- 533,539 ----
                  break
              attrname, attrvalue = res.group('name', 'value')
              if self.__map_case:
!                 attrname = attrname.lower()
              i = res.end(0)
              if attrvalue is None:
                  self.syntax_error("no value specified for attribute `%s'" % attrname)
***************
*** 555,561 ****
                  self.syntax_error("`<' illegal in attribute value")
              if attrdict.has_key(attrname):
                  self.syntax_error("attribute `%s' specified twice" % attrname)
!             attrvalue = string.translate(attrvalue, attrtrans)
              attrdict[attrname] = self.translate_references(attrvalue)
          return attrdict, namespace, i
  
--- 555,561 ----
                  self.syntax_error("`<' illegal in attribute value")
              if attrdict.has_key(attrname):
                  self.syntax_error("attribute `%s' specified twice" % attrname)
!             attrvalue = attrvalue.translate(attrtrans)
              attrdict[attrname] = self.translate_references(attrvalue)
          return attrdict, namespace, i
  
***************
*** 572,578 ****
              return end.end(0)
          nstag = tagname = tag.group('tagname')
          if self.__map_case:
!             nstag = tagname = string.lower(nstag)
          if not self.__seen_starttag and self.__seen_doctype and \
             tagname != self.__seen_doctype:
              self.syntax_error('starttag does not match DOCTYPE')
--- 572,578 ----
              return end.end(0)
          nstag = tagname = tag.group('tagname')
          if self.__map_case:
!             nstag = tagname = nstag.lower()
          if not self.__seen_starttag and self.__seen_doctype and \
             tagname != self.__seen_doctype:
              self.syntax_error('starttag does not match DOCTYPE')
***************
*** 608,614 ****
                  if res is not None:
                      aprefix, key = res.group('prefix', 'local')
                      if self.__map_case:
!                         key = string.lower(key)
                      if aprefix is None:
                          aprefix = ''
                      ans = None
--- 608,614 ----
                  if res is not None:
                      aprefix, key = res.group('prefix', 'local')
                      if self.__map_case:
!                         key = key.lower()
                      if aprefix is None:
                          aprefix = ''
                      ans = None
***************
*** 657,663 ****
          else:
              tag = res.group(0)
              if self.__map_case:
!                 tag = string.lower(tag)
              if self.literal:
                  if not self.stack or tag != self.stack[-1][0]:
                      self.handle_data(rawdata[i])
--- 657,663 ----
          else:
              tag = res.group(0)
              if self.__map_case:
!                 tag = tag.lower()
              if self.literal:
                  if not self.stack or tag != self.stack[-1][0]:
                      self.handle_data(rawdata[i])
***************
*** 730,739 ****
      def handle_charref(self, name):
          try:
              if name[0] == 'x':
!                 n = string.atoi(name[1:], 16)
              else:
!                 n = string.atoi(name)
!         except string.atoi_error:
              self.unknown_charref(name)
              return
          if not 0 <= n <= 255:
--- 730,739 ----
      def handle_charref(self, name):
          try:
              if name[0] == 'x':
!                 n = int(name[1:], 16)
              else:
!                 n = int(name)
!         except ValueError:
              self.unknown_charref(name)
              return
          if not 0 <= n <= 255: