Commit Graph

18188 Commits

Author SHA1 Message Date
Larry Hastings 2a727916c5 Issue #20226: Major improvements to Argument Clinic.
* You may now specify an expression as the default value for a
  parameter!  Example: "sys.maxsize - 1".  This support is
  intentionally quite limited; you may only use values that
  can be represented as static C values.
* Removed "doc_default", simplified support for "c_default"
  and "py_default".  (I'm not sure we still even need
  "py_default", but I'm leaving it in for now in case a
  use presents itself.)
* Parameter lines support a trailing '\\' as a line
  continuation character, allowing you to break up long lines.
* The argument parsing code generated when supporting optional
  groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize,
  leading to a 850% speedup in parsing.  (Just kidding, this
  is an unmeasurable difference.)
* A bugfix for the recent regression where the generated
  prototype from pydoc for builtins would be littered with
  unreadable "=<object ...>"" default values for parameters
  that had no default value.
* Converted some asserts into proper failure messages.
* Many doc improvements and fixes.
2014-01-16 11:32:01 -08:00
Serhiy Storchaka 7f470d0f9c Issue #19936: Remove executable bits from C source files and several forgotten
test files.
2014-01-16 18:48:45 +02:00
Serhiy Storchaka 8f8ec92de8 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang lines in the unittestgui and checkpip scripts.
2014-01-16 17:33:23 +02:00
Serhiy Storchaka b992a0e102 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang line to use python3 executable in the unittestgui script.
2014-01-16 17:15:49 +02:00
Ronald Oussoren 6db6653bbc Issue #14455: Fix some issues with plistlib
* Negative integer support in binary plists was broken

* Better exception for invalid data

* Fix the versionadded/versionchanged markup in the documentation

* Add the interface cleanup to what's new for 3.4
2014-01-15 11:32:35 +01:00
Benjamin Peterson 60ea92883f merge 3.3 2014-01-14 00:29:03 -05:00
Benjamin Peterson bd1d12e61b add test for #20251 2014-01-14 00:27:42 -05:00
Benjamin Peterson c6b37e21f5 merge 3.3 (#20246) 2014-01-13 23:14:42 -05:00
Benjamin Peterson 5688222907 merge 3.2 (#20246) 2014-01-13 23:12:55 -05:00
Benjamin Peterson fbf648ebba complain when nbytes > buflen to fix possible buffer overflow (closes #20246) 2014-01-13 22:59:38 -05:00
Vinay Sajip 30e6a64e76 Closes #20242: Merged fix from 3.3. 2014-01-13 22:01:16 +00:00
Vinay Sajip 1fd1202072 Issue #20242: Fixed basicConfig() format strings for the alternative formatting styles. 2014-01-13 21:59:56 +00:00
R David Murray 44fcaae90d Merge #20206, #5803: more efficient algorithm that doesn't truncate output.
(No idea why test_tarfile is listed as changed...it isn't.)
2014-01-13 13:30:13 -05:00
R David Murray 2313e15578 #20206, #5803: more efficient algorithm that doesn't truncate output.
This fixes an edge case (20206) where if the input ended in a character
needing encoding but there was no newline on the string, the last byte
of the encoded character would be dropped.  The fix is to use a more
efficient algorithm, provided by Serhiy Storchaka (5803), that does not
have the bug.
2014-01-13 13:19:21 -05:00
Serhiy Storchaka f22fe0f507 Test the open of non-exitent tarfile in all modes. 2014-01-13 19:08:00 +02:00
Serhiy Storchaka 2a3d7d1af7 Test the open of non-exitent tarfile in all modes. 2014-01-13 19:07:33 +02:00
Ethan Furman a70805e1fa Issue19995: fixed typo; switched from test.support.check_warnings to assertWarns 2014-01-12 08:42:35 -08:00
Serhiy Storchaka 61dab6e3fa Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri()
functions now conform to PEP 3333 when handle non-ASCII URLs.
2014-01-12 12:09:38 +02:00
Serhiy Storchaka 0abbe8c090 Issue #20138: The wsgiref.application_uri() and wsgiref.request_uri()
functions now conform to PEP 3333 when handle non-ASCII URLs.
2014-01-12 12:08:11 +02:00
Ethan Furman f9bba9c67f Issue19995: issue deprecation warning for non-integer values to %c, %o, %x, %X 2014-01-11 23:20:58 -08:00
Senthil Kumaran d87346c0ce merge from 3.3
Issue #19092 - Raise a correct exception when cgi.FieldStorage is given an
invalid file-obj. Also use __bool__ to determine the bool of the FieldStorage
object.
2014-01-11 22:22:21 -08:00
Senthil Kumaran b4cbb92fbe Issue #19092 - Raise a correct exception when cgi.FieldStorage is given an
invalid file-obj. Also use __bool__ to determine the bool of the FieldStorage
object.
2014-01-11 22:20:16 -08:00
Victor Stinner 5e42354263 Fix ResourceWarning in test_asyncio.test_windows_events:
close the write end of the socket pair
2014-01-11 00:16:50 +01:00
Guido van Rossum 02757ea7e9 asyncio: Minimal pty support in UNIX read pipe, by Jonathan Slenders. 2014-01-10 13:30:04 -08:00
Serhiy Storchaka 50471db565 Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
2014-01-10 15:08:07 +02:00
Serhiy Storchaka cce440fab8 Issue #19804: The test_find_mac test in test_uuid is now skipped if the
ifconfig executable is not available.
2014-01-10 15:06:59 +02:00
Serhiy Storchaka 786ac7b27d Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
2014-01-10 13:39:27 +02:00
Serhiy Storchaka 4847e4e1f4 Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
2014-01-10 13:37:54 +02:00
Antoine Pitrou eb16804216 assertEquals is deprecated, use assertEqual instead. 2014-01-10 00:02:38 +01:00
Serhiy Storchaka 123e6d5b4b Issue #13107: argparse and optparse no longer raises an exception when output
a help on environment with too small COLUMNS.  Based on patch by
Elazar Gershuni.
2014-01-09 23:18:41 +02:00
Serhiy Storchaka f451112413 Issue #13107: argparse and optparse no longer raises an exception when output
a help on environment with too small COLUMNS.  Based on patch by
Elazar Gershuni.
2014-01-09 23:14:27 +02:00
Antoine Pitrou ba44860c11 Try to fix test_ssl failures on some buildbots 2014-01-09 21:30:17 +01:00
Antoine Pitrou 32c4915b23 Try to fix test_ssl failures on some buildbots 2014-01-09 21:28:48 +01:00
Antoine Pitrou 78ace81c93 Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly asked for. 2014-01-09 20:09:03 +01:00
Antoine Pitrou cd3d7cabef Issue #20207: Always disable SSLv2 except when PROTOCOL_SSLv2 is explicitly asked for. 2014-01-09 20:02:20 +01:00
Serhiy Storchaka 5940b92909 Do not reset the line number because we already set file position to correct
value.

(fixes error in patch for issue #18960)
2014-01-09 20:13:52 +02:00
Serhiy Storchaka 1064a13bb0 Do not reset the line number because we already set file position to correct
value.

(fixes error in patch for issue #18960)
2014-01-09 20:12:49 +02:00
Benjamin Peterson a118c4fa79 merge 3.3 2014-01-09 11:12:31 -06:00
Benjamin Peterson 50b82c765f clear zip stat cache after each ref leak run 2014-01-09 11:10:30 -06:00
Serhiy Storchaka 7282ff6d5b Issue #18960: Fix bugs with Python source code encoding in the second line.
* The first line of Python script could be executed twice when the source
encoding (not equal to 'utf-8') was specified on the second line.

* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment.

* As a consequence, 'python -x' works now again with files with the source
encoding declarations specified on the second file, and can be used again
to make Python batch files on Windows.

* The tokenize module now ignore the source encoding declaration on the second
line if the first line contains anything except a comment.

* IDLE now ignores the source encoding declaration on the second line if the
first line contains anything except a comment.

* 2to3 and the findnocoding.py script now ignore the source encoding
declaration on the second line if the first line contains anything except
a comment.
2014-01-09 18:41:59 +02:00
Serhiy Storchaka 768c16ce02 Issue #18960: Fix bugs with Python source code encoding in the second line.
* The first line of Python script could be executed twice when the source
encoding (not equal to 'utf-8') was specified on the second line.

* Now the source encoding declaration on the second line isn't effective if
the first line contains anything except a comment.

* As a consequence, 'python -x' works now again with files with the source
encoding declarations specified on the second file, and can be used again
to make Python batch files on Windows.

* The tokenize module now ignore the source encoding declaration on the second
line if the first line contains anything except a comment.

* IDLE now ignores the source encoding declaration on the second line if the
first line contains anything except a comment.

* 2to3 and the findnocoding.py script now ignore the source encoding
declaration on the second line if the first line contains anything except
a comment.
2014-01-09 18:36:09 +02:00
Serhiy Storchaka 69fdbf9cb0 Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
2014-01-09 14:53:41 +02:00
Serhiy Storchaka 5ce3f10aee Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
2014-01-09 14:50:20 +02:00
Victor Stinner 6f17deb9bb (Merge 3.3) Issue #20113: Fix test_posix on OpenIndiana 2014-01-08 16:01:42 +01:00
Victor Stinner cd5ca6a564 Issue #20113: Fix test_posix on OpenIndiana 2014-01-08 16:01:31 +01:00
Victor Stinner 149e540adf (Merge 3.3) Issue #20113: os.readv() and os.writev() now raise an OSError
exception on error instead of returning -1.
2014-01-08 15:26:12 +01:00
Victor Stinner 57ddf78b6b Issue #20113: os.readv() and os.writev() now raise an OSError exception on
error instead of returning -1.
2014-01-08 15:21:28 +01:00
Gregory P. Smith 2e385e2592 Fixes issue #19081: When a zipimport .zip file in sys.path being imported from
is modified during the lifetime of the Python process after zipimport has
already cached the zip's table of contents we detect this and recover
rather than read bad data from the .zip (causing odd import errors).
2014-01-07 18:34:23 -08:00
Gregory P. Smith 2bcbc14117 Fixes Issue #19081: When a zipimport .zip file in sys.path being imported from
is modified during the lifetime of the Python process after zipimport has
already cached the zip's table of contents we detect this and recover
rather than read bad data from the .zip (causing odd import errors).
2014-01-07 18:30:07 -08:00
Brett Cannon 8d942296bb Issue #19719: Update various finder and loader ABCs such that their
old methods now provide implementations when PEP 451 APIs are present.

This should help with backwards-compatibility with code which has not
been updated to work with PEP 451.
2014-01-07 15:52:42 -05:00
Larry Hastings 16c5191ab3 Issue #20144: Argument Clinic now supports simple constants as parameter
default values.  inspect.Signature correspondingly supports them in
__text_signature__ fields for builtins.
2014-01-07 11:53:01 -08:00
Victor Stinner cc26310e2e Issue #20162: test_hash_distribution() uses subTest() to mention the prefix in
the error message.
2014-01-07 14:40:51 +01:00
Eric Snow 1500d49c22 Issue 19713: Add PEP 451-related deprecations. 2014-01-06 20:49:04 -07:00
Eric Snow 3a62d14b24 Issue #19703: Update pydoc to use the new importer APIs. 2014-01-06 20:42:59 -07:00
Eric Snow 3192eac6cf Remove dead PEP 451 code. 2014-01-06 20:38:16 -07:00
Ethan Furman df3ed242c0 Issue19995: %o, %x, %X now only accept ints 2014-01-05 06:50:30 -08:00
Eric Snow 5ea97506a2 Issue 20123: Disable a problematic test. 2014-01-04 23:04:27 -07:00
Eric Snow 0dddf4258a Issue 20123: try using a different builtin module in a pydoc test.
The test is failing on one of the stable FreeBSD buildbots.  It seems
unlikely that the gc module would not be available, so switching to
_imp may not fix the problem.
2014-01-04 21:56:07 -07:00
Eric Snow aed5b22ead Issue 20123: Fix pydoc.synopsis() for "binary" modules.
Also add missing tests to test_pydoc.
2014-01-04 20:38:11 -07:00
Eric Snow 37148b27ac Issue #19708: Update pkgutil to use the new importer APIs. 2014-01-04 15:09:53 -07:00
Eric Snow 335e14dd1a Issue #19713: Move away from using find_module/load_module. 2014-01-04 15:09:28 -07:00
Eric Snow d749c7ae68 Issue #19927: Add __eq__ to path-based loaders in importlib. 2014-01-04 15:06:49 -07:00
Martin v. Löwis 24e43308b7 * Issue #16113: Remove sha3 module again.
Patch by Christian Heimes, with modifications.
2014-01-03 14:05:06 +01:00
Eric Snow fbc785188d Issue #20097: Fix bad use of "self" in importlib's WindowsRegistryFinder. 2014-01-02 22:25:00 -07:00
Victor Stinner daeffd2c08 audioop: adpcm2lin() and lin2adpcm() now raises a TypeError instead of a
SystemError if the state type is invalid.
2014-01-03 03:26:47 +01:00
Antoine Pitrou 1b02da95d2 Issue #20111: pathlib.Path.with_suffix() now sanity checks the given suffix. 2014-01-03 00:07:17 +01:00
Zachary Ware 393a94243f Issue #20101: Merge with 3.3 2014-01-02 09:43:09 -06:00
Zachary Ware 487aedb77c Issue #20101: Allow test_monotonic to pass on Windows machines on which
time.get_clock_info('monotonic').resolution == 0.015600099999999999

This is just a workaround pending a real resolution to #20101.
2014-01-02 09:41:10 -06:00
Donald Stufft f7f58f8db5 Update pip to the released 1.5 2014-01-02 09:33:35 -05:00
Victor Stinner 009771ee6b (Merge 3.3) Issue #18829: Add tests for the csv module for invalid characters
(delimiter, escapechar, quotechar)
2014-01-02 12:53:50 +01:00
Victor Stinner 6a31b0fa19 Issue #18829: Add tests for the csv module for invalid characters (delimiter,
escapechar, quotechar)
2014-01-02 12:53:13 +01:00
Antoine Pitrou b672888092 Issue #20055: Fix test_shutil under Windows with symlink privileges held.
Patch by Vajrasky Kok.
2014-01-01 02:51:58 +01:00
Antoine Pitrou 3f48ac98c0 Issue #20055: Fix test_shutil under Windows with symlink privileges held.
Patch by Vajrasky Kok.
2014-01-01 02:50:45 +01:00
Zachary Ware efa2e04033 Issue19619: skip zlib error test when zlib not available 2013-12-30 14:54:11 -06:00
Senthil Kumaran b6fac245b5 Backporing the fix from Issue #12692 2013-12-28 17:36:18 -08:00
Antoine Pitrou 3e86ba4e32 Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl module, rather than silently let them emit clear text data. 2013-12-28 17:26:33 +01:00
Antoine Pitrou 156b3610b8 Issue #19918: Fix PurePath.relative_to() under Windows. 2013-12-28 19:49:04 +01:00
Antoine Pitrou e6d2f159fc Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl module, rather than silently let them emit clear text data. 2013-12-28 17:30:51 +01:00
Antoine Pitrou c1764dd350 Issue #19648: implement empty tests in pickletester. Patch by Gennadiy Zlobin. 2013-12-28 16:57:37 +01:00
R David Murray ecff5e51a5 #18116: backport fix to 3.3 since real-world failure mode demonstrated.
In issue 20074 it was pointed out that getpass would fail with a traceback if
stdin was, for example /dev/null, which is a non-unlikely scenario.

Also backported the tests from issue 17484 as modified by issue 18116.

(What I really did was copy getpass.py and test_getpass.py from their
state on tip as of 17bd04fbf3d3).
2013-12-27 11:24:32 -05:00
Serhiy Storchaka 8c4f57d1d5 Issue #20046: Locale alias table no longer contains entities which can be
calculated.  Generalized support of the euro modifier.
2013-12-27 00:56:53 +02:00
Serhiy Storchaka e190fac5f9 Issue #20027: Fixed locale aliases for devanagari locales. 2013-12-26 21:21:52 +02:00
Serhiy Storchaka 5eb01530b2 Issue #20027: Fixed locale aliases for devanagari locales. 2013-12-26 21:20:59 +02:00
doko@ubuntu.com e575148cc2 - Issue #20070: Don't run test_urllib2net when network resources are not
enabled.
2013-12-26 17:37:11 +01:00
Zachary Ware bb4b7c12fa Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
disabled since 3.0 due to the changes in listcomp handling.
2013-12-26 09:55:24 -06:00
Zachary Ware e80e806b3a Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been
disabled since 3.0 due to the changes in listcomp handling.
2013-12-26 09:53:49 -06:00
Serhiy Storchaka cb131948fe Issue #19320: test_tcl no longer fails when wantobjects is false. 2013-12-25 17:29:41 +02:00
Serhiy Storchaka cc4290bf91 Issue #19320: test_tcl no longer fails when wantobjects is false. 2013-12-25 17:29:01 +02:00
Nick Coghlan ae2ee96ad7 Issue #19744: improve ensurepip error when ssl is missing 2013-12-23 23:07:07 +10:00
Nick Coghlan f71cae0a93 Issue #19728: fix ensurepip name clash with submodule
Also added refactoring and added basic tests for the argument
parsing in both ensurepip._main and ensurepip._uninstall._main.
2013-12-23 18:20:34 +10:00
Nick Coghlan 23f597e462 Further increase tolerance for slow buildbots 2013-12-23 18:17:20 +10:00
Nick Coghlan ed9af52ff0 Issue #19734: ignore pip env vars in ensurepip._uninstall 2013-12-23 17:39:12 +10:00
Nick Coghlan 6256fcbc97 Close #19734: ignore pip env vars in ensurepip 2013-12-23 16:16:07 +10:00
Benjamin Peterson eaedaeccf2 update Barry's email (#19563) 2013-12-22 19:45:38 -06:00
Benjamin Peterson 8fb007f329 merge 3.3 (#19563) 2013-12-22 19:45:53 -06:00
Antoine Pitrou 492b9893e1 Fix DeprecationWarnings in test suite 2013-12-21 22:19:46 +01:00
Antoine Pitrou 2b7f69851d Issue #18879: When a method is looked up on a temporary file, avoid closing the file before the method is possibly called. 2013-12-21 22:16:19 +01:00
Antoine Pitrou 17c93260a6 Issue #18879: When a method is looked up on a temporary file, avoid closing the file before the method is possibly called. 2013-12-21 22:14:56 +01:00
Christian Heimes 266772abe9 merge 2013-12-21 16:19:57 +01:00
Christian Heimes af01f66817 Issue #16136: Remove VMS support and VMS-related code 2013-12-21 16:19:10 +01:00