lots of markup fixes and some English nits fixed.
Still needs real review. Some of the function signatures used in this
module are really bad! (Two leading optional parameters? Ugh!)
We occasionally received reports from people getting "invalid tstate"
crashes (this is a fatal error in PyThreadState_Delete()). Finally
several people were able to reproduce it reliably and Tim Peters
discovered that there is a race condition when multiple threads are
calling this function without holding the global interpreter lock (the
function may be called without holding that).
Solved the race condition by adding a lock around the mutating uses of
interp->tstate_head. Tim and Jonathan Giddy have run tests that make
it likely that this fixes the crashes -- although Tim hasn't heard
from the person who reported the original problem.
always lowercasing the option name, call a method optionxform() which
can be overridden. Also make the regexps SECTRE and OPTRE non-private
variables so they can also be overridden.
mode attribute of the file object (if it has one), otherwise
use 'rb'.
The documentation should still show this as required until
there's a new release.
ExtensionClasses in isinstance() and issubclass().
- abstract instance and class protocols are used *only* in those
cases that would generate errors before the patch. That is, there's
no penalty for the normal case.
- instance protocol: an object smells like an instance if it
has a __class__ attribute that smells like a class.
- class protocol: an object smells like a class if it has a
__bases__ attribute that is a tuple with elements that
smell like classes (although not all elements may actually get
sniffed ;).
Added support for unseekable files.
(I use unqualified excepts since we don't know why the seek/tell might
fail. In my case it was because of an AttributeError.)
Problem: rfc822.py in 1.5.2 final loses the quotes around
quoted local-part names.
The fix is to preserve the quotes around a local-part
name in an address.
Test:
import rfc822
a = rfc822.AddrlistClass('(Comment stuff) "Quoted
name"@somewhere.com')
a.getaddrlist()
The correct result is:
[('Comment stuff', '"Quoted name"@somewhere.com')]
- Don't call Py_FatalError() when initialization fails.
- Fix bogus use of return value from PyRun_String().
- Fix misc. compiler errors on some platforms.