* 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.
Walter Dörwald [Thu, 21 Apr 2005 21:53:43 +0000 (21:53 +0000)]
Backport checkin (and the appropriate fix to the test):
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.
Walter Dörwald [Thu, 14 Apr 2005 20:23:39 +0000 (20:23 +0000)]
Backport relevant part of checkin:
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
Backport my recent raw_input() vs no threads build vs SIGINT argh:
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:56:28 +0000 (21:56 +0000)]
Backport checkin:
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 ensures that we
get the correct number of lines (i.e. this "\n" will not be treated as
another line ending).
Bob Ippolito [Thu, 31 Mar 2005 17:38:00 +0000 (17:38 +0000)]
(This is only relevant to the MacPython binary release process)
Set the Python version to 2.4 in the postflight script used when building
Mac OS X installer distributions. Previously it was set to 2.3, so it
wouldn't build a working installer.
Walter Dörwald [Thu, 31 Mar 2005 14:16:30 +0000 (14:16 +0000)]
Backport checkin:
Since PyPI only accepts UTF-8 encoded data now, make sure that the data is
properly encoded and include the encoding in the Content-Type header.
[ 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:34 +0000 (23:23 +0000)]
patch [1171767] - 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.
- Fixed decimal operator and comparison methods to return NotImplemented
instead of raising a TypeError when interacting with other types.
Allows other classes to successfully implement __radd__ style methods.
Greg Ward [Sat, 19 Mar 2005 16:28:37 +0000 (16:28 +0000)]
Beef up optparse reference docs -- now much closer to documenting the
full API of Optik 1.5a2 (which is what's included with Python 2.4.x).
Closes SF #1099324, partially addresses SF #993601.
Backport of patch #1159931/bug #1143895: inspect.getsource failed when
functions, etc., had comments after the colon, and some other cases.
This patch take a simpler approach that doesn't rely on looking for a
':'. Test cases are not backported, as test_inspect.py has been
rewritten using unittest on the trunk.
Tim Peters [Fri, 11 Mar 2005 17:20:43 +0000 (17:20 +0000)]
Bug #1160802: Can't build Zope on Windows w/ 2.4.1c1.
MSVCCompiler.initialize(): set self.initialized to True, as suggested
by AMK. Else we keep growing the PATH endlessly, with each new C
extension built, until putenv() complains.
This doesn't appear to be an issue on the HEAD (MSVCCompiler initializes
itself via __init__() on the HEAD).
Also added a "2.4.1c2" section to NEWS. Not meant to imply that Anthony
will do a 2.4.1c2 release, just needed to a place to put the news about the
MSVCCompiler bugfix.
Fred Drake [Thu, 10 Mar 2005 04:59:14 +0000 (04:59 +0000)]
- fix generated Texinfo markup for \deprecated
- add support for additional markup: \leq, \textbar, \textit
- add a comment about the non-support for the Euro character
Greg Ward [Mon, 7 Mar 2005 01:32:03 +0000 (01:32 +0000)]
SF #818006: add useful read-only attributes to oss_audio_device object:
'closed', 'name', and 'mode' (as recommended by
http://python.org/doc/current/lib/bltin-file-objects.html).
Fred Drake [Thu, 3 Mar 2005 17:24:20 +0000 (17:24 +0000)]
minor edits:
- function names marked with \function should include parentheses
- "standard error" instead of "stderr" for text
- a boolean parameter takes true or false values, not just True or False