Neal Norwitz [Tue, 31 Dec 2002 00:06:24 +0000 (00:06 +0000)]
Fix SF #639945, 64-bit bug on AIX
I can't test this on the snake farm (no aix box is working).
This change works for the submitter seems correct.
Can anybody test this on 32- and 64- bit AIX?
Fred Drake [Mon, 30 Dec 2002 23:32:50 +0000 (23:32 +0000)]
- prefer "import ... as" to "import / (assignments) / del" for most things
- when the thread module isn't available, subsequent attempts to import
threading should not suceed
Guido van Rossum [Mon, 30 Dec 2002 22:36:09 +0000 (22:36 +0000)]
Use the dummy_thread module in Queue.py and tempfile.py.
tempfile.py already contained code to let it run without threads present;
for Queue.py this is considered a useful feature too.
Neal Norwitz [Mon, 30 Dec 2002 22:29:22 +0000 (22:29 +0000)]
SF #561244, Micro optimizations
Initialize the small integers and __builtins__ in startup.
This removes some if conditions.
Change XDECREF to DECREF for values which shouldn't be NULL.
Jack Jansen [Mon, 30 Dec 2002 22:23:40 +0000 (22:23 +0000)]
Adapted for the move of Mac/Lib to Lib/plat-mac. Makefile.pre.in now
knows about plat-mac subdirectories, and configure adds a variable
EXTRAPLATDIR. These together take care of copying Lib/plat-mac to
the destination on darwin.
Adding plat-mac is still done with a .pth file which is only created when
you do a framework build. I'm not 100% happy with this, but fixing it
really needs a functional pythonw in non-framework builds, and I don't
think I can do that before 2.3a1 (but I'll try:-).
Just van Rossum [Mon, 30 Dec 2002 22:08:05 +0000 (22:08 +0000)]
PEP 302 + zipimport:
- new import hooks in import.c, exposed in the sys module
- new module called 'zipimport'
- various changes to allow bootstrapping from zip files
I hope I didn't break the Windows build (or anything else for that
matter), but then again, it's been sitting on sf long enough...
Regarding the latest discussions on python-dev: zipimport sets
pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as
/path/to/Archive.zip/subdir/ are supported again.
Jack Jansen [Mon, 30 Dec 2002 22:04:23 +0000 (22:04 +0000)]
Moved most of Mac/Lib hierarchy to Lib/plat-mac: it can be used both
in MacPython-OS9 and MacPython-OSX (or the equivalent unix Python on
Mac OS X). The only items remaining in Mac/Lib are modules that are
meaningful only for MacPython-OS9 (CFM stuff, MacPython preferences
in resources, etc).
Tim Peters [Mon, 30 Dec 2002 21:28:52 +0000 (21:28 +0000)]
Bite the bullet on all the indirect timetz and datetimetz tzinfo methods:
make the callers figure out the right tzinfo arguments to pass, instead of
making the callees guess. The code is uglier this way, but it's less
brittle (when the callee guesses, the caller can get surprised).
Tim Peters [Mon, 30 Dec 2002 20:52:32 +0000 (20:52 +0000)]
A step on the way to making tzinfo classes writable by mortals: get rid
of the timetz case. A tzinfo method will always see a datetimetz arg,
or None, now. In the former case, it's still possible that it will get
a datetimetz argument belonging to a different timezone. That will get
fixed next.
Neil Schemenauer [Mon, 30 Dec 2002 20:18:15 +0000 (20:18 +0000)]
Always try nb_* slots before trying sq_concat, sq_inplace_concat, sq_repeat,
andsq_inplace_repeat. This fixes a number of corner case bugs (see #624807).
Consolidate the int and long sequence repeat code. Before the change, integers
checked for integer overflow but longs did not.
Barry Warsaw [Mon, 30 Dec 2002 19:13:00 +0000 (19:13 +0000)]
Header.__init__(), .append(): Add an optional argument `errors' which
is passed straight through to the unicode() and ustr.encode() calls.
I think it's the best we can do to address the UnicodeErrors in badly
encoded headers such as is described in SF bug #648119.
Barry Warsaw [Mon, 30 Dec 2002 17:45:02 +0000 (17:45 +0000)]
TestMIMEAudio.setUp(): Use the email package's copy of the audio test
file, needed because some binary distros (read RPMs) don't include the
test module in their standard Python package. This eliminates an
external dependency and closes SF bug # 650441.
Barry Warsaw [Mon, 30 Dec 2002 17:44:27 +0000 (17:44 +0000)]
A copy of the audio test file from Lib/test, needed because some
binary distros (read RPMs) don't include the test module in their
standard Python package. This eliminates an external dependency and
closes SF bug # 650441.
Tim Peters [Mon, 30 Dec 2002 17:37:30 +0000 (17:37 +0000)]
Added tests that conversion to our own timezone is always an identity,
and that conversion to "timezone" None is the same as stripping the
tzinfo member.
Tim Peters [Mon, 30 Dec 2002 17:09:40 +0000 (17:09 +0000)]
Beefed up the timezone conversion test by adding a phony UTC zone that's
west of the US zones getting converted, and also by using Eastern "as if"
it were UTC (wrt Pacific), and vice versa.
Guido van Rossum [Mon, 30 Dec 2002 16:25:41 +0000 (16:25 +0000)]
Patch 659834 by Magnus Lie Hetland:
Check for readline 2.2 features. This should make it possible to
compile readline.c again with GNU readline versions 2.0 or 2.1; this
ability was removed in readline.c rev. 2.49. Apparently the older
versions are still in widespread deployment on older Solaris
installations. With an older readline, completion behavior is subtly
different (a space is always added).
Restore the test of the random module after including "Random" in the
ignore tuple.
The line, "from _random import Random as CoreGenerator", fools the test
code which expects CoreGenerator.__name__ to be "CoreGenerator" instead
of "Random".
This test depends on the exact ordering produced by the WichmannHill
random number generator. Altered it a bit to use the old generator
and restore the test.
Tim Peters [Sun, 29 Dec 2002 23:46:40 +0000 (23:46 +0000)]
Taught the Windows build about _randommodule.c. This is compiled
into the core DLL, since it's not much code and lots of stuff uses
it (e.g., try getting a tempfile name without it).
Tim Peters [Sun, 29 Dec 2002 23:44:49 +0000 (23:44 +0000)]
A start at non-trivial (== DST-aware) tests of timezone conversion.
Guido has in mind an easier way for users to code this stuff, but the
only tests we have now are for fixed-offset tzinfo classes, and this
stuff is extremely delicate in the endcases (read the new test code
for why: there are holes in time <wink>).
Kurt B. Kaiser [Sun, 29 Dec 2002 22:03:38 +0000 (22:03 +0000)]
M EditorWindow.py
M PyShell.py
1. PyShell Rev 1.39, EditorWindow Rev 1.37 fix was not handling a
multiline prompt.
2. The same fix introduced a bug where hitting <enter> at a previous
prompt-only line would copy the prompt to the iomark.
3. Move the setting of sys.ps1 earlier, into PyShell.main(), to allow
this code to work before a shell is started up.
4. If cursor is on the input line in the prompt, and you hit <enter>,
process the line instead of complaining.
5. If line has no stdin range (this includes the last line before shell
restart) strip any prompt before recalling.
Incorporate Skip's suggestion to use SciPy's validation test near
equality. Note, there is another flavor that compares to a given
number of significant digits rather than decimal places. If there
is a demand, that could be added at a later date.
SF patch #659536: Use PyArg_UnpackTuple where possible.
Obtain cleaner coding and a system wide
performance boost by using the fast, pre-parsed
PyArg_Unpack function instead of PyArg_ParseTuple
function which is driven by a format string.