Commit Graph

5894 Commits

Author SHA1 Message Date
Guido van Rossum b6b8942f53 SF bug #541883 (Vincent Fiack).
A stupid bug in object_set_class(): didn't check for value==NULL
before checking its type.

Bugfix candidate.
2002-04-15 01:03:30 +00:00
Guido van Rossum d1c08f33f2 Add exit as alias for quit, as the easiest way to address SF bug
#543674.

Bugfix candidate.
2002-04-15 00:48:24 +00:00
Guido van Rossum beae477767 SF bug #543318 (Frank J. Tobin).
In DatagramRequestHandler.setup(), the wfile initialization should be
StringIO.StringIO(), not StringIO.StringIO(slf.packet).

Bugfix candidate (all the way back to Python 1.5.2 :-).
2002-04-15 00:36:48 +00:00
Guido van Rossum a2da305211 Fix from SF bug #541980 (Jacques A. Vidrine).
When os.stat() for a file raises OSError, turn it into IOError per
documentation.

Bugfix candidate.
2002-04-15 00:25:01 +00:00
Tim Peters 077f27141f SF bug 543840: complex(string) accepts strings with \0
complex_subtype_from_string():  this stopped parsing at the first 0
byte, as if that were the end of the input string.

Bugfix candidate.
2002-04-14 22:04:03 +00:00
Jack Jansen 518d261f63 Test suite for universal newline support. 2002-04-14 20:17:18 +00:00
Jack Jansen 7b8c7546eb Mass checkin of universal newline support.
Highlights: import and friends will understand any of \r, \n and \r\n
as end of line. Python file input will do the same if you use mode 'U'.
Everything can be disabled by configuring with --without-universal-newlines.

See PEP278 for details.
2002-04-14 20:12:41 +00:00
Martin v. Löwis 2f6d4da278 Patch #542569: tp_print tp_repr tp_str in test_bool.py. 2002-04-14 10:22:29 +00:00
Neal Norwitz f42d32cb27 BDFL agreed with Tim: rehabilitate randint(). 2002-04-13 14:41:19 +00:00
Guido van Rossum f49562586f Add pop() to UserDict. 2002-04-13 14:03:38 +00:00
Guido van Rossum 018b0eb0f5 Partially implement SF feature request 444708.
Add optional arg to string methods strip(), lstrip(), rstrip().
The optional arg specifies characters to delete.

Also for UserString.

Still to do:

- Misc/NEWS
- LaTeX docs (I did the docstrings though)
- Unicode methods, and Unicode support in the string methods.
2002-04-13 00:56:08 +00:00
Barry Warsaw 56cdf11922 AddrlistClass -> AddressList 2002-04-12 20:55:31 +00:00
Barry Warsaw e1df15c401 AddrlistClass -> AddressList 2002-04-12 20:50:05 +00:00
Guido van Rossum d854f3b3cc I am mad. This test never worked!
The test function's signature should be

    test(methodname, input, output, *args)

but the output argument was omitted.  This caused all tests to fail,
because the expected output was passed as the initial argument to the
method call.  But because of the way the test works (it compares the
results for a regular string to the results for a UserString instance
with the same value, and it's OK if both raise the same exception) the
test never failed!

I've fixed this, and also cleaned up a few warts in the verbose
output.  Finally, I've made it possible to run the test stand-alone in
verbose mode by passing -v as a command line argument.

Now, the test will report failure related to zfill.  That's not my
fault, that's a legitimate problem: the string_tests.py file contains
a test for the zfill() method (just added) but this method is not
implemented.  The responsible party will surely fix this soon now.
2002-04-12 16:25:39 +00:00
Guido van Rossum e027d9818f Add Raymond Hettinger's d.pop(). See SF patch 539949. 2002-04-12 15:11:59 +00:00
Fred Drake 04a8da5cdb Clean up the "all" support for -u. 2002-04-11 20:58:54 +00:00
Fred Drake f9ddec41ce Guido sez to remove the deprecation warning for a year.
The deprecation is now listed in PEP 4.
2002-04-11 20:57:30 +00:00
Tim Peters a7c2b303d4 Since xmllib is deprecated now, suppress the DeprecationWarning its test
module necessarily raises.
2002-04-11 20:18:40 +00:00
Tim Peters b05cd496df Ignore more deprecation warnings. 2002-04-11 20:04:12 +00:00
Tim Peters 3c14efe696 Stop sucking up xmllib -- it's deprecated. 2002-04-11 19:54:11 +00:00
Tim Peters deb121aec7 I don't expect test_email_codecs to run on Windows. 2002-04-11 19:52:58 +00:00
Fred Drake 3a15dace36 Added the resource name "all" to enable all of the optional resource uses.
This is nice for use with "make TESTOPTS='-u all' test".
2002-04-11 16:39:16 +00:00
Fred Drake 43735da1bf Improve coverage of Objects/weakrefobject.c. 2002-04-11 03:59:42 +00:00
Andrew M. Kuchling 7301907358 Add deprecation warning to 'pre' module 2002-04-10 21:36:11 +00:00
Andrew M. Kuchling 7fd1c8c880 Remove support for importing 'pre' module 2002-04-10 21:15:40 +00:00
Barry Warsaw 409a4c08b5 Sync'ing with standalone email package 2.0.1. This adds support for
non-us-ascii character sets in headers and bodies.  Some API changes
(with DeprecationWarnings for the old APIs).  Better RFC-compliant
implementations of base64 and quoted-printable.

Updated test cases.  Documentation updates to follow (after I finish
writing them ;).
2002-04-10 21:01:31 +00:00
Marc-André Lemburg ce0b664af2 Added test case for UTF-8 encoding bug #541828. 2002-04-10 17:18:02 +00:00
Andrew M. Kuchling a9745611de Use random instead of whrandom 2002-04-10 14:54:39 +00:00
Neal Norwitz ab3b9eb477 Add deprecation warnings for modules as documented 2002-04-10 02:04:00 +00:00
Fred Drake 6e99704fcf Add a deprecation warning to reflect the documented deprecation of the
whrandom module.  (The deprecation was effective in Python 2.1.)
2002-04-10 01:45:11 +00:00
Neal Norwitz 803a8ea47e Update docstring to reflect code change to bool 2002-04-09 18:12:58 +00:00
Thomas Heller 4c7fb96b7a Remove unconditional debugging prints. 2002-04-09 14:16:07 +00:00
Thomas Heller fd0e82a385 Set the warn_dir option to 0 before running the install command.
This suppresses bogus warnings about modules installed into a directory
not in sys.path.

Bugfix candidate.
2002-04-09 14:14:38 +00:00
Martin v. Löwis 8509ebc8f7 Patch #539392: Invoke setlocale, try opening the file in demo mode. 2002-04-08 14:51:31 +00:00
Martin v. Löwis d1a3c8117d Move knee.py from Lib/ to Demo/imputil/. Fixes #515745. 2002-04-07 16:29:36 +00:00
Guido van Rossum 8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Guido van Rossum 8ace1ab53a - Changed new-style class instantiation so that when C's __new__
method returns something that's not a C instance, its __init__ is
  not called.  [SF bug #537450]
2002-04-06 01:05:01 +00:00
Guido van Rossum d1bfe5e5fd Add tests for binary pickles. 2002-04-05 20:57:02 +00:00
Guido van Rossum e276339cea Implement an idea by Paul Rubin:
Change pickling format for bools to use a backwards compatible
encoding.  This means you can pickle True or False on Python 2.3
and Python 2.2 or before will read it back as 1 or 0.  The code
used for pickling bools before would create pickles that could
not be read in previous Python versions.
2002-04-05 19:30:08 +00:00
Marc-André Lemburg 3ccb09cba3 Fix for bug #222395: UTF-16 et al. don't handle .readline().
They now raise an NotImplementedError to hint to the truth ;-)
2002-04-05 12:12:00 +00:00
Tim Peters a863270f04 Revert 0/1 -> False/True change; I didn't intend to muck w/ distutils. 2002-04-04 23:17:31 +00:00
Tim Peters bc0e910826 Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
Jeremy Hylton f32e459125 Replace use of apply() with extended call syntax. 2002-04-04 21:02:24 +00:00
Fred Drake df6eca7eb7 Support manual proxy configuration for simple urlopen() operations.
This change is similar to the supplied patch, but does not save the opener
when a proxy configuration is specified.
This closes SF patch #523415.
2002-04-04 20:41:34 +00:00
Fred Drake da204daeaa Not sure why the regression test missed this, but the PyXML tests caught it.
We should get attributes from the right object.
2002-04-04 19:12:31 +00:00
Fred Drake 012c81fc97 Avoid creating circular references between the ExpatParser and the
ContentHandler.  While GC will eventually clean up, it can take longer than
normal for applications that create a lot of strings (or other immutables)
rather without creating many containers.
This closes SF bug #535474.
2002-04-04 17:57:08 +00:00
Guido van Rossum 2e1c09c1fd Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt).  Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
2002-04-04 17:52:50 +00:00
Guido van Rossum 065fa4142a Add test case for SF bug 534347. 2002-04-04 16:27:04 +00:00
Guido van Rossum 5f8203679d Oops. Here are the new files. My apologies. 2002-04-03 23:01:45 +00:00
Guido van Rossum 77f6a65eb0 Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285.  Everything described in the PEP is here, and there is even
some documentation.  I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison.  I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.

Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
2002-04-03 22:41:51 +00:00