Skip Montanaro [Thu, 12 May 2005 13:42:42 +0000 (13:42 +0000)]
Incorporate a lightly edited version of the SocketServer module's docstring
into the docs and segregate the method descriptions for the various classes
into separate sections. Base on suggestion by Paul Rubin in c.l.py.
* Fixed incorrect wording: expression->exception
* Noted the specific exception reported by "raise" when the is nothing
to re-raise.
* Eliminated several instances of "e.g." as recommended in the style guide.
Make subclasses of int, long, complex, float, and unicode perform type
conversion using the proper magic slot (e.g., __int__()). Also move conversion
code out of PyNumber_*() functions in the C API into the nb_* function.
Martin v. Löwis [Mon, 25 Apr 2005 07:14:03 +0000 (07:14 +0000)]
Make parse_makefile fallback to environment variables if nothing is
defined in the makefile. Get CFLAGS from the Makefile, instead of
getting OPT, BASE_CFLAGS and EXTRA_CFLAGS individually.
Walter Dörwald [Thu, 21 Apr 2005 21:32:03 +0000 (21:32 +0000)]
If the data read from the bytestream in readline() ends in a '\r' read one more
byte, even if the user has passed a size parameter. This extra byte shouldn't
cause a buffer overflow in the tokenizer. The original plan was to return a line
ending in '\r', which might be recognizable as a complete line and skip any '\n'
that was read afterwards. Unfortunately this didn't work, as the tokenizer only
recognizes '\n' as line ends, which in turn lead to joined lines and
SyntaxErrors, so this special treatment of a split '\r\n' has been dropped. (It
can only happen with a temporarily exhausted bytestream now anyway.)
Fixes parts of SF bugs #1163244 and #1175396.
Barry Warsaw [Tue, 19 Apr 2005 23:43:40 +0000 (23:43 +0000)]
As per discussion on python-dev, descriptors defined in C with a NULL setter
now raise AttributeError instead of TypeError, for consistency with their
pure-Python equivalent.
Fix building of spwd; was incorrectly checking for the needed HAVE_* values to
properly build the module.
Also moved up the creation of config_h_vars (from
distutils.sysconfig.parse_config_h()) higher on up in detect_modules() so that
it can be used sooner).
Walter Dörwald [Thu, 14 Apr 2005 20:08:59 +0000 (20:08 +0000)]
SF patch #1180062 by George Yoshida:
Doc/lib/libfunctional.tex: "in an new object" should read "in a new object"
Doc/lib/libsubprocess.tex: argument name is wrong; comma is missing.
test_site often failed under "regrtest.py -r", because this xmlrpc test
left sys with a setdefaultencoding attribute, but loading site.py removes
that attribute and test_site.py verifies the attribute is gone. Changed
this test to get rid of sys.setdefaultencoding if it didn't exist when
this test started.
Don't know whether this is a bugfix (backport) candidate.
In a threads-disabled build, typing Ctrl-C into a raw_input() crashed,
because (essentially) I didn't realise that PY_BEGIN/END_ALLOW_THREADS
actually expanded to nothing under a no-threads build, so if you somehow
NULLed out the threadstate (e.g. by calling PyThread_SaveThread) it would
stay NULLed when you return to Python. Argh!
Walter Dörwald [Mon, 4 Apr 2005 21:38:47 +0000 (21:38 +0000)]
Fix for SF bug #1175396: readline() will now read one more character, if
the last character read is "\r" (and size is None, i.e. we're allowed to
call read() multiple times), so that we can return the correct line ending
(this additional character might be a "\n").
If the stream is temporarily exhausted, we might return the wrong line ending
(if the last character read is "\r" and the next one (after the byte stream
provides more data) is "\n", but at least the atcr member ensure that we
get the correct number of lines (i.e. this "\n" will not be treated as
another line ending.)
Make a handy macro, Py_DEFAULT_RECURSION_LIMIT to allow to define
a default value of recursion limit from build systems. 1000 levels
are still too high for some 64bit systems.
I suppose a bug report or even a fix would be a better response, but
commit a yelp about a noted flaw the error messages for METH_KEYWORDS
functions under some circumstances.
[ 1166660 ] The readline module can cause python to segfault
It seems to me that the code I'm rewriting here attempted to call any
user-supplied hook functions using the thread state of the thread that
called the hook-setting function, as opposed to that of the thread
that is currently executing. This doesn't work, in general.
Fix this by using the PyGILState API (It wouldn't be that hard to
define a dummy version of said API when #ifndef WITH_THREAD, would
it?).
Also, check the conversion to integer of the return value of a hook
function for errors (this problem was mentioned in the ipython bug
report linked to in the above bug).
Bob Ippolito [Mon, 28 Mar 2005 23:23:47 +0000 (23:23 +0000)]
patch [1171735] - Darwin 8's headers disable functionality when
POSIX is enabled. This prevents the toolbox glue, all of Carbon,
and various other non-POSIX features from compiling. The POSIX
symbols are still used by default, so turning off the #define
doesn't hurt.
Additionally, linker flags have changed for Darwin 8, and are
different for Darwin 8/gcc4 (default) and Darwin 8/gcc3.3.
Greg Ward [Mon, 28 Mar 2005 02:34:59 +0000 (02:34 +0000)]
SF #1169212: merge from 2.4 branch: fix silly typo in explaining AFMT
macros: U16 is unsigned and S16 is signed. Duh. Clarify surrounding
text a bit and refer to OSS docs.
* Fix decimal's handling of foreign types. Now returns NotImplemented
instead of raising a TypeError. Allows other types to successfully
implement __radd__() style methods.
* Remove future division import from test suite.
* Remove test suite's shadowing of __builtin__.dir().