Commit Graph

7774 Commits

Author SHA1 Message Date
Andrew MacIntyre 7970d20792 OS/2 has no concept of file ownership, like DOS & MS Windows version
prior to NT.  EMX has a number of Posix emulation routines, including
geteuid() but lacks chown(), so silently skip trying to actually set
a file ownership when extracting a file from a tar archive.
2003-02-19 12:51:34 +00:00
Tim Peters 3b5de4db92 Reverted whitespace normalization on this file. I should really change
this thing so it doesn't rely on being unnormalized.  (That's the
editorial "I", if anyone's listening <wink>.)
2003-02-19 02:44:12 +00:00
Tim Peters 8266af4f06 Removed debugging print in test_tarfile.
In the Windows installer, continued the endless battle to copy over files
with new one-shot extensions.
2003-02-19 02:41:44 +00:00
Tim Peters f2715e0764 Whitespace normalization. 2003-02-19 02:35:07 +00:00
Guido van Rossum f805cd2c1f Rename _better_reduce to _reduce_2, to make sure that any code that
was still referencing it will fail.  Also removed some debug cruft
from _reduce_ex.
2003-02-19 01:58:53 +00:00
Guido van Rossum 9c9cf41a01 Remove now unused _better_reduce. 2003-02-19 01:20:40 +00:00
Guido van Rossum e690883ccf Use __reduce_ex__ in copy.py. The test_*copy_cant() tests are simpler again. 2003-02-19 01:19:28 +00:00
Mark Hammond a43fd0c899 Fix bug 683658 - PyErr_Warn may cause import deadlock. 2003-02-19 00:33:33 +00:00
Jack Jansen 9f59d528c5 Enable argv emulation if required.
Fixed a bug for applets with their own plist files.
2003-02-18 23:30:27 +00:00
Jack Jansen a03adde31b Added an argv_emulation option (command line option: --argv or -a) which
creates the sys.argv emulation wrapper for droplets. Also updates
the plist, if needed, and the includedModules (but this last is untested).
2003-02-18 23:29:46 +00:00
Jack Jansen b135548d0d Argvemulator still used the old Alias API. Fixed. 2003-02-18 23:28:05 +00:00
Guido van Rossum 443ada47c3 Remove unused _better_reduce (which will disappear soon) and
_reconstructor (whose import here is a mystery to me).
2003-02-18 22:49:10 +00:00
Guido van Rossum 2a30b21f64 Three test cases for __reduce_ex__. This fails for cPickle, until Tim
checks in his changes to support this in cPickle.c.
2003-02-18 22:41:24 +00:00
Guido van Rossum c53f009f94 Introducing __reduce_ex__, which is called with a protocol number argument
if it exists in preference over __reduce__.  Now Tim can go implement this
in cPickle.c.
2003-02-18 22:05:12 +00:00
Andrew M. Kuchling e12dcd7ff4 Use python.org as the repository 2003-02-18 21:28:20 +00:00
Tim Peters e2052ab82a One doctest displaying a dict didn't sort it first. *Maybe* this fixes
the AIX problem with this test.
2003-02-18 16:54:41 +00:00
Neal Norwitz dcfdceb9a2 Fix SF bug #688424, 64-bit test problems 2003-02-18 15:45:44 +00:00
Neal Norwitz eb2a5ef36a Fix SF bug #688424, 64-bit test problems 2003-02-18 15:22:10 +00:00
Jeremy Hylton 4edaa0d516 Copy the trace module here from Tools/scripts.
There are some problems with this module, but the tool works for
simple tasks and no one else has volunteered a better code coverage
tool.  Should cleanup and document before the beta release.
2003-02-18 15:06:17 +00:00
Neal Norwitz 6fa635df7a SF patch #687683, Patches to logging (updates from Vinay)
Mostly rename WARN -> WARNING
Other misc tweaks
Update tests (not in original patch)
2003-02-18 14:20:07 +00:00
Jack Jansen d6a3f93070 Use "$@" to pass arguments to Python in stead of "${1}". This passes all
arguments, and also does the right thing for the no argument case.
2003-02-18 11:24:31 +00:00
Andrew M. Kuchling 679bc9fce5 [Patch #681504] Call customize_compiler in config command 2003-02-18 01:28:51 +00:00
Neal Norwitz 2ff51a87b3 Make changes suggested by Walter to use self.assert*() methods. 2003-02-17 22:40:31 +00:00
Neal Norwitz 3b8fb47fb0 Import test_support properly 2003-02-17 22:38:56 +00:00
Tim Peters 003eb30882 test_posix is an expected skip on Win32. Also fixed test_posix to
import from test.test_support instead of directly from test_support.
2003-02-17 21:48:48 +00:00
Kurt B. Kaiser 003091cd51 M NEWS.txt
M PyShell.py
M ScriptBinding.py
M rpc.py
M run.py

Clean up the way IDLEfork handles termination of the subprocess, restore
ability to interrupt user code in Windows (so long as it's doing terminal
I/O).

1. Handle subprocess interrupts in Windows with an RPC message.
2. Run/F5 will restart the subprocess even if user code is running.
3. Restart the subprocess if the link is dropped.
4. Exit IDLE cleanly even during I/O.
4. In rpc.py, remove explicit calls to statelock, let the condition
   variable handle acquire() and release().
2003-02-17 18:57:16 +00:00
Neal Norwitz e241ce830a Added test_posix (hopefully it works on Windows).
Remove PyArg_ParseTuple() for methods which take no args,
use METH_NOARGS instead
2003-02-17 18:17:05 +00:00
Neal Norwitz 5c1ba53f8c Use correct function name to PyArg_ParseTuple("is_package").
Fix off-by-1 error in normalize_line_endings():
  when *p == '\0' the NUL was copied into q and q was auto-incremented,
  the loop was broken out of,
  then a newline was appended followed by a NUL.
  So the function, in effect, was strcpy() but added two extra chars
  which was caught by obmalloc in debug mode, since there was only
  room for 1 additional newline.

Get test working under regrtest (added test_main).
2003-02-17 18:05:20 +00:00
Jack Jansen 946c19445c When installing resource files whose name ends in .rsrc use the
"copy anything to a data fork based resource file" trick of macresource.
Fixes #688007.
2003-02-17 16:47:12 +00:00
Neal Norwitz 996acf122d Actually run these tests from regrtest.py.
There was no test_main() and the main body was protected
by if __name__ == '__main__' so the test didn't happen
on import either.
2003-02-17 14:51:41 +00:00
Jack Jansen a460f446e9 - Added support for zip archives
- Better messages in case of a crash of the install-test script
2003-02-17 12:21:05 +00:00
Andrew MacIntyre 437966c2cc Tweak to Skip's checkin of patch 686397:
- 'os2' references in ntpath.py relate to the VACPP port, not the EMX port;
- the VACPP port uses the same defpath as all other ntpath.py supported
  platforms except 'ce'.
2003-02-17 09:17:50 +00:00
Jack Jansen a2125fe523 Better error messages and warnings. 2003-02-16 23:03:04 +00:00
Guido van Rossum 97dede0202 Fix for SF 686380, from SF patch 686771 by Ping. (errors trying to
get help on os attributes)
2003-02-16 01:12:32 +00:00
Tim Peters 080c88b912 cPickle.c, load_build(): Taught cPickle how to pick apart
the optional proto 2 slot state.

pickle.py, load_build():  CAUTION:  Noted that cPickle's
load_build and pickle's load_build really don't do the same
things with the state, and didn't before this patch either.
cPickle never tries to do .update(), and has no backoff if
instance.__dict__ can't be retrieved.  There are no tests
that can tell the difference, and part of what cPickle's
load_build() did looked accidental to me, so I don't know
what the true intent is here.

pickletester.py, test_pickle.py:  Got rid of the hack for
exempting cPickle from running some of the proto 2 tests.

dictobject.c, PyDict_Next():  documented intended use.
2003-02-15 03:01:11 +00:00
Tim Peters 71fcda5ba7 cPickle produces NEWOBJ appropriately now. It still doesn't know
how to unpickle the new slot-full state tuples.
2003-02-14 23:05:28 +00:00
Skip Montanaro 117910dc44 Migrate definitions of several platform-dependent path-related variables
into the relevant path modules.  See patch #686397.
2003-02-14 19:35:31 +00:00
Guido van Rossum 4507ec70cf - The audio driver tests (test_ossaudiodev.py and
test_linuxaudiodev.py) are no longer run by default.  This is
  because they don't always work, depending on your hardware and
  software.  To run these tests, you must use an invocation like
    ./python Lib/test/regrtest.py -u audio test_ossaudiodev
2003-02-14 19:29:22 +00:00
Jack Jansen 0dacac48b9 Factored out classes for handling source and binary distributions. Source
now means "distutils-based source", binary "bdist format archive". Also
fixed various lurking bugs.
2003-02-14 14:11:59 +00:00
Walter Dörwald bb2734ab65 Port test_charmapcodec to PyUnit. From SF patch #662807 2003-02-14 11:21:53 +00:00
Raymond Hettinger 2835e37be5 SF bug #663701: sets module review
Renamed hook methods to use the double underscore convention.
2003-02-14 03:42:11 +00:00
Andrew M. Kuchling a2ecabe420 Fix docstring typo 2003-02-14 01:14:15 +00:00
Andrew M. Kuchling c07fb2fc5b Fix comment typo 2003-02-14 01:13:01 +00:00
Raymond Hettinger 61436489f9 SF 685011: calendar module overflow handling
Restored a Py2.2 behavior to not range check the day of the month.
A user application was this exploiting undocumented, accidental "feature".
2003-02-13 22:58:02 +00:00
Guido van Rossum 4b499dd3fb - Finally fixed the bug in compile() and exec where a string ending
with an indented code block but no newline would raise SyntaxError.
  This would have been a four-line change in parsetok.c...  Except
  codeop.py depends on this behavior, so a compilation flag had to be
  invented that causes the tokenizer to revert to the old behavior;
  this required extra changes to 2 .h files, 2 .c files, and 2 .py
  files.  (Fixes SF bug #501622.)
2003-02-13 22:07:59 +00:00
Tim Peters 18e36f4576 Removed unused cut'n'paste import. 2003-02-13 19:37:19 +00:00
Tim Peters c0c9370985 We didn't have any tests making pickles with one of {pickle, cPickle},
and loading them via the other, except for the special cases of this
Guido added to test_datetime.py for datetime module objects.  The new
test_xpickle.py tries all of pickletester's AbstractPickleTests in
both x-module ways.
2003-02-13 19:30:57 +00:00
Tim Peters e9ef203ea6 Added a simple NEWOBJ test. This is in the pickle-only part of the
test for now (cPickle can't yet produce NEWOBJ).
2003-02-13 18:42:00 +00:00
Andrew M. Kuchling c1eea67d93 Remove filecmp 2003-02-13 18:36:22 +00:00
Walter Dörwald 7585229bbf Port test_userlist to PyUnit and add a few tests to increase code
coverage. From SF patch #662807
2003-02-13 18:07:43 +00:00
Guido van Rossum 298e421453 SF patch #685738 by Michael Stone.
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
2003-02-13 16:30:16 +00:00
Guido van Rossum 0c016a9590 Re-enable compiling ossaudiodev now that it seems to work again. 2003-02-13 16:12:21 +00:00
Tim Peters 8587b3c073 Added a HIGHEST_PROTOCOL module attribute to pickle and cPickle. 2003-02-13 15:44:41 +00:00
Neal Norwitz bb1844148a SF patch #682432, add lookbehind tests 2003-02-13 03:01:18 +00:00
Walter Dörwald 3ea7cc3cbe Fix typo. 2003-02-12 23:49:57 +00:00
Neal Norwitz 7cbd247af6 Add test to ensure files (fds) don't leak 2003-02-12 23:09:53 +00:00
Neal Norwitz 2294c0d4ec Cleanup from patch #683257:
Add missing INCREFs and re-indent returns to be consistent.
 Add \n\ for lines in docstring
 Add a pathetic test
 Add docs
2003-02-12 23:02:21 +00:00
Guido van Rossum 3288f592cb Expect test_ossaudiodev to skip on Linux, too. (It's broken.
Volunteers wanted to fix it!)
2003-02-12 20:40:08 +00:00
Guido van Rossum 9c00f42870 Systematic testing of hex/oct constants. 2003-02-12 17:09:17 +00:00
Guido van Rossum 66b1259dbc SF #660455 : patch by NNorwitz.
"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!
2003-02-12 16:57:47 +00:00
Jack Jansen e71b9f830b - Use distutils to find site-python (suggested by Thomas Heller, thanks!)
- Fixed a bug for packages without MD5 checksum.
2003-02-12 16:37:00 +00:00
Just van Rossum c96d6ce3c2 Thank you sir, can I have another. 2003-02-12 16:19:39 +00:00
Jack Jansen f59c6fa125 When in MacPython-OSX use bundlebuilder to create .app bundles. 2003-02-12 15:37:26 +00:00
Jack Jansen 53b341ff67 - Better way to find site-packages
- Catch stderr as well as stdout
- Fixed a bug with non-installable packages
- Parse .pth files after installing, so you don't have to restart Python (or
  the IDE) after installing.
2003-02-12 15:36:25 +00:00
Guido van Rossum a89d10edc9 Implement another useful feature for proxies: in super(X, x), x may
now be a proxy for an X instance, as long as issubclass(x.__class__, X).
2003-02-12 03:58:38 +00:00
Guido van Rossum 03bc7d3c4d SF #532767: isinstance(x, X) should work when x is a proxy for an X
instance, as long as x.__class__ is X or a subclass thereof.
Did a little cleanup of PyObject_IsInstance() too.
2003-02-12 03:32:58 +00:00
Tim Peters 42f08ac1e3 Implemented batching for dicts in cPickle. This is after two failed
attempts to merge the C list-batch and dict-batch code -- they worked, but
it was a godawful mess to read.
2003-02-11 22:43:24 +00:00
Jack Jansen e7b33db22d Changed database format to make fields adhere to PEP 241 where
applicable, and use a similar naming scheme for other fields. This
has drastically changed the structure, as the PEP241 names aren't
identifiers.
2003-02-11 22:40:59 +00:00
Tim Peters 1092d64002 Implemented list batching in cPickle. 2003-02-11 21:06:20 +00:00
Guido van Rossum b6e5a0c658 Put proper tests in classmethod_get(). Remove the type argument to
descr_check(); it wasn't useful.  Change the type argument of the
various _get() methods to PyObject * because the call signature of
tp_descr_get doesn't guarantee its type.
2003-02-11 18:44:42 +00:00
Tim Peters 8d2613adbe Added tests to ensure that list and dict "chunking" are actually
getting done.  Since this isn't yet implemented in cPickle, the
new tests are in TempAbstractPickleTests (which cPickle doesn't
run).
2003-02-11 16:40:16 +00:00
Guido van Rossum 3f50cdc05e Get rid of the "bozo" __getstate__ that was inserted when __slots__
was used.  This simplifies some logic in copy_reg.py (used by
pickling).  It also broke a test, but this was rewritten to test the
new feature. :-)
2003-02-10 21:31:27 +00:00
Just van Rossum ba20533d82 [ 683376 ] Adding NotImplementedType to types.py 2003-02-10 19:38:33 +00:00
Walter Dörwald 4f046e2e21 Add a few tests to test_count() to increase coverage in
Object/unicodeobject.c::unicode_count().
2003-02-10 17:51:03 +00:00
Walter Dörwald 74640247d4 Fix copy&paste error: call title instead of count 2003-02-10 17:44:16 +00:00
Walter Dörwald 8dd19321bb Change filtertuple() to use tp_as_sequence->sq_item
instead of PyTuple_GetItem, so an overwritten __getitem__
in a tuple subclass works. SF bug #665835.
2003-02-10 17:36:40 +00:00
Jack Jansen 8d326b8581 Punctuation fixes in docstrings. 2003-02-10 16:08:17 +00:00
Jack Jansen 6a600aba2d Added docstrings. 2003-02-10 15:55:51 +00:00
Jack Jansen 26bf3acf42 - Better exception when the database isn't found.
- Allow for "manual:" pseudo-scheme in downloadURL to signal that
  the download should be done manually.
2003-02-10 14:19:14 +00:00
Jack Jansen 4f82a513ca Pick up Makefile variable BASECFLAGS too. This is needed since OPT was
split into OPT and BASECFLAGS (Makefile.pre.in rev. 1.108), because
now there are essential CFLAGS in BASECFLAGS.
2003-02-10 14:02:33 +00:00
Jack Jansen c4b217dd18 Use MD5 checksums to check archive integrity and forestall downloads. 2003-02-10 13:38:44 +00:00
Walter Dörwald 1918f7755e Change filterstring() and filterunicode(): If the
object is not a real str or unicode but an instance
of a subclass, construct the output via looping
over __getitem__. This guarantees that the result
is the same for function==None and function==lambda x:x

This doesn't happen for tuples, because filtertuple()
uses PyTuple_GetItem().

(This was discussed on SF bug #665835).
2003-02-10 13:19:13 +00:00
Jack Jansen b4bb64e288 Added preInstall and postInstall commands to packages. PIL needs this
(preInstall, at least).
2003-02-10 13:08:04 +00:00
Just van Rossum 3aaf42c613 patch #683515: "Add unicode support to compile(), eval() and exec"
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
2003-02-10 08:21:10 +00:00
Neal Norwitz de8b94c3e1 Fix SF bug #683467, 'int' ability to generate longs not inherited
When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.
2003-02-10 02:12:43 +00:00
Neal Norwitz 9caf9c040e Add tests and news entry about parser errors from bug #678518. 2003-02-10 01:54:06 +00:00
Jack Jansen 95839b8af9 Strawman for a Package Install Manager for Python. It isn't CPAN yet, but at
less than 500 lines it already manages to test whether Numeric is installed,
and can install it if it isn't, including any prerequisites.
2003-02-09 23:10:20 +00:00
Just van Rossum f032f86e9e patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.
2003-02-09 20:38:48 +00:00
Guido van Rossum cf117b0b40 Rename 'proto' keyword arg to 'protocol' . Greg Ward's suggestion. 2003-02-09 17:19:41 +00:00
Raymond Hettinger 60eca9331a C Code:
* Removed the ifilter flag wart by splitting it into two simpler functions.
* Fixed comment tabbing in C code.
* Factored module start-up code into a loop.

Documentation:
* Re-wrote introduction.
* Addede examples for quantifiers.
* Simplified python equivalent for islice().
* Documented split of ifilter().

Sets.py:
* Replace old ifilter() usage with new.
2003-02-09 06:40:58 +00:00
Tim Peters 68124bb771 The Python implementation of datetime was changed in ways that no longer
tickle the 2.2.2 __cmp__ bug test_datetime used to tickle, so the
workarounds for that bug no longer make sense in the test suite (which I'm
still trying to keep as closely in synch as possible with Zope3's
version).
2003-02-08 03:46:31 +00:00
Barry Warsaw 9914227caa Fix compatibility for earlier versions of Python (than 2.3), which
doesn't have UserDict.DictMixin.
2003-02-08 03:18:58 +00:00
Tim Peters 07534a607b Comparison for timedelta, time, date and datetime objects: __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing.  If no meaningful way to compare is known, saying "not equal" is
sensible.  This allows things like

    if adatetime in some_sequence:
and
    somedict[adatetime] = whatever

to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.

It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().
2003-02-07 22:50:28 +00:00
Guido van Rossum 275666fd50 Merge the test part of the below checkin to the sandbox and Zope3, so
the tests will remain in sync:

"""
Tres discovered a weird bug when a datetime is pickled, caused by the
shadowing of __year, __month, __day and the use of proxies.

Here's a quick fix and a quick unit test.  I don't quite understand
why this wasn't caught by the pickling unit tests.
"""
2003-02-07 21:49:01 +00:00
Guido van Rossum cef9db6db5 Reserve a range for Zope, not specifically for Zope 3. 2003-02-07 20:56:38 +00:00
Neal Norwitz f98159c376 Fix SF bug #642168, help() fails for some builtin topics
Fix pydoc when doing help for:  and, or, not, UNICODE.

Will backport.
2003-02-07 20:49:40 +00:00
Guido van Rossum 1dca482dbd Somehow, copy() of a classic class object was handled
atomically, but deepcopy() didn't support this at all.
I don't see any reason for this, so I'm adding ClassType
to the set of types that are deep-copied atomically.
2003-02-07 17:53:23 +00:00
Guido van Rossum c06e3acc73 Add support for copy_reg.dispatch_table.
Rewrote copy() and deepcopy() without avoidable try/except statements;
getattr(x, name, None) or dict.get() are much faster than try/except.
2003-02-07 17:30:18 +00:00
Jack Jansen 2731c5cf46 Made AskFile* dialogs movable-modal by default, by providing a dummy
eventProc (which simply drops all events on the floor). Also added a
method SetDefaultEventProc through which frameworks can set a global
event handler (which can still be overridden on a per-call basis
with the eventProc argument).
2003-02-07 15:45:40 +00:00
Guido van Rossum f631859409 Add __getnewargs__ method to classes that need it.
(Yes, this is an incompatibility.  I'll document it in PEP 307.)
2003-02-07 14:59:13 +00:00