Patches for Python 1.5.1

Here's a file containing the combined set of patches: patches.all. Some caveats:

  • Some web browsers save this file with CRLF line endings on a Unix system; this will make the patch fail. Remove the CR characters with a plain text editor or other tool.
  • With patch version 2.4 or 2.5 (and maybe other versions), you must set the environment variable POSIXLY_CORRECT to TRUE. Otherwise patch won't look at the "Index:" lines and it will ask for the filename for each patch.

To report new bugs, see "If You Find A Bug" in the parent page.

Individual Patches and Descriptions

  • There's an "import addpack" statement in Tools/freeze/freeze.py that shouldn't be there. Patch file: freeze.1.txt. (20-Apr-98)
  • The _tkinter module does not compile with Tcl 7.6 or earlier. Patch file: _tkinter.1.txt. (20-Apr-98)
  • The configure script sets CCSHARED to a bogus value for the SGI C compiler on IRIX 6.x. Patch file: configure.1.txt. (20-Apr-98; patch redone 24-Apr-98)
  • Printing an object whose repr() returns a string with a null byte in it drops the characters after the null byte. Patch file: object.1.txt. (21-Apr-98)
  • On AIX, the compiler warns about some missing casts in some method tables in the parser module. Patch file: parsermodule.1.txt. (21-Apr-98)
  • The zlib module doesn't pass the selftest (import test.test_zlib) when linked with zlib 1.1.2. Patch file: zlibmodule.1.txt. (22-Apr-98)
  • The string module exports a variable 're' with value None, and it shouldn't (though "from string import *" is still a bad habit!). Patch file: string.1.txt. (23-Apr-98)
  • Not a bug, but a cute one-line hack that speeds up range() by about 35 percent. Patch file: bltinmodule.1.txt. (23-Apr-98)
  • A call to mktime() inserted in the time module has bad effects when formatting non-local times. Patch file: timemodule.1.txt. (27-Apr-98)
  • On some platforms (HP-UX), a failing ftell() call in read() breaks reading from a pipe or socket. The improved patch adds a work-around for a bug in ftell() on Linux. Patch file: fileobject.1.txt. (27-Apr-98; improved patch 5-May-98)
  • In urllib.urlopen(), some malformed URLs (http: with no host) raise an unexpected TypeError instead of the intended IOError. Patch file: urllib.1.txt. (27-Apr-98)
  • A patch to the pcre module, with an important bugfix. This revised version of the patch does not support (?X) and (?U). Patch file: pcre.1.txt. (1-May-98; revised 7-May-98)
  • Some systems really require the standard math library (-lm). I have a patch for the configure script and related files. Note that this removes the check for -lsun, an old IRIX 4.x feature. Patch file: configure.2.txt. (1-May-98)
  • The imaplib module's login() method requires that the sever publishes the AUTH-LOGIN or AUTH=LOGIN capability, but some servers don't publish this even though they do support LOGIN. Patch file: imaplib.1.txt. (4-May-98)
  • The proxy code in the urllib module is broken. Patch file: urllib.2.txt. (5-May-98)
  • Note that the fileobject.c patch above was improved. (5-May-98)
  • The sgmllib module (and hence also htmllib) doesn't always parse whitespace correctly, especially it barfs on '\r'. Patch file: sgmllib.1.txt. (6-May-98)
  • Note that the pcre patch patch above was improved. (7-May-98)
  • Embarrassingly, int(round(1450, -3)) yields 999. Patch file: bltinmodule.2.txt. (9-May-98)
  • Deleting an undefined local variable inside a function doesn't raise NameError like it should. Patch file: ceval.1.txt. (12-May-98)
  • The gzip module's readline() doesn't work quite right. Patch file: gzip.1.txt. (13-May-98)
  • More small problems in the imaplib module need fixing: one to do with argument quoting, and the other to do with caching of un-tagged responses. Patch file: imaplib.2.txt. (18-May-98)
  • A curious problem exists in import: "import sys.time" succeeds. Patch file: import.1.txt. (19-May-98)
  • More minor problems with the imaplib module are fixed. Patch file: imaplib.3.txt. (29-May-98)
  • The string % operator can cause a core dump when %s is used for an object for which str() has a return type other than string. (This is possible though not recommended. :-) Patch file: stringobject.1.txt. (9-Jun-98)
  • Improved handling of entity references (they can contain '.' and '-') and support for handling processing instructions. Note: this patch patches the previous patch to sgmllib.py. Patch file: sgmllib.2.txt. (9-Jun-98)
  • There's a memory leak for classes that define any of the special methods __getattr__(), __setattr__() or __delattr__(). Patch file: classobject.1.txt. (23-Jul-98)
  • The UDP code in SocketServer.py never worked. Patch file: SocketServer.1.txt. (24-Jul-98)
  • Several bugs make the string-to-number conversions for ints and long ints return 0 for invalid input like "+" or +-". This affects int(), long(), string.atoi(), and string.atol(). (The patch for longobject.c also solves a problem with overlow checking.) Patch files: bltinmodule.3.txt, longobject.1.txt, stropmodule.1.txt. (25-Jul-98)