Commit Graph

7838 Commits

Author SHA1 Message Date
Guido van Rossum 206b9a779a MyComplex now works. 2003-03-02 13:53:18 +00:00
Tim Peters fc27375d5a test_load_from_canned_string(): Created a DATA2 string to test a canned
proto 2 pickle too.
2003-03-02 04:54:24 +00:00
Tim Peters 6cca754c20 TestOnlySetsInBinaryOps: Simplified the non-inplace tests by using
assertRaises.  Fixed a repeated subtle bug in the inplace tests by
removing the possibilty that a self.fail() call could raise a
TypeError that the test catches by mistake.
2003-03-02 00:36:10 +00:00
Tim Peters b7bfe4bea4 Typo repairs in new code. 2003-03-02 00:31:23 +00:00
Tim Peters 44f14b0399 SF bug 693121: Set == non-Set is a TypeError.
Allow mixed-type __eq__ and __ne__ for Set objects.  This is messier than
I'd like because Set *also* implements __cmp__.  I know of one glitch now:
cmp(s, t) returns 0 now when s and t are both Sets and s == t, despite
that Set.__cmp__ unconditionally raises TypeError (and by intent).  The
rub is that __eq__ gets tried first, and the x.__eq__(y) True result
convinces Python that cmp(x, y) is 0 without even calling Set.__cmp__.
2003-03-02 00:19:49 +00:00
Tim Peters 3ba491e6b1 The doctest was printing Sets, but that's unreliable because set
elements get displayed in undefined dict order.  Use a Set subclass
instead (which arranges to sort the elements for display).
2003-03-01 23:33:34 +00:00
Neal Norwitz f421e81e41 Fix comment, mode really is used 2003-03-01 22:58:00 +00:00
Neal Norwitz 4f959d2c73 Fix SF patch #695581, "returnself" -> "return self" 2003-03-01 15:22:41 +00:00
Guido van Rossum d6473d1ac5 Reindent the new code properly. 2003-03-01 03:25:41 +00:00
Guido van Rossum 46d3dc37e4 - New function sys.exc_clear() clears the current exception. This is
rarely needed, but can sometimes be useful to release objects
  referenced by the traceback held in sys.exc_info()[2].  (SF patch
  #693195.)  Thanks to Kevin Jacobs!
2003-03-01 03:20:41 +00:00
Andrew M. Kuchling e557f3556f [Patch #695090 from Bernhard Herzog] Allow specifying both py_modules and packages 2003-02-28 22:03:04 +00:00
Neal Norwitz 6156a2d07c Handle iconv initialization erorrs 2003-02-28 20:00:42 +00:00
Neal Norwitz 55b61d21d8 Fix SF bugs #692951 and 692988, test_timeout.py needs 'network' resource
require -u network to run test_timeout since
it fails when not connected to a network.
2003-02-28 19:57:03 +00:00
Jack Jansen 98fc683719 Getting rid of macfs. 2003-02-27 23:18:46 +00:00
Jack Jansen abeb7d5f7f Added a deprecation warning. 2003-02-27 23:17:59 +00:00
Kurt B. Kaiser 86bc464414 M rpc.py
M run.py

Move exception formatting out of rpc.py.  This allows each end of the
link to format and print exceptions how and where it sees fit and makes it
easier for threads to display their own exceptions.
2003-02-27 23:04:17 +00:00
Jack Jansen fb3c811d9b Changing the window type to movable modal isn't enough to make the dialogs movable: apprently you also need to set a bit in the dlgx resource. Did this. 2003-02-27 22:36:20 +00:00
Skip Montanaro 19c6ba3664 * separate opcode definitions into opcode.py
* add disassemble_string
* allow classes and strings containing bytecode to be disassembled
2003-02-27 21:29:27 +00:00
Skip Montanaro 3249ccd06a new opcode module - extract opcode definitions from dis.py - eventually
should be generated automatically
2003-02-27 21:27:52 +00:00
Skip Montanaro add0ccc251 simple test case for dis module 2003-02-27 21:27:07 +00:00
Guido van Rossum 68468eba63 Get rid of many apply() calls. 2003-02-27 20:14:51 +00:00
Guido van Rossum f389c77273 Use floor division (// and __[r]floordiv__ in right-dispatch test. 2003-02-27 20:04:19 +00:00
Guido van Rossum f359410ce2 Use floor division (//). 2003-02-27 18:39:18 +00:00
Raymond Hettinger 05595e9d73 Module review:
* Changed variable name from 'list' to 'flist'.
* Replaced "while 1" with "while True".
* Replaced if/elif/elif/elif structure with a shorter and
  faster dispatch dictionary that maps attrs to methods.
* Simplified and sped comparison logic by using
  ifilter, ifilterfalse, and dict.fromkeys.
* Used True and False rather than 1 and 0.
2003-02-27 00:05:31 +00:00
Raymond Hettinger b2e0b92ef1 Module review:
* Replaced "while 1" with "while True"
* Rewrote read() and readline() for clarity and speed.
* Replaced variable 'list' with 'hlist'
* Used augmented assignment in two places.
2003-02-26 22:45:18 +00:00
Fred Drake 479d280218 The macfs, macostools, and plistlib should not be expected to run
beyond Mac OS and Darwin.  I'm not even sure they should be run on
Darwin, but I'll let someone more knowledgable on that tell us.
2003-02-26 19:51:23 +00:00
Andrew M. Kuchling 10da45e237 [Bug #668662] Patch from Pearu Pearson: if a C source file is
specified with an absolute path, the object file is also
    written to an absolute path.  The patch drops the drive and
    leading '/' from the source path, so a path like /path/to/foo.c
    results in an object file like build/temp.i686linux/path/to/foo.o.
2003-02-26 18:52:07 +00:00
Just van Rossum a006b8e468 use bare raise so you get the original tb 2003-02-26 15:28:17 +00:00
Walter Dörwald 37c4728c64 Port test_ucn and test_unicodedata to PyUnit. Add a few tests for error
cases increasing coverage in unicodedata.c from 87% to 95%
(when the normalization tests are run). From SF patch #662807.
2003-02-26 14:49:41 +00:00
Just van Rossum 0ff7a4e7c1 use the same Python for running the bootstrap script and the main program 2003-02-26 11:27:56 +00:00
Just van Rossum ddf5283ad1 remove sitecustomize hack, will be solved elsewhere 2003-02-26 11:07:59 +00:00
Jack Jansen ec396a11e0 Let's try making the dialogs at least Movable Modal. 2003-02-25 23:35:06 +00:00
Jack Jansen cba861e5e3 If a resource file cannot be decoded because the directory is readonly
create a temporary file. This fixes #688011.

Got rid of the install() method in macresource, and replaced it with
a resource_filename() method which will optionally decode a given resourcefile
(which may be applesingle-encoded) and return the real resourcefile.

Use this new method in buildtools to copy the correct resource file to
the bundle. This fixes #688007.
2003-02-25 23:02:03 +00:00
Jack Jansen ade626464d Reverted the rev. 1.8 change: the magic for decoding resourcefiles
is now in buildtools.
2003-02-25 22:58:33 +00:00
Just van Rossum 4983331385 tweak error message 2003-02-25 21:08:12 +00:00
Just van Rossum 7215e08846 - renamed the --copyfile option to --file.
- tweaked the help text a little.
(Jack: up to you to change your client code.)
2003-02-25 21:00:55 +00:00
Just van Rossum 8a3ed3f81e added some comments, minor tweaks 2003-02-25 20:53:12 +00:00
Just van Rossum 7322b1ad46 Resolving parts of #688907:
- Replaced bootstrap shell script with Python script. This means
  standalone apps built with bundlebuilder will not work on MacOS < 10.1,
  since we depend (again) on an installed Python.
- Add a hack to set sys.executable; the bootstrap script does os.execve()
  with an argv[0] that's different from the actual Python executable
  (it has to match the CFBundleExecutable entry in the Info.plist to make
  the app work both from the Finder and the command line, and it has to be
  the bootstrap script), yet a proper sys.executable is needed to spawn
  auxiliary processes.
2003-02-25 20:15:40 +00:00
Skip Montanaro 74b9a7a71f typo 2003-02-25 17:48:15 +00:00
Jack Jansen f4a9ac25e9 Workaround for bug #644243 (which is actually an Apple bug, I think): URLs
of the form file:/path/to/file don't work whereas file:///path/to/file
works fine. We convert the former to the latter.
2003-02-25 13:34:22 +00:00
Jack Jansen 838e76af2c Test suite for the plistlib module. 2003-02-25 12:58:58 +00:00
Jack Jansen 00cbf07ca7 Added a -c (--copyfile) option with argument src:dst which copies file src
into dst in the bundle. The Python API already had this functionality
2003-02-24 16:27:08 +00:00
Jack Jansen 0c44c0477b sys.executable can contain spaces, cater for this when passing it to
os.popen(). Fixes #692222.
2003-02-24 15:26:39 +00:00
Guido van Rossum 577fb5a1db Fix from SF patch #633359 by Greg Chapman for SF bug #610299:
The problem is in sre_compile.py: the call to
    _compile_charset near the end of _compile_info forgets to
    pass in the flags, so that the info charset is not compiled
    with re.U. (The info charset is used when searching to find
    the first character at which a match could start; it is not
    generated for patterns beginning with a repeat like '\w{1}'.)
2003-02-24 01:18:35 +00:00
Neal Norwitz 15ff0e9342 Get test to work on alpha 2003-02-23 23:15:26 +00:00
Neal Norwitz d5a65a77cf Fix SF bug #689659, 64-bit int and long hash keys incompatible
On a 64-bit machine, a dictionary could contain duplicate int/long keys
if the value was > 2**32.
2003-02-23 23:11:41 +00:00
Jack Jansen c2dd2f0966 Expect to skip test_iconv_codecs on MacOSX. 2003-02-23 22:56:58 +00:00
Neal Norwitz 71b13e8b4c Fix SF bug #690081, test_posix fails when run in non-interactive mode
Don't bother testing os.getlogin() if we aren't running from a tty (terminal)
It fails when run without a tty (e.g., when run from cron).
2003-02-23 22:12:24 +00:00
Neal Norwitz a4c93b68f1 Fix SF bug #691276, shutil.copytree documentation bug
Also use True/False instead of 1/0 for symlink flag.
2003-02-23 21:36:32 +00:00
Raymond Hettinger 61fe64d5de User requested changes to the itertools module.
Subsumed times() into repeat().
Added cycle() and chain().
2003-02-23 04:40:07 +00:00
Jack Jansen d9bb1a0b01 Getting rid of macfs. 2003-02-21 23:18:48 +00:00
Jack Jansen 8cb1ff5e8b Get rid of macfs. 2003-02-21 23:14:30 +00:00
Jack Jansen 5bb97e66dc Checking mac-specific stuff from the 2.3a2 branch in on the trunk. 2003-02-21 22:33:55 +00:00
Jack Jansen 4c641d0ce1 getpid doesn't exist on MacOS9. 2003-02-21 22:29:45 +00:00
Guido van Rossum be53242f49 Remove _reduce_2, it's now implemented in C. 2003-02-21 22:20:31 +00:00
Tim Peters 7107a7fbcc SF bug 690622: test_cpickle overflows stack on MacOS9.
test_nonrecursive_deep():  Reduced nesting depth to 60.

Not a bugfix candidate.  2.3 increased the number of stack frames
needed to pickle a list (in order to get implement the "list
batching" unpickling memory optimization new in 2.3).
2003-02-21 20:14:35 +00:00
Tim Peters 14821c5914 Doubled TimeoutTestCase.fuzz, to slash the frequency of bogus failures
on the boxes I use.
2003-02-21 16:45:41 +00:00
Walter Dörwald 0fd583ce4d Port all string tests to PyUnit and share as much tests
between str, unicode, UserString and the string module
as possible. This increases code coverage in stringobject.c
from 83% to 86% and should help keep the string classes
in sync in the future. From SF patch #662807
2003-02-21 12:53:50 +00:00
Raymond Hettinger 785d0a37e5 SF bug #690083: test_random fails sometimes
time.sleep(1) sometimes delays for fractionally less than a second
resulting in too short of an interval for C's time.time() function
to create a distinct seed.
2003-02-21 01:41:36 +00:00
Guido van Rossum af16065918 announce(): use the level argument to control the log level. 2003-02-20 02:10:08 +00:00
Guido van Rossum a85dbeb61f set_verbosity(): do something reasonable for out-of-range verbosity
levels.  (Previously, -vvv would be the same as -q!)
2003-02-20 02:09:30 +00:00
Andrew M. Kuchling 80be59b275 Include download_url in the data POSTed to the catalog server 2003-02-19 14:27:21 +00:00
Andrew M. Kuchling 188d85f475 [Patch #683939] Add download_url field to metadata 2003-02-19 14:16:01 +00:00
Andrew M. Kuchling 23c98c5f47 [Patch #684398] Rename verbose argument to show-response; don't conditionalize the get_classifiers() call 2003-02-19 13:49:35 +00:00
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