Document that on Unix, the 'cmd' argument to the os.popen2/3/4 and
popen2.popen2/3/4 functions can be a sequence. All texts are a variation on the
following:
On \UNIX, \var{cmd} may be a sequence, in which case arguments will be passed
directly to the program without shell intervention (as with
\function{os.spawnv()}). If \var{cmd} is a string it will be passed to the shell
(as with \function{os.system()}).
Anthony Baxter [Mon, 11 Oct 2004 13:53:08 +0000 (13:53 +0000)]
Added a usegmt flag to email.Utils.formatdate - this allows it to be
used to replace rfc822.formatdate for protocols like HTTP (where 'GMT' must
be the timezone string).
Tim Peters [Mon, 11 Oct 2004 02:40:51 +0000 (02:40 +0000)]
SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by Nick
Coghlan, for determining whether PyEval_InitThreads() has been called.
Also purged the undocumented+unused _PyThread_Started int.
Tim Peters [Sun, 10 Oct 2004 05:30:40 +0000 (05:30 +0000)]
Revert rev 2.35. It was based on erroneous reasoning -- the current
thread's id can't get duplicated, because (of course!) the current thread
is still running. The code should work either way, but reverting the
gratuitous change should make backporting easier, and gets the bad
reasoning out of 2.35's new comments.
Tim Peters [Sat, 9 Oct 2004 23:55:36 +0000 (23:55 +0000)]
PyGILState_Release(): If we need to delete the TLS entry for this thread,
that must be done under protection of the GIL, for reasons explained in
new comments.
Barry Warsaw [Sat, 9 Oct 2004 23:00:11 +0000 (23:00 +0000)]
Fix SF bug # 1030941. In _parsegen(), in the clause where we're
capturing_preamble but we found a StartBoundaryNotFoundDefect, we need to
consume all lines from the current position to the EOF, which we'll set as the
epilogue of the current message. If we're not at EOF when we return from
here, the outer message's capturing_preamble assertion will fail.
Tim Peters [Sat, 9 Oct 2004 22:47:13 +0000 (22:47 +0000)]
_PyGILState_Init(), PyGILState_Ensure(): Since PyThread_set_key_value()
can fail, check its return value, and die if it does fail.
_PyGILState_Init(): Assert that the thread doesn't already have an
association for autoTLSkey. If it does, PyThread_set_key_value() will
ignore the attempt to (re)set the association, which the code clearly
doesn't want.
Tim Peters [Sat, 9 Oct 2004 22:33:09 +0000 (22:33 +0000)]
Document the results of painful reverse-engineering of the "portable TLS"
code.
PyThread_set_key_value(): It's clear that this code assumes the passed-in
value isn't NULL, so document that it must not be, and assert that it
isn't. It remains unclear whether existing callers want the odd semantics
actually implemented by this function.
Barry Warsaw [Sat, 9 Oct 2004 21:08:30 +0000 (21:08 +0000)]
__init__(): Coerce the input_charset to unicode (with ascii encoding) before
calling .lower() on it. This fixes the problem described in SF patch # 866982
where in the tr_TR.ISO-8859-9 locale, 'I'.lower() isn't 'i'. unicodes are
locale insensitive.
The shutils.rmtree() implementation uses an excessive amount of memory when
deleting large directory hierarchies. Before actually deleting any files, it
builds up a list of (function, filename) tuples for all the files that it is
going to remove.
David Goodger [Sun, 3 Oct 2004 15:55:09 +0000 (15:55 +0000)]
SF bug #997050: Document, test, & check for non-string values in ConfigParser. Moved the new string-only restriction added in rev. 1.65 to the SafeConfigParser class, leaving existing ConfigParser & RawConfigParser behavior alone, and documented the conditions under which non-string values work.
David Goodger [Sun, 3 Oct 2004 15:40:25 +0000 (15:40 +0000)]
SF bug #1017864: ConfigParser now correctly handles default keys, processing them with ``ConfigParser.optionxform`` when supplied, consistent with the handling of config file entries and runtime-set options.
Barry Warsaw [Sun, 3 Oct 2004 03:16:19 +0000 (03:16 +0000)]
Big email 3.0 API changes, with updated unit tests and documentation.
Briefly (from the NEWS file):
- Updates for the email package:
+ All deprecated APIs that in email 2.x issued warnings have been removed:
_encoder argument to the MIMEText constructor, Message.add_payload(),
Utils.dump_address_pair(), Utils.decode(), Utils.encode()
+ New deprecations: Generator.__call__(), Message.get_type(),
Message.get_main_type(), Message.get_subtype(), the 'strict' argument to
the Parser constructor. These will be removed in email 3.1.
+ Support for Python earlier than 2.3 has been removed (see PEP 291).
+ All defect classes have been renamed to end in 'Defect'.
+ Some FeedParser fixes; also a MultipartInvariantViolationDefect will be
added to messages that claim to be multipart but really aren't.
+ Updates to documentation.
Armin Rigo [Sat, 2 Oct 2004 13:59:34 +0000 (13:59 +0000)]
Upon insertion, if memory runs out, the deque was left in a corrupted state.
deque_item(): a performance bug: the linked list of blocks was followed
from the left in most cases, because the test (i < (deque->len >> 1)) was
after "i %= BLOCKLEN".
deque_clear(): replaced a call to deque_len() with deque->len; not sure what
this call was here for, nor if all compilers under the sun would inline it.
deque_traverse(): I belive that it could be called by the GC when the deque
has leftblock==rightblock==NULL, because it is tracked before the first block
is allocated (though closely before). Still, a C extension module subclassing
deque could provide its own tp_alloc that could trigger a GC collection after
the PyObject_GC_Track()...
deque_richcompare(): rewrote to cleanly check for end-of-iterations instead of
relying on deque.__iter__().next() to succeed exactly len(deque) times -- an
assumption which can break if deques are subclassed. Added a test.
I wonder if the length should be explicitely bounded to INT_MAX, with
OverflowErrors, as in listobject.c. On 64-bit machines, adding more than
INT_MAX in the deque will result in trouble. (Note to anyone/me fixing
this: carefully check for overflows if len is close to INT_MAX in the
following functions: deque_rotate(), deque_item(), deque_ass_item())
Just van Rossum [Sat, 2 Oct 2004 08:40:47 +0000 (08:40 +0000)]
Which reminds me, I've had a much improved plistlib.py lying around for
ages. The main improvements are:
- a much more convenient API: readPlist() and writePlist()
- support non-dict top-level objects
* Elaborate on the invariant comments and make them more precise.
* Change the centering by one to make it possible to test the module
with BLOCKLEN's as low as two. Testing small blocks makes end-point
errors surface more readily.
Tim Peters [Fri, 1 Oct 2004 02:01:04 +0000 (02:01 +0000)]
deque_traverse(): If the deque had one block, and its rightindex was
BLOCKLEN-1, this assert-failed in a debug build, or went wild with a
NULL pointer in a release build. Reported on c.l.py by Stefan Behnel.
Expand scope to include general mapping protocol tests.
Many of these tests are redundant, but this will ensure
that the mapping protocols all stay in sync.
Also, added a test for dictionary subclasses.
Improve error message for augmented assignments to genexps or listcomps.
Rather than introduce new logic, took the approach of making the message
itself more general.
Tim Peters [Tue, 28 Sep 2004 16:12:50 +0000 (16:12 +0000)]
A number of list examples used 66.6, but I doubt there's any box on which
repr(66.6) == "66.6", so doubt that the claimed output has ever been seen.
Changed it to 66.25 everywhere, and manually verified that the new claimed
output is correct.
Edward Loper [Tue, 28 Sep 2004 05:50:57 +0000 (05:50 +0000)]
Reverted the addition of a NORMALIZE_NUMBERS option, per Tim Peter's
request. Tim says that "correct 'fuzzy' comparison of floats cannot
be automated." (The motivation behind adding the new option
was verifying interactive examples in Python's latex documentation;
several such examples use numbers that don't print consistently on
different platforms.)