Commit Graph

11966 Commits

Author SHA1 Message Date
Georg Brandl 117a05ed50 Bug #1628895: some better tries to find HTML documentation in pydoc. 2007-03-02 14:37:12 +00:00
Raymond Hettinger c37e5e04eb Add collections.NamedTuple 2007-03-01 06:16:43 +00:00
Raymond Hettinger eb9798892d Prepare collections module for pure python code entries. 2007-02-28 18:37:52 +00:00
Raymond Hettinger 3035d2397f Docstring nit. 2007-02-28 18:27:41 +00:00
Brett Cannon f8267df2ad Add a test for instantiating SyntaxError with no arguments. 2007-02-28 18:15:00 +00:00
Armin Rigo adf172339c Modify the segfaulting example to show why r53997 is not a solution to
it.
2007-02-28 09:25:29 +00:00
Jeremy Hylton fa955697fa Add checking for a number of metaclass error conditions.
We add some new rules that are required for preserving internal
invariants of types.

1.  If type (or a subclass of type) appears in bases, it must appear
    before any non-type bases.  If a non-type base (like a regular
    new-style class) occurred first, it could trick type into
    allocating the new class an __dict__ which must be impossible.

2. There are several checks that are made of bases when creating a
   type.  Those checks are now repeated when assigning to __bases__.
   We also add the restriction that assignment to __bases__ may not
   change the metaclass of the type.

Add new tests for these cases and for a few other oddball errors that
were no previously tested.  Remove a crasher test that was fixed.

Also some internal refactoring:  Extract the code to find the most
derived metaclass of a type and its bases.  It is now needed in two
places.  Rewrite the TypeError checks in test_descr to use doctest.
The tests now clearly show what exception they expect to see.
2007-02-27 18:29:45 +00:00
Jeremy Hylton 37075c5ace Fix long-standing bug in name mangling for package imports
Reported by Mike Verdone.
2007-02-27 01:01:59 +00:00
Neal Norwitz 88516a6039 When printing an unraisable error, don't print exceptions. before the name.
This duplicates the behavior whening normally printing exceptions.
2007-02-26 22:41:45 +00:00
Jeremy Hylton 759410b372 Do not copy free variables to locals in class namespaces.
Fixes bug 1569356, but at the cost of a minor incompatibility in
locals().  Add test that verifies that the class namespace is not
polluted.  Also clarify the behavior in the library docs.

Along the way, cleaned up the dict_to_map and map_to_dict
implementations and added some comments that explain what they do.
2007-02-26 18:41:18 +00:00
Thomas Wouters 110054c053 Backported r51621 from p3yk:
Don't use a fixed temporary name (gdbm).
Don't use our own temp name creation (dbm).
Should be backported to 2.5.
2007-02-25 22:12:31 +00:00
Brett Cannon 6fbb96e69a Refactor PEP 352 tests to make it easier in the future to make sure certain
things cannot be raised or caught.
2007-02-23 14:28:25 +00:00
Neal Norwitz 764cf7ed82 Fix typo in comment 2007-02-23 00:22:39 +00:00
Raymond Hettinger d36862cf78 Add itertools.izip_longest(). 2007-02-21 05:20:38 +00:00
Raymond Hettinger cbac8ce5b0 Fixup docstrings for merge(). 2007-02-19 18:15:04 +00:00
Martin v. Löwis 382abeff0f Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
2007-02-19 10:55:19 +00:00
Raymond Hettinger 01b9881062 Add test for merge stability 2007-02-19 07:30:21 +00:00
Raymond Hettinger 45eb0f1419 Use C heapreplace() instead of slower _siftup() in pure python. 2007-02-19 06:59:32 +00:00
Raymond Hettinger 54da9819cc Add tie-breaker count to preserve sort stability. 2007-02-19 05:28:28 +00:00
Raymond Hettinger 00166c5532 Add merge() function to heapq. 2007-02-19 04:08:43 +00:00
Raymond Hettinger d6fc72a5ae Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash(). 2007-02-19 02:03:19 +00:00
Vinay Sajip f7ccc101d2 Minor fix for currentframe (SF #1652788). 2007-02-16 22:36:24 +00:00
Brett Cannon fa6521b4fd Make the __import__ call in encodings.__init__ absolute with a level 0 call. 2007-02-16 19:33:01 +00:00
Brett Cannon 971a012ce1 Update the encoding package's search function to use absolute imports when
calling __import__.  This helps make the expected search locations for encoding
modules be more explicit.

One could use an explicit value for __path__ when making the call to __import__
to force the exact location searched for encodings.  This would give the most
strict search path possible if one is worried about malicious code being
imported.  The unfortunate side-effect of that is that if __path__ was modified
on 'encodings' on purpose in a safe way it would not be picked up in future
__import__ calls.
2007-02-15 22:54:39 +00:00
Lars Gustäbel d0b6040ced A missing binary mode in AppendTest caused failures in Windows
Buildbot.
2007-02-14 14:45:12 +00:00
Lars Gustäbel f19c1b5e0e Strip the '.gz' extension from the filename that is written to the
gzip header.
2007-02-13 16:24:00 +00:00
Lars Gustäbel 5b1a785702 Patch #1647484: Renamed GzipFile's filename attribute to name. The
filename attribute is still accessible as a property that emits a
DeprecationWarning.
2007-02-13 16:09:24 +00:00
Martin v. Löwis 84f6de9d7e Patch #1517891: Make 'a' create the file if it doesn't exist.
Fixes #1514451.
2007-02-13 10:10:39 +00:00
Martin v. Löwis c6d626ed9f Patch #698833: Support file decryption in zipfile. 2007-02-13 09:49:38 +00:00
Martin v. Löwis 07aa3ed372 Patch #685268: Consider a package's __path__ in imputil.
Will backport.
2007-02-13 08:34:45 +00:00
Armin Rigo b8d6d73121 Fix the line to what is my guess at the original author's meaning.
(The line has no effect anyway, but is present because it's
customary call the base class __init__).
2007-02-12 16:23:24 +00:00
Martin v. Löwis 2bad58f5a4 Patch 1463026: Support default namespace in XMLGenerator.
Fixes #847665. Will backport.
2007-02-12 12:21:10 +00:00
Skip Montanaro 691acf2879 fix trace.py --ignore-dir 2007-02-11 18:24:37 +00:00
Martin v. Löwis 0a2032673c Bug #1600860: Search for shared python library in LIBDIR, not
lib/python/config, on "linux" and "gnu" systems.
Will backport.
2007-02-09 12:36:48 +00:00
Kurt B. Kaiser 209de1f6ca Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW.  Added AutoComplete instructions to IDLE Help.
2007-02-08 22:58:18 +00:00
Martin v. Löwis 4c11a92625 Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
2007-02-08 09:13:36 +00:00
Raymond Hettinger 495df4716f Fix docstring bug 2007-02-08 01:42:35 +00:00
Raymond Hettinger 6d121f168c Do not let overflows in enumerate() and count() pass silently. 2007-02-08 00:07:32 +00:00
Raymond Hettinger 4da5bf644a Bug #1575169: operator.isSequenceType() now returns False for subclasses of dict. 2007-02-07 22:24:07 +00:00
Raymond Hettinger 5a0217efea Check for a common user error with defaultdict(). 2007-02-07 21:42:17 +00:00
Raymond Hettinger 0922d71604 SF #1615701: make d.update(m) honor __getitem__() and keys() in dict subclasses 2007-02-07 20:08:22 +00:00
Kurt B. Kaiser 814ef237a2 Handle AttributeError during calltip lookup 2007-02-07 08:07:13 +00:00
Kurt B. Kaiser ca30acfea8 [ 1621265 ] Auto-completion list placement
Move AC window below input line unless not enough space, then put it above.
Patch: Tal Einat
2007-02-07 03:39:41 +00:00
Kurt B. Kaiser f30ff3b8fd narrow exception per [ 1540849 ] except too broad 2007-02-06 19:21:19 +00:00
Kurt B. Kaiser 4864b2bcd7 Updated patch (CodeContext.061217.patch) to
[ 1362975 ] CodeContext - Improved text indentation
Tal Einat 16Dec06
2007-02-06 19:09:43 +00:00
Lars Gustäbel 3f8aca1164 Patch #1652681: create nonexistent files in append mode and
allow appending to empty files.
2007-02-06 18:38:13 +00:00
Peter Astrand 5f9c6ae545 Applied patch 1124861.3.patch to solve bug #1124861: Automatically create pipes on Windows, if GetStdHandle fails. Will backport. 2007-02-06 15:37:50 +00:00
Kurt B. Kaiser dddeb0eec4 Clean up ModifiedInterpreter.runcode() structure 2007-02-06 03:21:40 +00:00
Kurt B. Kaiser ecf796ed43 1. Calltips now 'handle' tuples in the argument list (display '<tuple>' :)
Suggested solution by Christos Georgiou, Bug 791968.
2. Clean up tests, were not failing when they should have been.
4. Remove some camelcase and an unneeded try/except block.
2007-02-05 23:02:16 +00:00
Kurt B. Kaiser 90f84922ee Add 'raw' support to configHandler. Patch 1650174 Tal Einat. 2007-02-05 06:03:18 +00:00
Peter Astrand f54000325b We had several if statements checking the value of a fd. This is unsafe, since valid fds might be zero. We should check for not None instead. 2007-02-02 19:06:36 +00:00
Brett Cannon 129bd52146 No more raising of string exceptions!
The next step of PEP 352 (for 2.6) causes raising a string exception to trigger
a TypeError.  Trying to catch a string exception raises a DeprecationWarning.
References to string exceptions has been removed from the docs since they are
now just an error.
2007-01-30 21:34:36 +00:00
Tim Peters f733abb783 Whitespace normalization. 2007-01-30 03:03:46 +00:00
Brett Cannon e05e6b0032 Add a test for slicing an exception. 2007-01-29 04:41:44 +00:00
Brett Cannon af3d627022 Use the thread lock's context manager instead of a try/finally statement. 2007-01-28 20:58:00 +00:00
Georg Brandl 4ba9e5bdc7 Patch #1634778: add missing encoding aliases for iso8859_15 and
iso8859_16.
2007-01-27 17:59:42 +00:00
Georg Brandl ab49684f55 Patch #1638243: the compiler package is now able to correctly compile
a with statement; previously, executing code containing a with statement
compiled by the compiler package crashed the interpreter.
2007-01-27 17:43:02 +00:00
Brett Cannon 9875ba4d4e Remove specific mention of my name and email address from modules. Not really
needed and all bug reports should go to the bug tracker, not directly to me.
Plus I am not the only person to have edited these files at this point.
2007-01-25 23:30:39 +00:00
Brett Cannon 07e1db317d Fix time.strptime's %U support. Basically rewrote the algorithm to be more
generic so that one only has to shift certain values based on whether the week
was specified to start on Monday or Sunday.  Cut out a lot of edge case code
compared to the previous version.  Also broke algorithm out into its own
function (that is private to the module).

Fixes bug #1643943 (thanks Biran Nahas for the report).
2007-01-25 20:22:02 +00:00
Walter Dörwald 4b884a5cc2 Port test_popen.py to unittest. 2007-01-24 00:42:19 +00:00
Brett Cannon f5bee30e30 Fix crasher for when an object's __del__ creates a new weakref to itself.
Patch only fixes new-style classes; classic classes still buggy.

Closes bug #1377858.  Already backported.
2007-01-23 23:21:22 +00:00
Lars Gustäbel d2e22903d3 Patch #1507247: tarfile.py: use current umask for intermediate
directories.
2007-01-23 11:17:33 +00:00
Georg Brandl e498083b59 Bug #1627316: handle error in condition/ignore pdb commands more gracefully. 2007-01-22 21:23:41 +00:00
Georg Brandl 626349526e Bug #1249573: fix rfc822.parsedate not accepting a certain date format 2007-01-22 21:10:33 +00:00
Andrew M. Kuchling b94c0c3ea1 Make comment match the code 2007-01-22 20:27:50 +00:00
Andrew M. Kuchling b78bb74c41 Improve pattern used for mbox 'From' lines; add a simple test 2007-01-22 20:26:40 +00:00
Georg Brandl 5a096e1b10 Use new email module names (#1637162, #1637159, #1637157). 2007-01-22 19:40:21 +00:00
Georg Brandl dd7b0525e9 Patch #1627441: close sockets properly in urllib2. 2007-01-21 10:35:10 +00:00
Georg Brandl b84c13792d Bug #1486663: don't reject keyword arguments for subclasses of builtin
types.
2007-01-21 10:28:43 +00:00
Martin v. Löwis aef4c6bc00 Patch #1610575: Add support for _Bool to struct. 2007-01-21 09:33:07 +00:00
Walter Dörwald 71cd55150b Port test_new.py to unittest. 2007-01-20 23:07:28 +00:00
Walter Dörwald d414302eec resource.RUSAGE_BOTH might not exist. 2007-01-20 19:03:17 +00:00
Walter Dörwald 66262ab064 Add argument tests an calls of resource.getrusage(). 2007-01-20 18:19:33 +00:00
Walter Dörwald 9fab9a7da8 Port test_resource.py to unittest. 2007-01-20 17:28:31 +00:00
Raymond Hettinger 1b0ce85271 SF# 1635892: Fix docs for betavariate's input parameters . 2007-01-19 18:07:18 +00:00
Neal Norwitz 06a9a0ccf4 This test doesn't pass on Windows. The cause seems to be that chmod
doesn't support the same funcationality as on Unix.  I'm not sure if
this fix is the best (or if it will even work)--it's a test to see
if the buildbots start passing again.

It might be better to not even run this test if it's windows (or non-posix).
2007-01-18 06:20:55 +00:00
Neal Norwitz 7beeb2b0a5 Try reverting part of r53145 that seems to cause the Windows buildbots to fail in test_uu.UUFileTest.test_encode 2007-01-18 05:40:58 +00:00
Sjoerd Mullender 33a0a06d31 Fixed ntpath.expandvars to not replace references to non-existing
variables with nothing.  Also added tests.
This fixes bug #494589.
2007-01-16 16:42:38 +00:00
Vinay Sajip b3d8a06a46 Updated rotating file handlers to use _open(). 2007-01-16 09:50:07 +00:00
Vinay Sajip 73306b07ed Added WatchedFileHandler (based on SF patch #1598415) 2007-01-14 21:49:59 +00:00
Guido van Rossum bb2cc698c1 Patch #1635058 by Mark Roberts: ensure that htonl and friends never accept or
return negative numbers, per the underlying C implementation.
2007-01-14 17:03:32 +00:00
Ka-Ping Yee 8ef1cf30b7 Handle old-style instances more gracefully (display documentation on
the relevant class instead of documentation on <type 'instance'>).
2007-01-14 04:25:15 +00:00
Guido van Rossum 0567ba20f3 Remove a dependency of this test on $COLUMNS. 2007-01-14 03:46:33 +00:00
Gerhard Häring 0741a60ca7 Merged changes from standalone version 2.3.3. This should probably all be
merged into the 2.5 maintenance branch:

- self->statement was not checked while fetching data, which could
  lead to crashes if you used the pysqlite API in unusual ways.
  Closing the cursor and continuing to fetch data was enough.

- Converters are stored in a converters dictionary. The converter name
  is uppercased first. The old upper-casing algorithm was wrong and
  was replaced by a simple call to the Python string's upper() method
  instead.

-Applied patch by Glyph Lefkowitz that fixes the problem with
 subsequent SQLITE_SCHEMA errors.

- Improvement to the row type: rows can now be iterated over and have a keys()
  method. This improves compatibility with both tuple and dict a lot.

- A bugfix for the subsecond resolution in timestamps.

- Corrected the way the flags PARSE_DECLTYPES and PARSE_COLNAMES are
  checked for. Now they work as documented.

- gcc on Linux sucks. It exports all symbols by default in shared
  libraries, so if symbols are not unique it can lead to problems with
  symbol lookup.  pysqlite used to crash under Apache when mod_cache
  was enabled because both modules had the symbol cache_init. I fixed
  this by applying the prefix pysqlite_ almost everywhere. Sigh.
2007-01-14 01:43:50 +00:00
Marc-André Lemburg 3b8f60b700 Use defaults if sys.executable isn't set (e.g. on Jython).
This change allows running PyBench under Jython.
2007-01-13 23:13:54 +00:00
Peter Astrand 10514a70ac Fix for bug #1634343: allow specifying empty arguments on Windows 2007-01-13 22:35:35 +00:00
Marc-André Lemburg 2be9d43c18 Add parameter sys_version to _sys_version().
Change the cache for _sys_version() to take the parameter into account.

Add support for parsing the IronPython 1.0.1 sys.version value - even
though it still returns '1.0.0'; the version string no longer includes
the patch level.
2007-01-13 22:32:21 +00:00
Neal Norwitz 4b86f8b88b Fix grammar in docstrings 2007-01-13 21:22:37 +00:00
Marc-André Lemburg 9e0dc960d7 Bump version number and change copyright year.
Add new API linux_distribution() which supports reading the full distribution
name and also knows how to parse LSB-style release files.

Redirect the old dist() API to the new API (using the short distribution name
taken from the release file filename).

Add branch and revision to _sys_version().

Add work-around for Cygwin to libc_ver().

Add support for IronPython (thanks for Anthony Baxter) and make
Jython support more robust.
2007-01-13 21:00:08 +00:00
Brett Cannon 093b67061a Deprecate the sets module. 2007-01-13 00:29:49 +00:00
Thomas Heller d059e7b423 patch #1610795: BSD version of ctypes.util.find_library, by Martin
Kammerhofer.

release25-maint backport candidate, but the release manager has to
decide.
2007-01-12 20:17:34 +00:00
Thomas Heller 572104ff5c Avoid warnings in the test suite because ctypes.wintypes cannot be
imported on non-windows systems.
2007-01-12 20:08:19 +00:00
Thomas Heller f5b5183a19 Correct the comments: the code is right. 2007-01-11 21:23:12 +00:00
Thomas Heller 8138c26a83 Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
of HANDLE, WPARAM, LPARAM data types.  Make parameterless foreign
function calls work.
2007-01-11 21:18:56 +00:00
Raymond Hettinger 9fdfadb06e SF #1486663 -- Allow keyword args in subclasses of set() and frozenset(). 2007-01-11 18:22:55 +00:00
Matthias Klose a398e2d059 - idle: Honor the "Cancel" action in the save dialog (Debian bug #299092). 2007-01-11 11:44:04 +00:00
Guido van Rossum 833e9611b3 Fix the signature of log_error(). (A subclass that did the right thing
was getting complaints from pychecker.)
2007-01-10 23:12:56 +00:00
Thomas Heller fb9d78733e Change the ctypes version number to "1.1.0". 2007-01-10 20:12:13 +00:00
Thomas Heller 85a2192bb6 Verify the sizes of the basic ctypes data types against the struct
module.

Will backport to release25-maint.
2007-01-09 19:19:33 +00:00
Vinay Sajip 1211edd81b Added a docstring 2007-01-09 14:54:56 +00:00
Vinay Sajip 825b75a053 Bug #1627575: Added _open() method to FileHandler which can be used to reopen files. The FileHandler instance now saves the encoding (which can be None) in an attribute called "encoding". 2007-01-09 14:50:28 +00:00
Vinay Sajip 2cd79f6b78 Bare except clause removed from LogRecord.__init__. Now, only ValueError, TypeError and AttributeError are trapped.
(SF #411881)
2007-01-08 18:51:46 +00:00
Vinay Sajip c683a87ca6 Bare except clause removed from SMTPHandler.emit(). Now, only ImportError is trapped.
Bare except clause removed from SocketHandler.createSocket(). Now, only socket.error is trapped.
(SF #411881)
2007-01-08 18:50:32 +00:00
Raymond Hettinger 51c2f6cd18 Fix zero-length corner case for iterating over a mutating deque. 2007-01-08 18:09:20 +00:00
Peter Astrand 1812f8cf3f Avoid O(N**2) bottleneck in _communicate_(). Fixes #1598181. 2007-01-07 14:34:16 +00:00
Peter Astrand ec05a2d580 Re-implemented fix for #1531862 once again, in a way that works with Python 2.2. Fixes bug #1603424. 2007-01-07 08:53:46 +00:00
Andrew M. Kuchling 9c3a392321 [Patch #1520904] Fix bsddb tests to write to the temp directory instead of the Lib/bsddb/test directory 2007-01-05 15:51:24 +00:00
Andrew M. Kuchling 882680462c [Bug #1622533] Make docstrings raw strings because they contain control characters (\0, \1) 2007-01-05 14:22:17 +00:00
Gregory P. Smith 8b96a35d14 Support linking of the bsddb module against BerkeleyDB 4.5.x
(will backport to 2.5)
2007-01-05 01:59:42 +00:00
Martin v. Löwis 7b7c9d4208 Bug #1566280: Explicitly invoke threading._shutdown from Py_Main,
to avoid relying on atexit.
Will backport to 2.5.
2007-01-04 21:06:12 +00:00
Raymond Hettinger 769a40a1d0 Fix stability of heapq's nlargest() and nsmallest(). 2007-01-04 17:53:34 +00:00
Brett Cannon 92d54d5e9c Add EnvironmentVarGuard to test.test_support. Provides a context manager to
temporarily set or unset environment variables.
2007-01-04 00:23:49 +00:00
Raymond Hettinger 5399910eba For sets with cyclical reprs, emit an ellipsis instead of infinitely recursing. 2006-12-30 04:01:17 +00:00
Neal Norwitz a186ee22c0 SF bug #1623890, fix argument name in docstring 2006-12-29 03:01:53 +00:00
Lars Gustäbel a7ba6fc548 Patch #1504073: Fix tarfile.open() for mode "r" with a fileobj argument.
Will backport to 2.5.
2006-12-27 10:30:46 +00:00
Andrew M. Kuchling 7166232399 [Rest of patch #1182394] Add ._current() method so that we can use the written-in-C .hexdigest() method 2006-12-27 03:31:24 +00:00
Andrew M. Kuchling a7ebb33975 [Part of patch #1182394] Move the HMAC blocksize to be a class-level
constant; this allows changing it in a subclass.  To accommodate this,
copy() now uses __class__.  Also add some text to a comment.
2006-12-27 03:25:31 +00:00
Lars Gustäbel a4b2381b20 Patch #1262036: Prevent TarFiles from being added to themselves under
certain conditions.

Will backport to 2.5.
2006-12-23 17:57:23 +00:00
Lars Gustäbel 6baa502769 Patch #1230446: tarfile.py: fix ExFileObject so that read() and tell()
work correctly together with readline().

Will backport to 2.5.
2006-12-23 16:40:13 +00:00
Andrew M. Kuchling 55c54a2fa1 Frak; this test also fails 2006-12-22 21:48:19 +00:00
Andrew M. Kuchling f2881e8315 Darn; this test works when you run test_pty.py directly, but fails when regrtest runs it (the os.read() raises os.error). I can't figure out the cause, so am commenting out the test. 2006-12-22 19:21:27 +00:00
Andrew M. Kuchling 4281902545 [Patch #827559 from Chris Gonnerman] Make SimpleHTTPServer redirect when a directory URL is missing the trailing slash; this lets relative links work. 2006-12-22 19:06:16 +00:00
Andrew M. Kuchling ee0e6d16b3 [Patch #783050 from Patrick Lynch] The emulation of forkpty() is incorrect;
the master should close the slave fd.

Added a test to test_pty.py that reads from the master_fd after doing
a pty.fork(); without the fix it hangs forever instead of raising an
exception.  (<crossing fingers for the buildbots>)

2.5 backport candidate.
2006-12-22 18:41:42 +00:00
Andrew M. Kuchling 3fa5e6ee45 [Bug #776202] Apply Walter Doerwald's patch to use text mode for encoded files 2006-12-22 16:43:26 +00:00
Andrew M. Kuchling 9ef0ef5b72 [Bug #802128 continued] Modify mode depending on the process umask.
Is there really no other way to read the umask than to set it?

Hope this works on Windows...
2006-12-22 15:16:58 +00:00
Andrew M. Kuchling dc26758ffe [Bug #802128] Make the mode argument of dumbdbm actually work the way it's
described, and add a test for it.

2.5 bugfix candidate, maybe; arguably this patch changes the API of
dumbdbm and shouldn't be added in a point-release.
2006-12-22 15:04:45 +00:00
Andrew M. Kuchling b29069d6b6 [Bug #737202; fix from Titus Brown] Make CGIHTTPServer work for scripts in sub-directories 2006-12-22 13:25:02 +00:00
Andrew M. Kuchling eca4c31267 [Apply length-checking.diff from bug #1599254]
Add length checking to single-file mailbox formats: before doing a
flush() on a mailbox, seek to the end and verify its length is
unchanged, raising ExternalClashError if the file's length has
changed.

This fix avoids potential data loss if some other process appends to
the mailbox file after the table of contents has been generated;
instead of overwriting the modified file, you'll get the exception.

I also noticed that the self._lookup() call in self.flush() wasn't
necessary (everything that sets self._pending to True also calls
self.lookup()), and replaced it by an assertion.

2.5 backport candidate.
2006-12-20 19:48:20 +00:00
Georg Brandl ded1c4df0b Testcase for patch #1484695. 2006-12-20 11:55:16 +00:00
Raymond Hettinger 94547f7646 Bug #1590891: random.randrange don't return correct value for big number
Needs to be backported.
2006-12-20 06:42:06 +00:00
Georg Brandl ebbeed781d Patch #1484695: The tarfile module now raises a HeaderError exception
if a buffer given to frombuf() is invalid.
2006-12-19 22:06:46 +00:00
Andrew M. Kuchling 29ff461c83 [Patch #1587139 by kxroberto] Protect lock acquisition/release with
try...finally to ensure the lock is always released.  This could use
the 'with' statement, but the patch uses 'finally'.

2.5 backport candidate.
2006-12-19 15:43:10 +00:00
Andrew M. Kuchling c911e916d4 [Patch #1600491 from Jim Jewett] Describe how to build help files on Windows 2006-12-19 15:18:12 +00:00
Andrew M. Kuchling 522785732f [Patch #1617413 from Dug Song] Fix HTTP Basic authentication via HTTPS 2006-12-19 15:11:41 +00:00
Andrew M. Kuchling 8fe2d2015d [Patch #1618455 by Ben Maurer] Improve speed of HMAC by using str.translate()
instead of a more general XOR that has to construct a list.

Slightly modified from Maurer's patch: the _strxor() function is no longer
necessary at all.
2006-12-19 14:13:05 +00:00
Thomas Wouters e3a985fe9a Make sre's SubPattern objects accept slice objects like it already accepts
simple slices.
2006-12-19 08:17:50 +00:00
Kurt B. Kaiser c3200b97d6 1. Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
2. Duplicate some old entries from Python's NEWS to IDLE's NEWS.txt

M    AutoCompleteWindow.py
M    NEWS.txt
2006-12-15 05:13:11 +00:00
Andrew M. Kuchling 1646568b5e [Patch #1599256 from David Watson] check that os.fsync is available before using it 2006-12-14 18:57:53 +00:00
Brett Cannon 6d9520c4f0 Add test.test_support.guard_warnings_filter . This function returns a context
manager that protects warnings.filter from being modified once the context is
exited.
2006-12-13 23:09:53 +00:00
Brett Cannon c745df8519 Remove unneeded imports of 'warnings'. 2006-12-13 23:02:38 +00:00
Brett Cannon 905820ccba Remove an unneeded import of 'warnings'. 2006-12-13 22:31:37 +00:00
Walter Dörwald da1ad32cec Fix typo. 2006-12-12 21:55:31 +00:00
Vinay Sajip 66a1726620 Patch by "cuppatea" (SF #1503765) 2006-12-11 14:26:23 +00:00
Vinay Sajip 5492e1722a Patch by Jeremy Katz (SF #1609407) 2006-12-11 14:07:16 +00:00
Georg Brandl f54a63b3b5 Move errno imports back to individual functions. 2006-12-11 07:56:33 +00:00
Georg Brandl b130743e97 Patch #1608267: fix a race condition in os.makedirs() is the directory
to be created is already there.
2006-12-09 09:08:29 +00:00
Raymond Hettinger c789f341bb Add test for SF bug 1576657 2006-12-08 17:35:25 +00:00
Brett Cannon 8211297a7e Fix a bad assumption that all objects assigned to '__loader__' on a module
will have a '_files' attribute.
2006-12-06 23:38:48 +00:00
Georg Brandl 87fa559479 Patch #1610437: fix a tarfile bug with long filename headers. 2006-12-06 22:21:18 +00:00
Matthias Klose d149d0c76a - Fix build failure on kfreebsd and on the hurd. 2006-12-03 17:16:41 +00:00
Martin v. Löwis a00bcac003 Patch #1371075: Make ConfigParser accept optional dict type
for ordering, sorting, etc.
2006-12-03 12:01:53 +00:00
Martin v. Löwis 8609da9b17 Move IDLE news into NEWS.txt. 2006-12-03 09:54:46 +00:00
Raymond Hettinger 8a7e76bcfa Add name to credits (for untokenize). 2006-12-02 02:00:39 +00:00
Walter Dörwald f008203cb4 Move xdrlib tests from the module into a separate test script,
port the tests to unittest and add a few new tests.
2006-12-01 16:59:47 +00:00
Georg Brandl 21d900f1d6 Bug #1603321: make pstats.Stats accept Unicode file paths. 2006-11-26 19:27:47 +00:00
Thomas Heller 25d208bd46 Fix bug #1598620: A ctypes structure cannot contain itself. 2006-11-24 18:45:39 +00:00
Raymond Hettinger a3c77677ca ... and the number of the counting shall be three. 2006-11-23 21:35:19 +00:00
Michael W. Hudson f390442130 a test for an error condition not covered by existing tests
(noticed this when writing the equivalent code for pypy)
2006-11-23 13:54:04 +00:00
Walter Dörwald 39b8b6afb5 Change decode() so that it works with a buffer (i.e. unicode(..., 'utf-8-sig'))
SF bug #1601501.
2006-11-23 05:03:56 +00:00
Martin v. Löwis 4ebbefe677 Patch #1362975: Rework CodeContext indentation algorithm to
avoid hard-coding pixel widths. Also make the text's scrollbar
a child of the text frame, not the top widget.
2006-11-22 08:50:02 +00:00
Neal Norwitz 10cdb7492e Oops, convert tabs to spaces 2006-11-21 05:51:51 +00:00
Neal Norwitz 4fe442383d Bug #1599782: Fix segfault on bsddb.db.DB().type().
The problem is that _DB_get_type() can't be called without the GIL
because it calls a bunch of PyErr_* APIs when an error occurs.
There were no other cases in this file that it was called without the GIL.
Removing the BEGIN/END THREAD around _DB_get_type() made everything work.

Will backport.
2006-11-21 05:26:22 +00:00
Andrew M. Kuchling 5dba6f74c6 Jython compatibility fix: if uu.decode() opened its output file, be sure to
close it.
2006-11-20 13:39:37 +00:00
Martin v. Löwis 07529354db Patch #1070046: Marshal new-style objects like InstanceType
in xmlrpclib.
2006-11-19 18:51:54 +00:00
Andrew M. Kuchling 9eec51c04f Add a test case of data w/ bytes > 127 2006-11-19 18:40:01 +00:00
Martin v. Löwis cffcc8b195 Make cStringIO.truncate raise IOError for negative
arguments (even for -1). Fixes the last bit of
#1359365.
2006-11-19 10:41:41 +00:00
Georg Brandl 283a1353a0 Patch [ 1586791 ] better error msgs for some TypeErrors 2006-11-19 08:48:30 +00:00
Andrew M. Kuchling db4f255c61 Expand checking in test_sha 2006-11-18 22:17:33 +00:00
Martin v. Löwis bba003ef24 Patch #1472877: Fix Tix subwidget name resolution.
Will backport to 2.5.
2006-11-18 18:42:11 +00:00
Martin v. Löwis ef5fd3e7c9 Patch #1594554: Always close a tkSimpleDialog on ok(), even
if an exception occurs.
Will backport to 2.5.
2006-11-18 18:05:35 +00:00
Martin v. Löwis c73a4a4f51 Patch #1538878: Don't make tkSimpleDialog dialogs transient if
the parent window is withdrawn. This mirrors what dialog.tcl
does.
Will backport to 2.5.
2006-11-18 18:00:23 +00:00
Andrew M. Kuchling 8c456f3b57 Remove file-locking in MH.pack() method.
This change looks massive but it's mostly a re-indenting after
removing some try...finally blocks.

Also adds a test case that does a pack() while the mailbox is locked; this
test would have turned up bugs in the original code on some platforms.

In both nmh and GNU Mailutils' implementation of MH-format mailboxes,
no locking is done of individual message files when renaming them.

The original mailbox.py code did do locking, which meant that message
files had to be opened.  This code was buggy on certain platforms
(found through reading the code); there were code paths that closed
the file object and then called _unlock_file() on it.

Will backport to 25-maint once I see how the buildbots react to this patch.
2006-11-17 13:30:25 +00:00
Georg Brandl 25aabf4cbb Bug #1588217: don't parse "= " as a soft line break in binascii's
a2b_qp() function, instead leave it in the string as quopri.decode()
does.
2006-11-16 17:08:45 +00:00
Georg Brandl 540821183b Bug #1597824: return the registered function from atexit.register()
to facilitate usage as a decorator.
2006-11-16 16:50:59 +00:00
Martin v. Löwis 45cd4ff95d Patch #1360200: Use unmangled_version RPM spec field to deal with
file name mangling.
Will backport to 2.5.
2006-11-12 18:56:03 +00:00
Martin v. Löwis 36cbc08f3f Patch #1359217: Ignore 2xx response before 150 response.
Will backport to 2.5.
2006-11-12 18:48:13 +00:00
Martin v. Löwis 065f0c8a06 Patch #1355023: support whence argument for GzipFile.seek. 2006-11-12 10:41:39 +00:00
Martin v. Löwis 040a927cd1 Patch #1065257: Support passing open files as body in
HTTPConnection.request().
2006-11-12 10:32:47 +00:00
Phillip J. Eby 305e778a82 Fix SF#1566719: not creating site-packages (or other target directory) when
installing .egg-info for a project that contains no modules or packages,
while using --root (as in bdist_rpm).
2006-11-10 00:33:36 +00:00
Andrew M. Kuchling 978d8286ae [Patch #1514543] mailbox (Maildir): avoid losing messages on name clash
Two changes:

Where possible, use link()/remove() to move files into a directory; this
makes it easier to avoid overwriting an existing file.

Use _create_carefully() to create files in tmp/, which uses O_EXCL.

Backport candidate.
2006-11-09 21:16:46 +00:00
Andrew M. Kuchling b5686da24f [Patch #1514544 by David Watson] use fsync() to ensure data is really on disk 2006-11-09 13:51:14 +00:00
Andrew M. Kuchling a3e5d3757c [Bug #1569790] mailbox.Maildir.get_folder() loses factory information
Both the Maildir and MH classes had this bug; the patch fixes both classes
and adds a test.

Will backport to 25-maint.
2006-11-09 13:27:07 +00:00
Martin v. Löwis 038cad7ee4 Patch #1592250: Add elidge argument to Tkinter.Text.search. 2006-11-09 11:27:32 +00:00
Martin v. Löwis b2bba739c5 Patch #838546: Make terminal become controlling in pty.fork().
Will backport to 2.5.
2006-11-09 11:06:03 +00:00
Martin v. Löwis 5361e9a54e Patch #1351744: Add askyesnocancel helper for tkMessageBox. 2006-11-08 07:35:55 +00:00
Martin v. Löwis 3a62404264 Correctly forward exception in instance_contains().
Fixes #1591996. Patch contributed by Neal Norwitz.
Will backport.
2006-11-08 06:46:37 +00:00
Neal Norwitz 85dbec6da7 Bug #1588287: fix invalid assertion for `1,2` in debug builds.
Will backport
2006-11-04 19:25:22 +00:00
Martin v. Löwis 5310e5078a - Patch #1060577: Extract list of RPM files from spec file in
bdist_rpm
Will backport to 2.5.
2006-11-04 18:14:06 +00:00
Tim Peters abd8a336a3 Whitespace normalization. 2006-11-03 02:32:46 +00:00
Vinay Sajip ef7f3bf3b3 Change to improve speed of _fixupChildren 2006-10-31 17:32:37 +00:00
Neal Norwitz 1ead698494 I'm assuming this is correct, it fixes the tests so they pass again 2006-10-29 23:58:36 +00:00
Walter Dörwald 98c70acf47 Add tests for incremental codecs with an errors
argument.
2006-10-29 23:02:27 +00:00
Walter Dörwald 92911bfc6a Add tests for basic argument errors. 2006-10-29 22:06:28 +00:00
Georg Brandl 7d00099021 Move the check for openpty to the beginning. 2006-10-29 21:54:18 +00:00
Georg Brandl 59ba4299d0 Remove leftover test output file. 2006-10-29 20:35:12 +00:00
Georg Brandl cd97208110 Convert test_openpty to unittest. 2006-10-29 20:31:17 +00:00
Georg Brandl e8328ba723 Convert test_MimeWriter to unittest. 2006-10-29 20:28:26 +00:00
Georg Brandl 71a2089712 Completely convert test_httplib to unittest. 2006-10-29 20:24:01 +00:00
Georg Brandl e184433654 Convert test_cgi to unittest. 2006-10-29 20:09:12 +00:00
Georg Brandl a962eb32d9 Convert test_cookie to unittest. 2006-10-29 19:51:16 +00:00
Georg Brandl bd0fb14e51 Convert test_types to unittest. 2006-10-29 19:35:03 +00:00
Georg Brandl 850b2be67e Convert test_nis to unittest. 2006-10-29 19:24:43 +00:00
Georg Brandl eecce795a3 Convert test_poll to unittest. 2006-10-29 19:20:45 +00:00
Georg Brandl 3163179f1b Convert test_mmap to unittest. 2006-10-29 19:13:40 +00:00
Georg Brandl b9f4ad3a9a Bug #1576657: when setting a KeyError for a tuple key, make sure that
the tuple isn't used as the "exception arguments tuple".
2006-10-29 18:31:42 +00:00
Georg Brandl 7a4e804469 Bug #1586773: extend hashlib docstring. 2006-10-29 18:01:08 +00:00
Georg Brandl 2c9838e30f Bug #1586613: fix zlib and bz2 codecs' incremental en/decoders. 2006-10-29 14:39:09 +00:00
Georg Brandl 5b4e1c2530 Fix the new EncodedFile test to work with big endian platforms. 2006-10-29 09:32:16 +00:00
Georg Brandl facd273198 Test assert if __debug__ is true. 2006-10-29 09:18:00 +00:00
Georg Brandl 3354f285b9 Patch #1583880: fix tarfile's problems with long names and posix/
GNU modes.
2006-10-29 09:16:12 +00:00
Georg Brandl 6c0e1e8673 Bug #1357915: allow all sequence types for shell arguments in
subprocess.
2006-10-29 09:05:04 +00:00
Georg Brandl fe9c71bcd3 Remove trailing comma. 2006-10-29 09:01:01 +00:00
Georg Brandl 5addf70078 Bug #1586448: the compiler module now emits the same bytecode for
list comprehensions as the builtin compiler, using the LIST_APPEND
opcode.
2006-10-29 08:53:06 +00:00
Georg Brandl 8f99f81dfc Fix codecs.EncodedFile which did not use file_encoding in 2.5.0, and
fix all codecs file wrappers to work correctly with the "with"
statement (bug #1586513).
2006-10-29 08:39:22 +00:00
Neal Norwitz 07fdcfd6c9 Fix test_modulefinder so it doesn't fail when run after test_distutils. 2006-10-28 21:56:49 +00:00
Neal Norwitz 21997afb0c Fix bug #1565514, SystemError not raised on too many nested blocks.
It seems like this should be a different error than SystemError, but
I don't have any great ideas and SystemError was raised in 2.4 and earlier.

Will backport.
2006-10-28 21:19:07 +00:00
Georg Brandl b21e0815bf make test_grammar pass with python -O 2006-10-28 20:25:09 +00:00
Georg Brandl 0b679629c6 Convert test_opcodes to unittest. 2006-10-28 13:56:58 +00:00
Georg Brandl 2f03760a98 Convert test_math to unittest. 2006-10-28 13:51:49 +00:00
Georg Brandl 856b446793 Update outstanding bugs test file. 2006-10-28 13:11:41 +00:00
Georg Brandl c6fdec6d7e Convert test_global, test_scope and test_grammar to unittest.
I tried to enclose all tests which must be run at the toplevel
(instead of inside a method) in exec statements.
2006-10-28 13:10:17 +00:00
Walter Dörwald 3a3d8ea497 Port test_bufio to unittest. 2006-10-28 10:47:12 +00:00
Thomas Heller 112d1a64ac Modulefinder now handles absolute and relative imports, including
tests.

Will backport to release25-maint.
2006-10-27 19:05:53 +00:00
Thomas Heller df08f0b9a0 WindowsError.str should display the windows error code,
not the posix error code; with test.
Fixes #1576174.

Will backport to release25-maint.
2006-10-27 18:31:36 +00:00
Andrew M. Kuchling 872dba4253 [Patch #1574068 by Scott Dial] urllib and urllib2 were using
base64.encodestring() for encoding authentication data.
encodestring() can include newlines for very long input, which
produced broken HTTP headers.
2006-10-27 17:11:23 +00:00
Andrew M. Kuchling 6d72b0e1f8 Clarify docstring 2006-10-27 17:06:16 +00:00
Andrew M. Kuchling 0f87183cf5 [Bug #1575506] The _singlefileMailbox class was using the wrong file object in its flush() method, causing an error 2006-10-27 16:55:34 +00:00
Andrew M. Kuchling 41eb7164df [Bug #1576241] Let functools.wraps work with built-in functions 2006-10-27 16:39:10 +00:00
Martin v. Löwis ee82c0e6b7 Patch #1567274: Support SMTP over TLS. 2006-10-27 07:13:28 +00:00
Martin v. Löwis b5bc537c5e Patch #1549049: Rewrite type conversion in structmember.
Fixes #1545696 and #1566140. Will backport to 2.5.
2006-10-27 06:16:31 +00:00
Andrew M. Kuchling efb57072fe Typo fix 2006-10-26 19:16:46 +00:00
Georg Brandl a32e0a099b Patch [ 1583506 ] tarfile.py: 100-char filenames are truncated 2006-10-24 16:54:16 +00:00
Martin v. Löwis e97c759660 Remove passwd.adjunct.byname from list of maps
for test_nis. Will backport to 2.5.
2006-10-22 13:45:13 +00:00
Walter Dörwald d3973b578f Port test___future__ to unittest. 2006-10-22 08:59:41 +00:00
Tim Peters ef3f32f965 Whitespace normalization. 2006-10-18 05:09:12 +00:00
Thomas Heller d2ea4a2584 ctypes callback functions only support 'fundamental' result types.
Check this and raise an error when something else is used - before
this change ctypes would hang or crash when such a callback was
called.  This is a partial fix for #1574584.

Will backport to release25-maint.
2006-10-17 19:30:48 +00:00
Brett Cannon d80e0c8677 Fix turtle so that you can launch the demo2 function on its own instead of only
when the module is launched as a script.
2006-10-16 03:09:52 +00:00
Martin v. Löwis a97e06d9db Round to int, because some systems support sub-second time stamps in stat, but not in utime.
Also be consistent with modifying only mtime, not atime.
2006-10-15 11:02:07 +00:00
Martin v. Löwis cfcd3a9569 Loosen the test for equal time stamps. 2006-10-15 09:35:51 +00:00
Martin v. Löwis 18aaa568fd Patch #1576166: Support os.utime for directories on Windows NT+. 2006-10-15 08:43:33 +00:00
Neal Norwitz cbeb687c68 Update the peephole optimizer to remove more dead code (jumps after returns)
and inline jumps to returns.
2006-10-14 21:33:38 +00:00
Georg Brandl 65ad043ea3 Bug #1560179: speed up posixpath.(dir|base)name 2006-10-12 13:08:16 +00:00
Georg Brandl 35207712dc Fix tarfile depending on buggy int('1\0', base) behavior. 2006-10-12 12:03:07 +00:00
Georg Brandl 2c1375c8db Bug #1545497: when given an explicit base, int() did ignore NULs
embedded in the string to convert.
2006-10-12 11:27:59 +00:00
Georg Brandl 5597e261b2 Bug #1548891: The cStringIO.StringIO() constructor now encodes unicode
arguments with the system default encoding just like the write()
method does, instead of converting it to a raw buffer.
2006-10-12 09:47:12 +00:00
Georg Brandl b2e81e307d Bug #1550524: better heuristics to find correct class definition
in inspect.findsource().
2006-10-12 09:20:33 +00:00
Georg Brandl d076153ee8 Bug #813342: Start the IDLE subprocess with -Qnew if the parent
is started with that option.
2006-10-12 07:57:21 +00:00
Martin v. Löwis f43893a878 Bug #1565150: Fix subsecond processing for os.utime on Windows. 2006-10-09 20:44:25 +00:00
Ronald Oussoren d6272a3cf6 MacOSX: The universal build requires that users have the MacOSX10.4u SDK
installed to build extensions. This patch makes distutils emit a warning when
the compiler should use an SDK but that SDK is not installed, hopefully reducing
some confusion.
2006-10-08 17:51:46 +00:00
Ronald Oussoren d610369e8b MacOSX: distutils changes the values of BASECFLAGS and LDFLAGS when using a
universal build of python on OSX 10.3 to ensure that those flags can be used
to compile code (the universal build uses compiler flags that aren't supported
on 10.3). This patches gives the same treatment to CFLAGS, PY_CFLAGS and
BLDSHARED.
2006-10-08 17:49:52 +00:00