Commit Graph

1717 Commits

Author SHA1 Message Date
Guido van Rossum a48cb8f77d Fix from SF patch 565085: copy._reduction doesn't __setstate__.
Straightforward fix.  Will backport to 2.2.  If there's ever a new 2.1
release, this could be backported there too (since it's an issue with
anything that's got both a __reduce__ and a __setstate__).
2002-06-06 17:53:03 +00:00
Raymond Hettinger 478d47a168 Close SF bug 563740. complex() now finds __complex__() in new style classes.
Made conversion failure error messages consistent between types.
Added related unittests.
2002-06-06 15:45:38 +00:00
Martin v. Löwis 446a25fa3c Patch 473512: add GNU style scanning as gnu_getopt. 2002-06-06 10:58:36 +00:00
Martin v. Löwis cdbc131f03 Patch #551911: Escape . properly. 2002-06-06 09:52:49 +00:00
Raymond Hettinger c4c453f5ae Skip Montanaro's patch, SF 559833, exposing xrange type in builtins.
Also, added more regression tests to cover the new type and test its
conformity with range().
2002-06-05 23:12:45 +00:00
Guido van Rossum d842e07470 SF bug 558179.
Change default for get() back to None.
Will backport to 2.2.1.
2002-06-05 19:07:39 +00:00
Guido van Rossum 9923ffe2c0 Address SF bug 519621: slots weren't traversed by GC.
While I was at it, I added a tp_clear handler and changed the
tp_dealloc handler to use the clear_slots helper for the tp_clear
handler.

Also tightened the rules for slot names: they must now be proper
identifiers (ignoring the dirty little fact that <ctype.h> is locale
sensitive).

Also set mp->flags = READONLY for the __weakref__ pseudo-slot.

Most of this is a 2.2 bugfix candidate; I'll apply it there myself.
2002-06-04 19:52:53 +00:00
Guido van Rossum 1bdd9b033a Test repair now that module.__init__ requires a name and initializes
__name__ and __doc__.
2002-06-04 06:10:37 +00:00
Guido van Rossum bdabeccfb8 Repair the test (adding a docstring to the module type changed the
docstring for an uninitialized module object).
2002-06-04 06:06:54 +00:00
Guido van Rossum c3a787e090 Surprising fix for SF bug 563060: module can be used as base class.
Change the module constructor (module_init) to have the signature
__init__(name:str, doc=None); this prevents the call from type_new()
to succeed.  While we're at it, prevent repeated calling of
module_init for the same module from leaking the dict, changing the
semantics so that __dict__ is only initialized if NULL.

Also adding a unittest, test_module.py.

This is an incompatibility with 2.2, if anybody was instantiating the
module class before, their argument list was probably empty; so this
can't be backported to 2.2.x.
2002-06-04 05:52:47 +00:00
Guido van Rossum 155a34d2e5 The warning filter was ineffective when this module was invoked as a
script.
2002-06-03 19:45:32 +00:00
Tim Peters c5000dfc40 regrtest has a new
-f/--fromfile <filename>
option.  This runs all and only the tests named in the file, in the
order given (although -x may weed that list, and -r may shuffle it).
Lines starting with '#' are ignored.

This goes a long way toward helping to automate the binary-search-like
procedure I keep reinventing by hand when a test fails due to interaction
among tests (no failure in isolation, and some unknown number of
predecessor tests need to run first -- now you can stick all the test
names in a file, and comment/uncomment blocks of lines until finding a
minimal set of predecessors).
2002-06-02 21:42:01 +00:00
Barry Warsaw 2c68506604 Generator.__call__() => Generator.flatten()
Also, adjust to the new message/rfc822 tree layout.
2002-06-02 19:09:27 +00:00
Raymond Hettinger 14bd6de0ec SF 560736. Optimize list iteration by filling the tp_iter slot. 2002-05-31 21:40:38 +00:00
Jeremy Hylton 05ab2e693c Fix SF bug [ 561825 ] Confusing error for "del f()"
In the error message, say del for del and assign for everything else.
2002-05-31 14:08:29 +00:00
Jeremy Hylton 40b7703f1c Verify that the imp can find and load .py files. 2002-05-30 17:10:20 +00:00
Michael W. Hudson 34f20eac98 This is patch
[ 559250 ] more POSIX signal stuff

Adds support (and docs and tests and autoconfery) for posix signal
mask handling -- sigpending, sigprocmask and sigsuspend.
2002-05-27 15:08:24 +00:00
Guido van Rossum 9fc8a29663 Fix for SF bug 551412. When _PyType_Lookup() is called on a type
whose tp_mro hasn't been initialized, it would dump core.  Fix this by
checking for NULL and calling PyType_Ready().  Will fix this in 2.2.1
too.
2002-05-24 21:40:08 +00:00
Tim Peters 8ac1495a6a Whitespace normalization. 2002-05-23 15:15:30 +00:00
Barry Warsaw f655328483 parseaddr(): Fixed in the same way that Message.getaddrlist() was
fixed (re: SF bug #555035).  Include a unittest.
2002-05-23 03:21:01 +00:00
Skip Montanaro 12424bc0ef force gzip module to open files using 'b'inary mode.
closes patch #536278.
2002-05-23 01:43:05 +00:00
Neal Norwitz d4e5be5340 Closes: #556025 seg fault when doing list(xrange(1e9))
A MemoryError is now raised when the list cannot be created.
There is a test, but as the comment says, it really only
works for 32 bit systems.  I don't know how to improve
the test for other systems (ie, 64 bit or systems
where the data size != addressable size,
e.g. 64 bit data, but 48 bit addressable memory)
2002-05-22 23:19:17 +00:00
Barry Warsaw 4be9eccbc4 getaddresses(): Like the change in rfc822.py, this one needs to access
the AddressList.addresslist attribute directly.

Also, add a test case for the email.Utils.getaddresses() interface.
2002-05-22 01:52:10 +00:00
Barry Warsaw 0a8d4d5736 Message.getaddrlist(): Use the AddressList.addresslist attribute
instead of calling the getaddrlist() method, since the latter doesn't
work with multiple calls (it will return the empty list for the second
and subsequent calls).

Closes SF bug #555035.  Include a unittest.
2002-05-21 19:46:13 +00:00
Michael W. Hudson 7b7ba54033 Guess what? --disable-unicode proofing.
This is a strange test.
2002-05-20 14:54:17 +00:00
Michael W. Hudson f207277167 More --disable-unicode stuff.
I'm getting better at vi!
2002-05-20 14:48:16 +00:00
Michael W. Hudson 9c373061ad tolerate --disable-unicode... 2002-05-20 14:24:53 +00:00
Michael W. Hudson 7c6a4ad78f More mindless --disable-unicode proofing. 2002-05-20 14:22:28 +00:00
Michael W. Hudson 286225b548 easy --disable-unicode proofing. 2002-05-20 14:15:42 +00:00
Barry Warsaw 6d86f8302f A test message w/ CRLF line endings 2002-05-19 23:53:38 +00:00
Barry Warsaw e0d85c834a Add two new tests of recent email package fixes: CRLF line endings,
and explicit maxlinelen arguments to the Header constructor.
2002-05-19 23:52:54 +00:00
Raymond Hettinger 2ae87539aa Added Mitchell Surface's regression tests for base64. Closes patch #550002. 2002-05-18 00:25:10 +00:00
Michael W. Hudson 8bf46e4e7a This is patch
[ 555382 ] test_array v.s. --disable-unicode

+ MvL's suggestions.  Just the 32 failing tests in --disable-unicode builds
now...
2002-05-15 13:04:53 +00:00
Raymond Hettinger 2d2b51bf22 Added tests for new degree/radian conversions. 2002-05-14 08:51:33 +00:00
Guido van Rossum 4402241450 Jim Fulton reported a segfault in dir(). A heavily proxied object
returned a proxy for __class__ whose __bases__ was also a proxy.  The
merge_class_dict() helper for dir() assumed incorrectly that __bases__
would always be a tuple and used the in-line tuple API on the proxy.

I will backport this to 2.2 as well.
2002-05-13 18:29:46 +00:00
Guido van Rossum df4dabd5d2 SF 554663. Add OpenBSD3. Bugfix candidate if anyone cares. 2002-05-13 14:58:02 +00:00
Michael W. Hudson e1c67d1dc0 Make StringIO work in --disable-unicode builds... 2002-05-13 09:42:16 +00:00
Raymond Hettinger 64108afa60 Adds tests for degrees() and radians() functions added to mathmodule.
Closes patch 552452 and feature request 426539.
2002-05-13 03:55:01 +00:00
Tim Peters 39a86c2188 SF bug 555042: zip() may trigger MemoryError.
NOT a bugfix candidate:  this is a fix to an optimization introduced
in 2.3.
2002-05-12 07:19:38 +00:00
Tim Peters 46c04e140c random.gauss() uses a piece of hidden state used by nothing else,
and the .seed() and .whseed() methods failed to reset it.  In other
words, setting the seed didn't completely determine the sequence of
results produced by random.gauss().  It does now.  Programs repeatedly
mixing calls to a seed method with calls to gauss() may see different
results now.

Bugfix candidate (random.gauss() has always been broken in this way),
despite that it may change results.
2002-05-05 20:40:00 +00:00
Fred Drake e08fda912f Remove all tests that rely on deprecated-in-2.2 features of xrange objects.
"What's New in Python 2.2" documented that these would be removed in
Python 2.3.
2002-05-02 18:40:31 +00:00
Fred Drake e0e890a4da Added regression tests for xrange object attributes.
See SF bug #551285.
2002-05-02 16:07:44 +00:00
Fred Drake 485f340d52 Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.
2002-05-02 04:27:20 +00:00
Andrew MacIntyre e41abab33b Fred's recent changes to support "-u all" resulted in subset resource
selections (eg "-u network") being ignored.
2002-04-30 12:11:04 +00:00
Tim Peters 67d687a114 builtin_zip(): Take a good guess at how big the result list will be,
and allocate it in one gulp.

This isn't a bugfix, it's just a minor optimization that may or may not
pay off.
2002-04-29 21:27:32 +00:00
Guido van Rossum 7dab2426ca - New builtin function enumerate(x), from PEP 279. Example:
enumerate("abc") is an iterator returning (0,"a"), (1,"b"), (2,"c").
  The argument can be an arbitrary iterable object.
2002-04-26 19:40:56 +00:00
Neil Schemenauer 3b04d635a2 Add more tests for abstract isinstance() and issubclass(). 2002-04-24 03:33:02 +00:00
Tim Peters 1e33ffa5c7 test_resource has no chance of running on Windows. 2002-04-23 23:09:02 +00:00
Tim Peters e12cda9840 test_mmap started breaking on Windows, only when run after test_bsddb.
On Win2K it thought 'foo' started at byte offset 0 instead of at the
pagesize, and on Win98 it thought 'foo' didn't exist at all.  Somehow
or other this is related to the new "in memory file" gimmicks in
bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't
want to bother digging deeper.  Flushing the file in test_mmap after
writing to it makes the problem go away, so good enough.
2002-04-23 23:07:28 +00:00
Barry Warsaw 906569de24 Unit tests for the changes in abstract.c version 2.101. The debug
build's "undetected error" problems were originally detected with
extension types, but we can whitebox test the same situations with
new-style classes.
2002-04-23 22:48:42 +00:00