Commit Graph

16302 Commits

Author SHA1 Message Date
Raymond Hettinger 6ef18f4fa3 Fix typo. 2011-01-23 21:33:36 +00:00
Raymond Hettinger 98b140c196 Add entry for reprlib. 2011-01-23 21:05:46 +00:00
Georg Brandl c7c199f907 #10983: fix several bugs in the _tunnel implementation that seem to have missed while porting between branches. A unittest is needed! 2011-01-22 22:06:24 +00:00
Armin Ronacher 59531287fd To match the behaviour of HTTP server, the HTTP client library now also encodes
headers with iso-8859-1 (latin1) encoding.  It was already doing that for
incoming headers which makes this behaviour now consistent in both incoming and
outgoing direction.
2011-01-22 13:44:22 +00:00
Armin Ronacher 8d96d77f9a Issue #10980: encode headers with latin1 instead of ASCII in the HTTP server.
This makes the implementation of PEP 3333 compliant servers on top of
BaseHTTPServer possible.
2011-01-22 13:13:05 +00:00
Vinay Sajip 01241d6c35 Issue #10949: Improved robustness of rotating file handlers. 2011-01-21 23:35:57 +00:00
Antoine Pitrou 00d650baaa Fix JSON docs about loads() accepting only str objects, not bytes. 2011-01-21 21:37:32 +00:00
Antoine Pitrou 305bc9e0e8 Issue #10955: Fix a potential crash when trying to mmap() a file past its
length.  Initial patch by Ross Lagerwall.

This fixes a regression introduced by r88022.
2011-01-20 21:07:24 +00:00
Alexander Belopolsky 41a99bc20d Issue #10934: Fixed and expanded Internaldate2tuple() and
Time2Internaldate() documentation.  Thanks Joe Peterson for the report
and the original patch.
2011-01-19 19:53:30 +00:00
Antoine Pitrou ad62b03949 Issue #10451: memoryview objects could allow to mutate a readable buffer.
Initial patch by Ross Lagerwall.
2011-01-18 18:57:52 +00:00
Raymond Hettinger 5bdfd910f5 Remove out-of-date comment 2011-01-16 09:16:27 +00:00
Antoine Pitrou d0ebc75e73 Fix mmap and test_mmap under Windows too (followup to r88022) 2011-01-15 17:25:58 +00:00
Georg Brandl 3988ed8e6f Bump to 3.2rc1. 2011-01-15 17:08:53 +00:00
Georg Brandl 5cc3dcb191 Update pydoc topics. 2011-01-15 16:44:11 +00:00
Antoine Pitrou 85f4615500 Issue #10916: mmap should not segfault when a file is mapped using 0 as
length and a non-zero offset, and an attempt to read past the end of file
is made (IndexError is raised instead).  Patch by Ross Lagerwall.

Requested by Georg.
2011-01-15 16:17:07 +00:00
Ned Deily 4ce92b23fe #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5,
rather than the currently problematic Apple-supplied one,
        when running with the 64-/32-bit installer variant.
2011-01-15 04:37:12 +00:00
Victor Stinner f1c7ca93c1 cgi: use isinstance(x, list) instead of type(x) == type([]) 2011-01-14 13:08:27 +00:00
Victor Stinner 5c23b8e6ea Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
as unicode, and accept binary files. Add encoding and errors attributes to
cgi.FieldStorage.
2011-01-14 13:05:21 +00:00
Victor Stinner 1d87deb605 test_urlparse: add tests for encoding and errors arguments 2011-01-14 13:05:19 +00:00
Victor Stinner ac71c54b88 Add encoding and errors arguments to urllib.parse_qs() and urllib.parse_qsl() 2011-01-14 12:52:12 +00:00
Raymond Hettinger d958ea70bc Issue 10899: Remove function type annotations from the stdlib 2011-01-13 19:08:04 +00:00
Raymond Hettinger cbb80896ae Issue #10899: Move function type annotations into docstrings.
Note, the docstrings (for the most part) were already very thorough
and included type information.
2011-01-13 18:15:51 +00:00
Georg Brandl 4d73b570eb More PEP 8: no space around "=" in argument lists. 2011-01-13 07:13:06 +00:00
Raymond Hettinger 00fa03900c Issue 10899: Remove function type annotations from the stdlib 2011-01-13 02:52:26 +00:00
Raymond Hettinger cd92f37582 Issue 10899: Remove function type annotations from the stdlib 2011-01-13 02:31:25 +00:00
Raymond Hettinger 3c94024c3e Issue #10899: No function type annotations in the standard library.
Removed function type annotations from _pyio.py.
2011-01-12 23:39:31 +00:00
Antoine Pitrou 1e28513d25 Fix test_bigaddrspace (some tests didn't trigger the expected MemoryError) 2011-01-12 22:02:45 +00:00
Antoine Pitrou 98c62bd1c8 A better message again 2011-01-12 21:58:39 +00:00
Antoine Pitrou e0d3f8a654 More informative skip message in @bigaddrspace 2011-01-12 21:50:44 +00:00
Antoine Pitrou 9dd1171305 Fix @bigmemtest when no limit is given by the user (oops) 2011-01-12 21:40:20 +00:00
Antoine Pitrou aca5fa7010 Make test skipping message nicer, and remove the rather useless "overhead" parameter. 2011-01-12 21:19:59 +00:00
Raymond Hettinger 219c300748 Remove the funky function annotation from numbers.py. 2011-01-12 20:52:39 +00:00
Antoine Pitrou 45545f79c9 Fix the expected memory use of utf-8 encoding. Also, release the
one reference to a huge object even when an exception is raised.
2011-01-12 20:46:37 +00:00
Raymond Hettinger b3d89a4ee4 Remove function annotations that slipped into _abcoll.
These are reserved for third-party use.
2011-01-12 20:37:47 +00:00
Antoine Pitrou 318b8f35fe Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
by Ross Lagerwall.
2011-01-12 18:45:27 +00:00
Benjamin Peterson 477ba919c1 don't segfault on deleting __abstractmethods__ #10892 2011-01-12 15:34:01 +00:00
Benjamin Peterson 5e8dada491 oops, wrong class 2011-01-12 15:25:02 +00:00
Benjamin Peterson 1c02a44023 move this test to test_descr; it's not abc specific 2011-01-12 15:24:27 +00:00
Nick Coghlan e993b10041 Issue 10889: Support slicing and indexing of large ranges (no docs changes, since, as far as I know, we never said anywhere that this *didn't* work) 2011-01-12 03:15:52 +00:00
Raymond Hettinger 524359f9f7 Add comment. 2011-01-11 22:08:55 +00:00
Alexander Belopolsky ef4a03fffe Issue #5109: array.array constructor will now use fast code when
initial data is provided in an array object with correct type.
2011-01-11 21:44:00 +00:00
Raymond Hettinger 5cee47f321 Add entry for Barrier objects. 2011-01-11 19:59:46 +00:00
Eric Smith a3e8f3d85f Typo. 2011-01-11 10:24:34 +00:00
Nick Coghlan 90be5fb817 Issue 10556: test_zipimport_support implicitly imports too many modules (including _ssl) to safely clobber sys.modules after each test 2011-01-11 10:05:20 +00:00
Alexander Belopolsky a6892418ad This should fix mktime test on Windows 2011-01-11 02:22:16 +00:00
Alexander Belopolsky 31c5dd6b19 Make mktime test more robust. 2011-01-11 01:35:22 +00:00
Alexander Belopolsky b7d40d1702 Issue #1726687: time.mktime() will now correctly compute value one
second before epoch.  Original patch by Peter Wang, reported by Martin
Blais.
2011-01-11 01:21:25 +00:00
Antoine Pitrou a4815caa7c Issue #10872: The repr() of TextIOWrapper objects now includes the mode
if available.

(at Georg's request)
2011-01-09 20:38:15 +00:00
Łukasz Langa d7e81cc5fa #10874: test_urllib2 shouldn't use `is` operator for comparing strings
Patch by Adreas Stührk.
2011-01-09 18:18:53 +00:00
Georg Brandl efb6902c3d Add missing line. 2011-01-09 07:50:48 +00:00
Georg Brandl 619e7ba814 #10869: do not visit root node twice in ast.increment_lineno(). 2011-01-09 07:38:51 +00:00
R. David Murray 5b2d9ddf69 #5871: protect against header injection attacks.
This makes Header.encode throw a HeaderParseError if it winds up
formatting a header such that a continuation line has no leading
whitespace and looks like a header.  Since Header accepts values
containing newlines and preserves them (and this is by design), without
this fix any program that took user input (say, a subject in a web form)
and passed it to the email package as a header was vulnerable to header
injection attacks.  (As far as we know this has never been exploited.)

Thanks to Jakub Wilk for reporting this vulnerability.
2011-01-09 02:35:24 +00:00
Antoine Pitrou 5d938cb366 Add EHOSTUNREACH ('No route to host') to the errnos trapped by transient_internet(). 2011-01-08 10:28:11 +00:00
Antoine Pitrou 160fd938ed Fix test_ssl after r87849 2011-01-08 10:23:29 +00:00
Antoine Pitrou 67b212e608 Issue #10859: Make `contextlib.GeneratorContextManager` officially
private by renaming it to `_GeneratorContextManager`.
2011-01-08 09:55:31 +00:00
Raymond Hettinger 23f9fc3448 Issue #10042: Fixed the total_ordering decorator to handle cross-type
comparisons that could lead to infinite recursion.
2011-01-08 07:01:56 +00:00
Victor Stinner f332abbf15 test_ssl: test SHA256 using sha256.tbs-internet.com instead of sha2.hboeck.de 2011-01-08 03:16:05 +00:00
Victor Stinner 301f1217ac Issue #1777412: Remove all limits on tm_year from time.strftime()
The buildbots will tell us which platform does support or not negative years.
2011-01-08 03:06:52 +00:00
Victor Stinner af5aee57c9 Issue #1777412: fix test_time for Mac OS X and OpenIndiana 2011-01-08 02:46:33 +00:00
Victor Stinner 736913269e Issue #1777412: test large years value for strftime('%Y') 2011-01-08 02:00:24 +00:00
Victor Stinner 73ea29cb03 Issue #1777412: strftime() accepts year >= 1 instead of year >= 1900
* With Visual Studio, year have to be in [1; 9999]
 * Add more tests on the year field
2011-01-08 01:56:31 +00:00
Alexander Belopolsky 0dd06f4082 Fixed error handling branches. Thanks
Victor Stinner for pointing this out.
2011-01-08 01:23:02 +00:00
Alexander Belopolsky b8bb4664fc Issue #1777412: extended year range of strftime down to 1000. 2011-01-08 00:13:34 +00:00
R. David Murray 9253214fd9 #10686: recode non-ASCII headers to 'unknown-8bit' instead of ?s.
This applies only when generating strings from non-RFC compliant binary
input; it makes the existing recoding behavior more consistent (ie:
now no data is lost when recoding).
2011-01-07 23:25:30 +00:00
R. David Murray 6f0022d84a Fix formatting of values with embedded newlines when rfc2047 encoding
Before this patch if a value being encoded had an embedded newline,
the line following the newline would have no leading whitespace,
and the whitespace it did have was encoded into the word.  Now
the existing whitespace gets turned into a blank, the way it does
in other header reformatting, and the _continuation_ws gets added
at the beginning of the encoded line.
2011-01-07 21:57:25 +00:00
Alexander Belopolsky c64708ae48 Issue #10827: Changed the rules for 2-digit years. The time.asctime
function will now format any year when time.accept2dyear is false and
will accept years >= 1000 otherwise.  The year range accepted by
time.mktime and time.strftime is still system dependent, but
time.mktime will now accept full range supported by the OS. Conversion
of 2-digit years to 4-digit is deprecated.
2011-01-07 19:59:19 +00:00
Brett Cannon 63eef1e0dd Get --coverage to be an acceptable flag for test.regrtest again. 2011-01-06 22:32:41 +00:00
Alexander Belopolsky 610e544bf7 Further simplify gettmarg() 2011-01-06 21:57:06 +00:00
Antoine Pitrou b715fac819 Issue #3839: wsgiref should not override a Content-Length header set by
the application.  Initial patch by Clovis Fabricio.
2011-01-06 17:17:04 +00:00
Georg Brandl e98628d60c Remove doc for nonexisting parameter. 2011-01-06 09:15:45 +00:00
Antoine Pitrou ca023cab4d Issue #1677694: Refactor and improve test_timeout. Original patch by
Björn Lindqvist.
2011-01-06 09:05:22 +00:00
Raymond Hettinger 7beae8a0d5 Issue 10825: Minor updates to the test suite. 2011-01-06 05:34:17 +00:00
Victor Stinner 4bd81725f2 Issue #10492: bdb.Bdb.run() only traces the execution of the code
And not the compilation (if the input is a string).
2011-01-06 00:49:38 +00:00
Victor Stinner 457ab068a3 test_atexit: fix code saving/restoring stdout and stderr
That's why I prefer a single instruction per line :-)
2011-01-05 23:47:00 +00:00
Victor Stinner 73efd621fb test_imaplib: reap_server() closes the server when done
Fix a ResourceWarning(unclosed socket). Patch written by Nadeem Vawda.
2011-01-05 23:01:38 +00:00
Victor Stinner 33e649cf6d imaplib: IMAP4 constructor closes the socket on error
Fix a ResourceWarning(unclosed socket) if an exception is raised in the
constructor after the creation of the socket. Patch written by Nadeem Vawda.
2011-01-05 23:01:37 +00:00
Alexander Belopolsky a686725859 - time.accept2dyear = True is now equivalent to time.accept2dyear = 1
- removed unnecessary struct_time to tuple conversion
- added more unit tests
(See issue #10827 for discussion.)
2011-01-05 23:00:47 +00:00
Georg Brandl be41a48fb8 On Py3k, -tt and -3 are no-op and unsupported respectively. 2011-01-05 21:47:47 +00:00
Antoine Pitrou 600232b562 Issue #7995: When calling accept() on a socket with a timeout, the returned
socket is now always non-blocking, regardless of the operating system.
2011-01-05 21:03:42 +00:00
Raymond Hettinger 7d967712b8 Update tests and whatsnew for the 'quiet' flag 2011-01-05 20:24:08 +00:00
Antoine Pitrou 452196fef1 Issue #5485: Add tests for the UseForeignDTD method of expat parser objects.
Patch by Jean-Paul Calderone and Sandro Tosi.
2011-01-05 18:44:14 +00:00
Victor Stinner b996f740f2 test_time: assertEquals => assertEqual 2011-01-05 03:58:54 +00:00
Victor Stinner c932b65428 test_threading: use Popen.communicate() instead of .wait()
Popen.communicate() avoids deadlocks and close the pipes when done. This commit
fixes a ResourceWarning(unclosed pipe).
2011-01-05 03:54:28 +00:00
Victor Stinner 4b2b43d988 regrtest: close the new stdout and restore the original stdout at exit
Fix a ResourceWarning(unclosed file).
2011-01-05 03:54:26 +00:00
Victor Stinner 358e11d928 Issue #10756: atexit normalizes the exception before displaying it. 2011-01-05 03:54:25 +00:00
Victor Stinner 29e762c941 test_bytes: test PyBytes_FromFormat() using ctypes 2011-01-05 03:33:28 +00:00
R. David Murray 477efb3944 #10790: make append work when output codec is different from input codec
There's still a bug here (the encode call shouldn't use the 'errors'
paramter), but I'll fix that later.
2011-01-05 01:39:32 +00:00
Victor Stinner ca1e7ec344 test_unicode: use ctypes to test PyUnicode_FromFormat()
Instead of _testcapi.format_unicode() because it has a limited API: it requires
exactly one argument of type unicode.
2011-01-05 00:19:28 +00:00
Antoine Pitrou 1ec121d0d1 Fix test_time under Windows 2011-01-04 22:54:30 +00:00
Antoine Pitrou c99823211b In subprocess, wrap pipe fds before launching the child. Hopefully this
will fix intermittent failures on some buildbots (issue #8458).
2011-01-04 19:07:07 +00:00
Gregory P. Smith 9bd4a245f2 Fix the new bug introduced in the r87710 fix for issue 6643. DummyThread
deletes its _block attribute, deal with that.  This prevents an uncaught
exception in a thread during test_thread.

This refactors a bit to better match what I did in the r87727 backport to 2.7.
2011-01-04 18:33:38 +00:00
Georg Brandl 3fb97ae0f7 Fix exception catching. 2011-01-04 17:27:13 +00:00
Alexander Belopolsky ecebdc7469 Issue #8013: Fix time.ctime test failure on 32-bit platforms. 2011-01-04 17:08:04 +00:00
Alexander Belopolsky b9588b528a Issue #8013: time.asctime and time.ctime no longer call system asctime
and ctime functions.  The year range for time.asctime is now 1900
through maxint.  The range for time.ctime is the same as for
time.localtime.  The string produced by these functions is longer than
24 characters when year is greater than 9999.
2011-01-04 16:34:30 +00:00
Victor Stinner c3a51ecb85 Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
2011-01-04 11:00:45 +00:00
Victor Stinner 8848c7a37f Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
the input buffer length doesn't fit into an unsigned int (length bigger than
2^32-1 bytes).
2011-01-04 02:07:36 +00:00
Victor Stinner b3c9e073fc Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
(length bigger than 2^31-1).
2011-01-04 02:07:34 +00:00
Antoine Pitrou 560f9dab55 Issue #10267: Fix refleak in test_ttk_guionly. Patch by Hirokazu Yamamoto. 2011-01-04 00:24:03 +00:00
Victor Stinner 04ba966eab test_httplib: fix a DeprecationWarning, assertEquals=>assertEqual 2011-01-04 00:04:46 +00:00
Victor Stinner 7a6a0093f3 test_array: fix the DeprecationWarning('object.__init__() takes no parameters') 2011-01-04 00:04:44 +00:00