Commit Graph

8779 Commits

Author SHA1 Message Date
Barry Warsaw 4a44293735 Fixes to support CJKCodecs as per SF bug #852347. Actually, this
patch removes dependencies on the old unsupported KoreanCodecs package
and the alternative JapaneseCodecs package.  Since both of those
provide aliases for their codecs, this removal just makes the generic
codec names work.

We needed to make slight changes to __init__() as well.

This will be backported to Python 2.3 when its branch freeze is over.
2003-12-30 16:52:25 +00:00
Barry Warsaw 339270e6f5 Bump version number to 2.5.5 2003-12-30 16:49:40 +00:00
Andrew M. Kuchling b386f6a509 As part of fixing bug #829532, add a test case that exercises os.makedirs 2003-12-23 16:36:11 +00:00
Andrew M. Kuchling 6fccc8a9ec [Bug #829532] Invoking os.makedirs() with an argument that contains a
directory name with a single dot fails.  The patch skips creating
    directories named os.curdir. (Patch by Bram Moolenaar)

2.3 bugfix candidate.
2003-12-23 16:33:28 +00:00
Hye-Shik Chang 7fc4cf57b8 Fix unicode.rsplit()'s bug that ignores separater on the end of string when
using specialized splitter for 1 char sep.
2003-12-23 09:10:16 +00:00
Raymond Hettinger 9014560412 Make sure the UserDict copies do not share the same underlying
dictionary as the original.  This parallels MvL's change to
Lib/os.py 1.56.

Backport candidate.
2003-12-21 22:19:08 +00:00
Walter Dörwald 893020b59b Remove self from the arguments for the function add_type().
Backport candidate.
2003-12-19 18:15:10 +00:00
Hye-Shik Chang 8d2e08dcdf Enable some unittests on FreeBSD.
test__locale: add typical POSIX-style full locale names.
test_locale: use en_US.US-ASCII on FreeBSD.
2003-12-19 01:16:03 +00:00
Jeremy Hylton e708fbd286 Remove methods that are no longer called by urllib2. 2003-12-17 20:47:28 +00:00
Raymond Hettinger 64958a15d7 Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
2003-12-17 20:43:33 +00:00
Jeremy Hylton df38ea9c29 Add methods to MockHTTPClass for modern httplib interface.
Replace lots of assert_(x == y) with assertEqual(x, y).
2003-12-17 20:42:38 +00:00
Jeremy Hylton 023518a6a8 Rewrite AbstractHTTPHandler to use modern httplib interface.
The chief benefit of this change is that requests will now use
HTTP/1.1 instead of HTTP/1.0.  Bump the module version number as part
of the change.

There are two possible incompatibilities that we'll need to watch out
for when we get to an alpha release.  We may get a different class of
exceptions out of httplib, and the do_open() method changed its
signature.  The latter is only important if anyone actually subclasses
AbstractHTTPHandler.
2003-12-17 18:52:16 +00:00
Hye-Shik Chang eebb641f23 Add rsplit method for UserString, too.
(Spotted by Raymond Hettinger)
2003-12-15 19:46:09 +00:00
Hye-Shik Chang 3ae811b57d Add rsplit method for str and unicode builtin types.
SF feature request #801847.
Original patch is written by Sean Reifschneider.
2003-12-15 18:49:53 +00:00
Jeremy Hylton dce391cb39 Remove __del__ methods to avoid creating uncollectable cyclic trash.
Keep close() methods for backwards compatibility.

Does any call close() explicitly?
2003-12-15 16:08:48 +00:00
Walter Dörwald c2fcf9bb6b Make the module docstring a raw string, so that the backslash in
"read until end of line ('\n') or EOF" will be treated literally.
Fixes SF bug #860155.
2003-12-15 10:16:09 +00:00
Jeremy Hylton c1be59f40a SF patch 852995: add processors feature to urllib2
John J. Lee writes: "the patch makes it possible to implement
functionality like HTTP cookie handling, Refresh handling,
etc. etc. using handler objects. At the moment urllib2's handler
objects aren't quite up to the job, which results in a lot of
cut-n-paste and subclassing. I believe the changes are
backwards-compatible, with the exception of people who've
reimplemented build_opener()'s functionality -- those people would
need to call opener.add_handler(HTTPErrorProcessor).

The main change is allowing handlers to implement
methods like:

http_request(request)
http_response(request, response)

In addition to the usual

http_open(request)
http_error{_*}(...)
"

Note that the change isn't well documented at least in part because
handlers aren't well documented at all.  Need to fix this.

Add a bunch of new tests.  It appears that none of these tests
actually use the network, so they don't need to be guarded by a
resource flag.
2003-12-14 05:27:34 +00:00
Neal Norwitz 328f338196 SF #736962, port test_future to unittest, add a bit more coverage, by Walter Dörwald 2003-12-13 22:43:34 +00:00
Walter Dörwald b167b04a2e Add tests to test_weakref.py to bring code coverage in _weakref.c up to 100%.
Port test_md5.py to PyUnit.

(Written by Neal Norwitz; from SF patch 736962)

(Backport candidate)
2003-12-11 12:34:05 +00:00
Jack Jansen 73b94da93f Wrapper modules for _Launch and _OSA weren't added yet. Fixed. 2003-12-09 15:07:01 +00:00
Walter Dörwald 1dde95dffa Move list and tuple tests from test_types.py to their own scripts:
test_tuple.py and test_list.py. Common tests for tuple, list and UserList
are shared (in seq_tests.py and list_tests.py). Port tests to PyUnit.
(From SF patch #736962)
2003-12-08 11:38:45 +00:00
Raymond Hettinger d25c1c6351 Implement itertools.groupby()
Original idea by Guido van Rossum.
Idea for skipable inner iterators by Raymond Hettinger.
Idea for argument order and identity function default by Alex Martelli.
Implementation by Hye-Shik Chang (with tweaks by Raymond Hettinger).
2003-12-06 16:23:06 +00:00
Steve Purcell b8d5f245b7 Variation of Thomas Heller's patch (722638) for improving readability
of test failure output.

Irrelevant traceback levels are pruned from formatted traceback strings.
2003-12-06 13:03:13 +00:00
Jack Jansen da78a5d5b6 Finished update to universal header 3.4.2. 2003-12-05 23:59:37 +00:00
Jack Jansen 5a4071ac91 Reverting to previous version, which works. And I don't really care about
the new waste functionality because it's probably going to be dropped
anyway.
2003-12-05 23:51:54 +00:00
Thomas Heller 9436a75e4d Compile the files in the same order they are passed to the compiler.
Use case: Sometimes 'compiling' source files (with SWIG, for example)
creates additionl files which included by later sources.  The win32all
setup script requires this.

There is no SF item for this, but it was discussed on distutils-sig:
http://mail.python.org/pipermail/distutils-sig/2003-November/003514.html
2003-12-05 20:12:23 +00:00
Raymond Hettinger f477c88450 SF bug #849662. Dramatically, improve comparison speed for "if shl == None". 2003-12-04 20:04:09 +00:00
Brett Cannon edfb30258e Fix error in exception message. 2003-12-04 19:28:06 +00:00
Michael W. Hudson 9da1efb5ae Remove extra copy of test_key_with_exception that somehow appeared
during a CVS merge.
2003-12-04 11:41:24 +00:00
Michael W. Hudson 1df0f654e8 Fixes and tests for various "holding pointers when arbitrary Python code
can run" bugs as discussed in

[ 848856 ] couple of new list.sort bugs
2003-12-04 11:25:46 +00:00
Tim Peters c6c5ece7e2 Typo repair; added some comments and horizontal whitespace. 2003-12-04 05:39:43 +00:00
Jack Jansen fe3fe4adb5 Adding an interface to the high-level Open Scripting Architecture,
by request of Donovan Preston. In return, he promised to use this
to create a Python OSA component, which would turn Python
into a first-class OSA scripting language (like AppleScript itself).
2003-12-03 22:34:19 +00:00
Mark Hammond 2e8624c21a Fix test_unicode_file errors on platforms without Unicode file support,
by setting TESTFN_UNICODE_UNENCODEABLE on these platforms.
test_unicode_file only attempts to use the name for testing if not None.
2003-12-03 22:16:47 +00:00
Walter Dörwald c8de4585a6 Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
2003-12-03 20:26:05 +00:00
Walter Dörwald 7a7ede54d4 Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
2003-12-03 20:15:28 +00:00
Guido van Rossum 291481b4db Reduce the size of Big String and Big Binary tests to 2**14 (minus one
for Big String).  This should make the tests pass on Win98SE.  Note
that the docs only promise lengths up to 2048.  Unfortunately this no
longer tests for the segfault I was seeing earlier, but I'm confident
I've nailed that one. :-)  Fixes SF 852281.  Will backport to 2.3.
2003-12-03 15:24:02 +00:00
Mark Hammond 6d459725a3 Add test for bug "[ 846133 ] os.chmod/os.utime/shutil do not work with
unicode filenames"
Reorganize tests into functions so more combinations of
unicode/encoded/ascii can be tested, and while I was at it, upgrade to
unittest based test.
2003-12-03 01:29:56 +00:00
Mark Hammond b337dd903b Add TESTFN_UNICODE_UNENCODEABLE, a unicode filename that can not be
encoded using the default file system encoding.
2003-12-03 01:27:23 +00:00
Jack Jansen 7d0a609e6f An interface to the LaunchServices API. 2003-12-02 23:01:43 +00:00
Andrew MacIntyre 89f9865b91 OS/2+EMX: make the link() emulation available as os.link() 2003-12-02 12:33:01 +00:00
Andrew MacIntyre eb477f05cf EMX lacks an implementation of link(). As Mailman wants os.link() to
implement its locking scheme, this module implements a crude link() by
way of copying the source to the destination provided the destination
doesn't already exist.
2003-12-02 12:31:09 +00:00
Andrew MacIntyre 2e8a6e0ec6 To find the curses extension as a DLL (on OS/2), we need to adjust the
library search path to include the extension directory.  Without this,
the curses_panel extension can't find the curses extension/DLL, which
exports some curses symbols to it.
2003-12-02 12:27:25 +00:00
Andrew MacIntyre 63ee110cf7 use same compiler switches as core for extensions 2003-12-02 12:17:59 +00:00
Raymond Hettinger 70ef8692a1 SF patch #852140: keyword.py - use __contains__ and bool
Use a set instead of dict with values equal to one.
2003-12-02 07:48:15 +00:00
Martin v. Löwis 85f48e3b9b Convert path objects to strings in askdirectory. Fixes #852314.
Backported to 2.3.
2003-12-01 21:04:22 +00:00
Raymond Hettinger 3375fc5a3b Apply extract functions instead of lambda. 2003-12-01 20:12:15 +00:00
Raymond Hettinger 0ad142aba0 Revert previous change. MAL preferred the old version. 2003-12-01 13:26:46 +00:00
Raymond Hettinger 166958b5df As discussed on python-dev, added two extractor functions to the
operator module.
2003-12-01 13:18:39 +00:00
Raymond Hettinger a45517065a Simplifed the code. 2003-12-01 10:41:02 +00:00
Guido van Rossum 0a18552b29 Add testcases for _winreg segfault (SF 851056). 2003-11-30 22:46:18 +00:00