Commit Graph

43820 Commits

Author SHA1 Message Date
Anthony Sottile 995d9b9297 bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021) 2019-01-13 13:05:13 +09:00
Serhiy Storchaka f1ec3cefad
bpo-35634: Raise an error when first passed kwargs contains duplicated keys. (GH-11438) 2019-01-12 10:12:24 +02:00
Serhiy Storchaka 58159ef856
bpo-35494: Improve syntax error messages for unbalanced parentheses in f-string. (GH-11161) 2019-01-12 09:46:50 +02:00
Serhiy Storchaka 44cc4822bb
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.
2019-01-12 09:22:29 +02:00
Ammar Askar cb08a71c5c bpo-34838: Use subclass_of for math.dist. (GH-9659)
Argument clinic now generates fast inline code for
positional parsing, so the manually implemented type
check in math.dist can be removed.
2019-01-12 08:23:41 +02:00
Serhiy Storchaka 2a39d251f0
bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)
Use _PyArg_CheckPositional() and inlined code instead of
PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters
are positional and use the "object" converter.
2019-01-11 18:01:42 +02:00
Serhiy Storchaka 4fa9591025
bpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313) 2019-01-11 16:01:14 +02:00
Pablo Galindo c5dc60ea85 bpo-24746: Fix doctest failures when running the testsuite with -R (#11501) 2019-01-10 06:29:40 -08:00
Victor Stinner fb2c3465f0
asyncio: __del__() keep reference to warnings.warn (GH-11491)
* asyncio: __del__() keep reference to warnings.warn

The __del__() methods of asyncio classes now keep a strong reference
to the warnings.warn() to be able to display the ResourceWarning
warning in more cases. Ensure that the function remains available if
instances are destroyed late during Python shutdown (while module
symbols are cleared).

* Rename warn parameter to _warn

"_warn" name is a hint that it's not the regular warnings.warn()
function.
2019-01-10 11:24:40 +01:00
Victor Stinner 9b07681c09
IocpProactor: prevent modification if closed (GH-11494)
* _wait_for_handle(), _register() and _unregister() methods of
  IocpProactor now raise an exception if closed
* Add "closed" to IocpProactor.__repr__()
* Simplify IocpProactor.close()
2019-01-10 11:23:26 +01:00
Miro Hrončok a306bdd39f Distutils no longer needs to remain compatible with 2.3 (GH-11423) 2019-01-10 10:55:03 +11:00
Sanyam Khurana cbb1645993 bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639) 2019-01-09 05:38:38 -08:00
Vladimir Matveev c24c6c2c93 bpo-35568: add 'raise_signal' function (GH-11335)
As in title, expose C `raise` function as `raise_function` in `signal` module. Also drop existing `raise_signal` in `_testcapi` module and replace all usages with new function.


https://bugs.python.org/issue35568
2019-01-08 01:58:25 -08:00
Victor Stinner 80fda712c8
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
bpo-32622, bpo-35682: Fix asyncio.ProactorEventLoop.sendfile(): don't
attempt to set the result of an internal future if it's already done.

Fix asyncio _ProactorBasePipeTransport._force_close(): don't set the
result of _empty_waiter if it's already done.
2019-01-08 02:46:59 +01:00
Victor Stinner ddd7c422fd
bpo-33717: pythoninfo logs information of all clocks (GH-11460)
test.pythoninfo now logs information of all clocks, not only time.time() and
time.perf_counter().
2019-01-08 01:27:27 +01:00
Victor Stinner df8e1fb4e3
bpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)
test_asyncio/test_sendfile.py now resets the event loop policy using
tearDownModule() as done in other tests, to prevent a warning when
running tests on Windows.
2019-01-07 23:55:57 +01:00
Raymond Hettinger 2d53bed79c
bpo-35664: Optimize operator.itemgetter (GH-11435) 2019-01-07 09:38:41 -07:00
Xtreak 3f7983a25a bpo-35560: Remove assertion from format(float, "n") (GH-11288)
Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.
2019-01-07 16:09:14 +01:00
cclauss a0bb51e44c test_threading_local: add missing "import sys" (GH-8049) 2019-01-06 23:10:55 +01:00
Cheryl Sabella 11303dd603 bpo-35660: Fix imports in idlelib.window (#11434)
* bpo-35660: IDLE: Remove * import from window.py

* sys was being imported through the *, so also added an import sys.

* Update 2019-01-04-19-14-29.bpo-35660.hMxI7N.rst

Anyone who wants details can check the issue, where I added the point about the sys import bug.
2019-01-06 15:55:52 -05:00
Anthony Shaw 83da926b89 bpo-35488: Add tests for ** glob matching in pathlib (GH-11171) 2019-01-06 12:31:29 -08:00
Vladimir Matveev 67ba547cf0 bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274) 2019-01-05 22:44:59 +02:00
Emmanuel Arias ab54b9a130 bpo-35641: IDLE - format calltip properly when no docstring (GH-11415) 2019-01-03 02:47:58 -05:00
Terry Jan Reedy aff0adabf3
bpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395) 2019-01-02 22:04:06 -05:00
Serhiy Storchaka 830ddc74c4
Revert "bpo-35603: Escape table header of make_table output that can cause potential XSS. (GH-11341)" (GH-11356)
This reverts commit 78de01198b.
2019-01-02 14:49:25 +02:00
Stefan Behnel 3a374e0c5a bpo-35588: Speed up mod, divmod and floordiv operations for Fraction type (#11322)
* bpo-35588: Implement mod and divmod operations for Fraction type by spelling out the numerator/denominator calculation, instead of instantiating and normalising Fractions along the way. This speeds up '%' and divmod() by 2-3x.

* bpo-35588: Also reimplement Fraction.__floordiv__() using integer operations to make it ~4x faster.

* Improve code formatting.

Co-Authored-By: scoder <stefan_ml@behnel.de>

* bpo-35588: Fix return type of divmod(): the result of the integer division should be an integer.

* bpo-35588: Further specialise __mod__() and inline the original helper function _flat_divmod() since it's no longer reused.

* bpo-35588: Add some tests with large numerators and/or denominators.

* bpo-35588: Use builtin "divmod()" function for implementing __divmod__() in order to simplify the implementation, even though performance results are mixed.

* Rremove accidentally added empty line.

* bpo-35588: Try to provide more informative output on test failures.

* bpo-35588: Improve wording in News entry.

Co-Authored-By: scoder <stefan_ml@behnel.de>

* Remove stray space.
2019-01-02 14:22:06 +02:00
Cheryl Sabella b4ea8bb080 bpo-35598: IDLE - Globalize some config_key objects (GH-11392)
Move translate_key() and constant tuples to module level.
Inline the remnant one-line function.
2018-12-31 15:06:35 -05:00
Serhiy Storchaka 052b2dfdc9
bpo-32492: Tweak _collections._tuplegetter. (GH-11367)
* Replace the docstrings cache with sys.intern().
* Improve tests.
* Unify names of tp_descr_get and tp_descr_set functions.
2018-12-31 14:15:16 +02:00
Serhiy Storchaka 5c117dd227
bpo-35609: Remove examples for deprecated decorators in the abc module. (GH-11355) 2018-12-31 09:56:21 +02:00
sth 7108aab49c Fix typo in test module usage message (GH-11374)
A minor typo in the output of `python -m test -h`.
A space was missing in between two words.
howmuch -> how much
2018-12-30 21:41:39 -08:00
Sanyam Khurana b539cef31c bpo-35614: Fix pydoc help() on metaclasses (#11357) 2018-12-31 15:14:47 +10:00
Gregory P. Smith e5796c42c6
bpo-35214: Skip test_io tests that'd cause a huge malloc under msan (#11385)
* skip test_constructor under msan.

* fix the others as well.

* reuse existing related news entry.

* typo fix
2018-12-30 20:17:57 -08:00
Gregory P. Smith d6f45b23a5
Fix typos in test_faulthandler skipIfs for ubsan. (GH-11386) 2018-12-30 20:15:41 -08:00
Gregory P. Smith 30e023256a
Cleanup test_faulthandler sanitizer skip logic. (GH-11381)
Also skip the same tests when using the undefined behavior sanitizer
as they much with the output.

Updates a regex in another test to use multi-line mode so that the ubsan
buildbot should pass again rather than also adding a skip to that one.
2018-12-30 18:09:26 -08:00
Gregory P. Smith b474e6774d
bpo-35214: MSan workarounds for socket, time, and test_faulthandler. (GH-11375)
Add Clang Memory Sanitizer build instrumentation to work around
false positives from the socket and time modules as well as skipping
a couple test_faulthandler tests.
2018-12-30 17:05:36 -08:00
Cheryl Sabella 4bd79c38ef bpo-35598: IDLE: Switch config_key dialog to ttk widgets (GH-11365) 2018-12-30 14:48:51 -05:00
Pablo Galindo 3f5fc70c62 bpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path (#10495)
* bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path

* Add News entry

* fixup! bpo-32492: 2.5x speed up in namedtuple attribute access using C fast path

* Check for tuple in the __get__ of the new descriptor and don't cache the descriptor itself

* Don't inherit from property. Implement GC methods to handle __doc__

* Add a test for the docstring substitution in descriptors

* Update NEWS entry to reflect time against 3.7 branch

* Simplify implementation with argument clinic, better error messages, only __new__

* Use positional-only parameters for the __new__

* Use PyTuple_GET_SIZE and PyTuple_GET_ITEM to tighter the implementation of tuplegetterdescr_get

* Implement __set__ to make tuplegetter a data descriptor

* Use Py_INCREF now that we inline PyTuple_GetItem

* Apply the valid_index() function, saving one test

* Move Py_None test out of the critical path.
2018-12-30 01:24:03 -08:00
Cheryl Sabella b0a6196ffd bpo-35598: IDLE: Increase test coverage for config_key.py (#11360) 2018-12-29 23:25:09 -05:00
Pablo Galindo d51324a2f5
bpo-35602: Make sure the transport is always closed in SelectorEventLoopUnixSockSendfileTests (GH-11338)
There is a race condition in SelectorEventLoopUnixSockSendfileTests that causes the prepare() method return a non connected server protocol, making the cleanup() method skips the correct handling of the transport. This commit makes prepare() always return a connected server protocol that can always be cleaned up correctly.
2018-12-29 19:18:38 +00:00
Xtreak 78de01198b bpo-35603: Escape table header of make_table output that can cause potential XSS. (GH-11341) 2018-12-29 10:53:14 +02:00
Pablo Galindo 1f511e1af0
Make sure file object is close if socket.create_connection fails (GH-11334)
The problem affects _testWithTimeoutTriggeredSend in test_socket.py.
2018-12-29 01:42:16 +00:00
Pablo Galindo 5471420faa
bpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH-11337)
There is a race condition regarding signal delivery in test_signal_handling_args for
test_asyncio.test_events.KqueueEventLoopTests. The signal can be received at any moment outside the time window provided in the test. The fix is to wait for the signal to be received instead with a bigger timeout.
2018-12-29 01:40:21 +00:00
Terry Jan Reedy 4bc246786f
bpo-34055: Revert deletion of line in IDLE's PyShell (#11346)
The attribute is still used in other modules.
2018-12-28 20:06:16 -05:00
Cheryl Sabella c0381aaea4 bpo-28097: IDLE - Add Previous/Next History to Shell menu (#11325) 2018-12-28 15:11:30 -05:00
Cheryl Sabella 804a5d94b6 IDLE: Create function to update menu item state. (GH-11343)
This will be needed for other menu items.  Change outwin to call the function instead of updating the menu item directly.
2018-12-28 13:15:30 -05:00
jab 9e00d9e88f bpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson) 2018-12-28 19:03:40 +01:00
Michael Felt ed57e13df6 bpo-11191: skip unsupported test_distutils case for AIX with xlc (GH-8709)
Command line options for the xlc compiler behave differently from gcc and clang,
so skip this test case for now when xlc is the compiler.

Patch by aixtools (Michael Felt)
2018-12-29 00:03:17 +10:00
Michael Felt e2926b7248 bpo-34373: fix test_mktime and test_pthread_getcpuclickid tests on AIX (GH-8726)
* Fix test_mktime on AIX by adding code to get mktime to behave the
  same way as it does on other *nix systems
* Fix test_pthread_getcpuclickid in AIX by adjusting the test case
  expectations when running on AIX in 32-bit mode

Patch by Michael Felt.
2018-12-28 23:57:37 +10:00
Terry Jan Reedy c465682718
bpo-35591: IDLE Find Selection now works when selection not found (GH-11339) 2018-12-28 02:41:35 -05:00
Cheryl Sabella 55698cc395 bpo-35598: IDLE: Update config_key.py with PEP8 names (GH-11330)
A few other changes make the code easier to follow.
2018-12-27 22:47:54 -05:00