Commit Graph

22303 Commits

Author SHA1 Message Date
Alexander Belopolsky 7c7c14696b Issue #27834: Avoid overflow error in ZoneInfo.invert(). 2016-08-23 14:44:51 -04:00
Terry Jan Reedy ffcb022738 Issue #27787: No longer call deleted test_main(). 2016-08-23 14:20:37 -04:00
Guido van Rossum 1f5beb7a6e A new version of typing.py from https://github.com/python/typing. (Merge 3.5->3.6) 2016-08-23 11:06:30 -07:00
Guido van Rossum f0666949fd Issue 27598: Add Collections to collections.abc.
Patch by Ivan Levkivskyi, docs by Neil Girdhar.
2016-08-23 10:47:07 -07:00
Steven D'Aprano 9ff4fb3619 Automated merge with ssh://hg.python.org/cpython 2016-08-24 02:40:31 +10:00
Mark Dickinson 4fe9f163af Issue #26040 (part 1): add new testcases to cmath_testcases.txt. Thanks Jeff Allen. 2016-08-23 17:33:54 +01:00
Steven D'Aprano 6877ed3560 Issue #27573 make the exit message configurable. 2016-08-24 01:42:15 +10:00
Mark Dickinson 7caf908c64 Issue #27832: Make _normalize parameter to Fraction.__init__ keyword-only. 2016-08-23 16:16:52 +01:00
Martin Panter 1fa6915427 Issue #27787: Remove test_main() and hard-coded list of test classes
The @reap_threads decorator made the test wait (for up to 1 s) until
background threads have finished.  Calling join() with a timeout should be
equivalent.
2016-08-23 09:01:43 +00:00
Vinay Sajip 9ae505041f Issue #12713: reverted fix pending further discussion. 2016-08-23 08:43:16 +01:00
Victor Stinner ad7b6c3720 Issue #27829: libregrtest.save_env: flush stderr
Use flush=True to try to get a warning which is missing in buildbots.

Use also f-string to make the code shorter.
2016-08-22 14:29:54 +02:00
Victor Stinner ab98367747 Cleanup libregrtest
* main.py: remove unused import
* runtest: simplify runtest_inner() parameters, reuse ns parameter
2016-08-22 14:28:52 +02:00
Mark Dickinson b820d7f631 Issue #27792: force int return type for modulo operations involving bools. 2016-08-22 12:24:46 +01:00
Mark Dickinson 0add84b9b8 Issue #27539: Merge from 3.5. 2016-08-22 10:56:06 +01:00
Mark Dickinson 844796530a Issue #27539: Fix unnormalised Fraction.__pow__ result for negative exponent and base. Thanks Vedran Čačić. 2016-08-22 10:50:53 +01:00
Serhiy Storchaka 54cd1969ea Issue #26984: int() now always returns an instance of exact int. 2016-08-21 20:03:08 +03:00
Nick Coghlan cbcd221de4 Merge #27782 fix from 3.5 2016-08-21 17:43:58 +10:00
Nick Coghlan 8682f578c1 Issue #27782: Fix m_methods handling in multiphase init
Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions
to instances of non-module types returned from ``Py_create_mod``.

Patch by Xiang Zhang.
2016-08-21 17:41:56 +10:00
Martin Panter f9ed528faf Issue #27487: Merge runpy warning from 3.5 2016-08-21 05:07:35 +00:00
Martin Panter 9c8aa9bffe Issue #27487: Warn if submodule already imported before runpy execution
Also try to clarify the find_spec() error message.
2016-08-21 04:07:58 +00:00
Ethan Furman e8e61277ff issue26981: add _order_ compatibility shim to enum.Enum 2016-08-20 07:19:31 -07:00
Martin Panter 4bf6ed556d Issue #27614: Merge test_docxmlrpc from 3.5 2016-08-20 07:39:15 +00:00
Martin Panter 051b2201a7 Issue #27787: Merge regrtest fixup from 3.5 2016-08-20 07:38:21 +00:00
Ethan Furman 332dbc7325 Issue26988: remove AutoEnum 2016-08-20 00:00:52 -07:00
Martin Panter d874c05547 Issue #27614: Avoid race in test_docxmlrpc server setup 2016-08-20 06:50:58 +00:00
Martin Panter 68c1f1ed03 Issue #27787: Clean up weak references before checking for dangling threads 2016-08-20 06:50:14 +00:00
Victor Stinner f2abf5c11a regrtest: replace "Result:" with "Tests result:" 2016-08-19 17:54:25 +02:00
Berker Peksag 53926f19cd Issue #27801: Skip test_update_lines_cols when update_lines_cols() is not available 2016-08-19 17:59:01 +03:00
Berker Peksag fa46aa7899 Issue #27801: Merge from 3.5 2016-08-19 17:59:31 +03:00
Berker Peksag 3f015a64b8 Issue #27157: Make only type() itself accept the one-argument form
Patch by Eryk Sun and Emanuel Barry.
2016-08-19 11:04:07 +03:00
R David Murray c199603853 Merge: #2466: ismount now recognizes mount points user can't access. 2016-08-18 21:31:13 -04:00
R David Murray 750018b91a #2466: ismount now recognizes mount points user can't access.
Patch by Robin Roth, reviewed by Serhiy Storchaka, comment wording
tweaked by me.
2016-08-18 21:27:48 -04:00
Vinay Sajip ef948cd058 Closes #12713: Allowed abbreviation of subcommands in argparse. 2016-08-18 21:23:48 +01:00
Guido van Rossum 97c1adf393 Anti-registration of various ABC methods.
- Issue #25958: Support "anti-registration" of special methods from
  various ABCs, like __hash__, __iter__ or __len__.  All these (and
  several more) can be set to None in an implementation class and the
  behavior will be as if the method is not defined at all.
  (Previously, this mechanism existed only for __hash__, to make
  mutable classes unhashable.)  Code contributed by Andrew Barnert and
  Ivan Levkivskyi.
2016-08-18 09:22:23 -07:00
Victor Stinner 0a6996d87d Merge 3.5 (fix raise) 2016-08-18 18:14:15 +02:00
Victor Stinner eec9331b20 Fix SystemError in "raise" statement
Issue #27558: Fix a SystemError in the implementation of "raise" statement.
In a brand new thread, raise a RuntimeError since there is no active
exception to reraise.

Patch written by Xiang Zhang.
2016-08-18 18:13:10 +02:00
Serhiy Storchaka 989df09db2 Issue #16764: Move NEWS entry to correct section and remove too strict test. 2016-08-18 09:14:47 +03:00
Alexander Belopolsky e09594d5eb Issue #24773: Include Tallinn 1999-10-31 transition in tests.
Does not appear to be a problem anymore and I cannot figure
out why it was skipped in the first place.
2016-08-17 19:56:17 -04:00
Victor Stinner 636860354e regrtest: add a summary of the summary, "Result: xxx"
It's sometimes hard to check quickly if tests succeeded, failed or something
bad happened. I added a final "Result: xxx" line which summarizes all outputs
into a single line, written at the end (it should always be the last line of
the output).
2016-08-17 16:12:16 +02:00
Victor Stinner c5a01f8551 regrtest: set interrupted to True if re-run is interrupted 2016-08-17 16:00:12 +02:00
Victor Stinner 8f00319294 regrtest: add newlines in output for readability 2016-08-17 15:42:21 +02:00
Victor Stinner 798d7fbad4 Merge 3.5 (script_helper) 2016-08-17 12:38:35 +02:00
Victor Stinner 7e6977a8bc script_helper: kill the subprocess on error
If Popen.communicate() raises an exception, kill the child process to not leave
a running child process in background and maybe create a zombi process.

This change fixes a ResourceWarning in Python 3.6 when unit tests are
interrupted by CTRL+c.
2016-08-17 12:29:58 +02:00
Victor Stinner 435eaf4422 regrtest: nicer output for durations
Use milliseconds and minutes units, not only seconds.
2016-08-17 12:22:52 +02:00
Victor Stinner 6c44619ece regrtest: rename --slow option to --slowest
Thanks to optparse, --slow syntax still works ;-)
2016-08-17 11:25:43 +02:00
Victor Stinner 717a32b755 Fix typo in test_time.py 2016-08-17 11:07:21 +02:00
Victor Stinner e3f1e8a9d3 Issue #27181: Skip tests known to fail until a fix is found 2016-08-16 22:22:21 +02:00
Raymond Hettinger 6538b430cf Issue #25628: Make namedtuple "rename" and "verbose" parameters keyword-only. 2016-08-16 10:55:43 -07:00
Benjamin Peterson cc2e80be64 merge 3.5 2016-08-15 21:44:06 -07:00
Benjamin Peterson b1c6bdc76a merge 3.4 2016-08-15 21:43:57 -07:00
Benjamin Peterson 432ea4ff37 fail when negative values are passed to instr() 2016-08-15 21:40:14 -07:00
Terry Jan Reedy f35bb9e1e9 Issue #27611, #24137: Only change tkinter when easily restored. 2016-08-16 00:10:14 -04:00
Guido van Rossum 0a891d70de Issue #12345: Add mathemathcal constant tau to math and cmath.
Patch by Lisa Roach. See also PEP 628.
2016-08-15 09:12:52 -07:00
Serhiy Storchaka 15f3228b7c Issue #16764: Support keyword arguments to zlib.decompress(). Patch by
Xiang Zhang.
2016-08-15 10:06:16 +03:00
Nick Coghlan d00342347e Issue #26823: Abbreviate recursive tracebacks
Large sections of repeated lines in tracebacks are now abbreviated as
"[Previous line repeated {count} more times]" by both the traceback
module and the builtin traceback rendering.

Patch by Emanuel Barry.
2016-08-15 13:11:34 +10:00
Steven D'Aprano dd51d16b48 Issue27573 code.interact prints a message when exiting. 2016-08-15 04:14:33 +10:00
Steven D'Aprano 09f4f711b6 Issue6422 add autorange method to timeit.Timer 2016-08-15 01:27:03 +10:00
Benjamin Peterson c0654d4e60 merge 3.5 2016-08-13 18:21:32 -07:00
Benjamin Peterson f17a8e9acd merge 3.4 2016-08-13 18:21:16 -07:00
Benjamin Peterson 40a77c3381 do not allow reading negative values with getstr() 2016-08-13 18:15:28 -07:00
Alexander Belopolsky 10c2dd216a Issue #24773: Skip system tests for transitions in year 2037 and later. 2016-08-12 19:08:15 -04:00
Brett Cannon 4a2360d3f7 Issue #25805: Skip a test for test_pkgutil when __name__ == __main__.
Thanks to SilentGhost for the patch.
2016-08-12 10:53:53 -07:00
Martin Panter 51ad4cfad3 Issue #26741: Merge ResourceWarning fixes from 3.5 2016-08-12 12:04:27 +00:00
Martin Panter 3cf0b2515b Issue #26741: Clean up subprocess.Popen object in test_poll 2016-08-12 11:59:52 +00:00
Martin Panter b63c56077f Close HTTP connections and responses in tests to avoid ResourceWarnings 2016-08-12 11:59:52 +00:00
Alexander Belopolsky 1b8f26c2ed Issue #24773: Fix and speed-up ZoneInfoCompleteTest.
* Read the zone.tab file for the list of zones to exclude
  the aliases.
  * Skip Casablanca and El_Aaiun October 2037 transitions.
2016-08-11 11:01:45 -04:00
Martin Panter 83545f1c76 Merge ISO-8859 fixes from 3.5 2016-08-10 07:00:33 +00:00
Martin Panter 540f0451d2 Correct misspellings of ISO-8859 2016-08-10 05:25:16 +00:00
Vinay Sajip 085e806798 Closes #21999: Handled empty strings correctly when in POSIX mode. 2016-08-09 15:04:49 +01:00
Steven D'Aprano 9a2be91c6b Issue27181 add geometric mean. 2016-08-09 13:58:10 +10:00
Steven D'Aprano e7fef52f98 Tighten up test of harmonic mean on a single value. 2016-08-09 13:19:48 +10:00
Steven D'Aprano 3e8616abcd Automated merge with ssh://hg.python.org/cpython 2016-08-09 12:49:20 +10:00
Steven D'Aprano a474afdddc Add harmonic mean and tests. 2016-08-09 12:49:01 +10:00
Alexander Belopolsky 47649ab1f1 Closes #27710: Disallow fold not in [0, 1] in time and datetime constructors. 2016-08-08 17:05:40 -04:00
Gregory P. Smith 50abe877ee Issue #27664: Add to concurrent.futures.thread.ThreadPoolExecutor()
the ability to specify a thread name prefix.
2016-08-07 10:19:20 -07:00
Serhiy Storchaka febc332056 Issue #26754: Undocumented support of general bytes-like objects
as path in compile() and similar functions is now deprecated.
2016-08-06 23:29:29 +03:00
Serhiy Storchaka d73c31899e Issue #26800: Undocumented support of general bytes-like objects
as paths in os functions is now deprecated.
2016-08-06 23:22:08 +03:00
Vinay Sajip fd0f84bd8f Closes #22829: Added --prompt option to venv. 2016-08-06 10:43:44 +01:00
Ethan Furman 73fc586d9f Add AutoEnum: automatically provides next value if missing. Issue 26988. 2016-08-05 16:03:16 -07:00
Martin Panter 02b75abf73 Merge spelling and grammar fixes from 3.5 2016-08-05 01:51:39 +00:00
Martin Panter 69332c1a64 Fix spelling and grammar in documentation and code comments 2016-08-04 13:07:31 +00:00
Alexander Belopolsky 43746c3770 Closes #27661: Added tzinfo keyword argument to datetime.combine. 2016-08-02 17:49:30 -04:00
Senthil Kumaran cde03fa038 [merge from 3.5] - Prevent HTTPoxy attack (CVE-2016-1000110)
Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
indicates that the script is in CGI mode.

Issue #27568 Reported and patch contributed by Rémi Rampin.
2016-07-30 23:51:13 -07:00
Senthil Kumaran 17742f2d45 [merge from 3.4] - Prevent HTTPoxy attack (CVE-2016-1000110)
Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
indicates that the script is in CGI mode.

Issue #27568 Reported and patch contributed by Rémi Rampin.
2016-07-30 23:39:06 -07:00
Senthil Kumaran 436fe5a447 [merge from 3.3] Prevent HTTPoxy attack (CVE-2016-1000110)
Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
indicates that the script is in CGI mode.

Issue #27568 Reported and patch contributed by Rémi Rampin.
2016-07-30 23:34:34 -07:00
Senthil Kumaran 4cbb23f8f2 Prevent HTTPoxy attack (CVE-2016-1000110)
Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
indicates that the script is in CGI mode.

Issue #27568 Reported and patch contributed by Rémi Rampin.
2016-07-30 23:24:16 -07:00
Alexander Belopolsky 07e2a0aba9 Issue 24773: Use the standard Asia/Tehran name in the Iran test. 2016-07-30 11:41:02 -04:00
Berker Peksag 01d1719062 Issue #27366: Tweak PEP 487 documentation
* Added versionadded directives
* Deleted duplicate sentence from __init_subclass__ docstring
* Modernized tests
2016-07-30 14:06:15 +03:00
Nick Coghlan d78448e912 Issue #27366: Implement PEP 487
- __init_subclass__ called when new subclasses defined
- __set_name__ called when descriptors are part of a
  class definition
2016-07-30 16:26:03 +10:00
Vinay Sajip c1f974c944 Closes #1521950: Made shlex parsing more shell-like. 2016-07-29 22:35:03 +01:00
Martin Panter 263893c261 Issue #27626: Further spelling fixes for 3.6 2016-07-28 01:25:31 +00:00
Martin Panter 8bde911115 Issue #27626: Merge spelling fixes from 3.5 2016-07-28 01:30:58 +00:00
Martin Panter eb9957065a Issue #27626: Spelling fixes in docs, comments and internal names
Based on patch by Ville Skyttä.
2016-07-28 01:11:04 +00:00
Alexander Belopolsky 611adf2466 Issue #24773: Fixed tests failures on systems with 32-bit time_t.
Several 32-bit systems have issues with transitions in the year
2037. This is a bug in the system C library since time_t does not
overflow until 2038, but let's skip tests starting from 2037 to work
around those bugs.
2016-07-26 12:23:16 -04:00
Terry Jan Reedy 43b17134e9 Issue #24137, issue #27611: Restore tkinter after test_idle. 2016-07-25 00:31:54 -04:00
Martin Panter b93d8637a6 Issue #1621: Avoid signed overflow in list and tuple operations
Patch by Xiang Zhang.
2016-07-25 02:39:20 +00:00
Alexander Belopolsky 95f7b9fcac Issue 24773: Make zoneinfo tests more robust. (reapply) 2016-07-24 20:36:55 -04:00
Alexander Belopolsky cd28013d00 Reindented Lib/test/datetimetester.py. 2016-07-24 14:41:08 -04:00
Alexander Belopolsky 4719ae7567 Issue #24773: Made ZoneInfoCompleteTest a TestSuit.
This should improve the diagnostic and progress reports.
2016-07-24 14:39:28 -04:00
Alexander Belopolsky 8dadb2155b Issue 24773: Make zoneinfo tests more robust. 2016-07-23 11:16:56 -04:00