]> granicus.if.org Git - python/log
python
5 years agobpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
Serhiy Storchaka [Sat, 12 Jan 2019 07:22:29 +0000 (09:22 +0200)]
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)

Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.

5 years agobpo-35719: Optimize multi-argument math functions. (GH-11527)
Serhiy Storchaka [Sat, 12 Jan 2019 06:26:34 +0000 (08:26 +0200)]
bpo-35719: Optimize multi-argument math functions. (GH-11527)

Use the fast call convention for math functions atan2(),
copysign(), hypot() and remainder() and inline unpacking
arguments. This sped up them by 1.3--2.5 times.

5 years agobpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)
Serhiy Storchaka [Sat, 12 Jan 2019 06:25:41 +0000 (08:25 +0200)]
bpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)

Inline PyArg_UnpackTuple() and _PyArg_UnpackStack() in performance
sensitive code in the builtins and operator modules.

5 years agobpo-34838: Use subclass_of for math.dist. (GH-9659)
Ammar Askar [Sat, 12 Jan 2019 06:23:41 +0000 (01:23 -0500)]
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.

5 years agobpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)
Eric Snow [Fri, 11 Jan 2019 21:26:55 +0000 (14:26 -0700)]
bpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)

This change separates the signal handling trigger in the eval loop from the "pending calls" machinery. There is no semantic change and the difference in performance is insignificant.

The change makes both components less confusing. It also eliminates the risk of changes to the pending calls affecting signal handling. This is particularly relevant for some upcoming pending calls changes I have in the works.

5 years agobpo-34569: Fix subinterpreter 32-bit ABI, pystate.c/_new_long_object() (gh-9127)
Michael Felt [Fri, 11 Jan 2019 18:17:03 +0000 (19:17 +0100)]
bpo-34569: Fix subinterpreter 32-bit  ABI, pystate.c/_new_long_object() (gh-9127)

This fixes ShareableTypeTests.test_int() in Lib/test/test__xxsubinterpreters.py.

5 years agobpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)
Serhiy Storchaka [Fri, 11 Jan 2019 16:01:42 +0000 (18:01 +0200)]
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.

5 years agobpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313)
Serhiy Storchaka [Fri, 11 Jan 2019 14:01:14 +0000 (16:01 +0200)]
bpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313)

5 years agobpo-32710: Fix _overlapped.Overlapped memory leaks (GH-11489)
Victor Stinner [Fri, 11 Jan 2019 13:35:14 +0000 (14:35 +0100)]
bpo-32710: Fix _overlapped.Overlapped memory leaks (GH-11489)

Fix memory leaks in asyncio ProactorEventLoop on overlapped operation
failures.

Changes:

* Implement the tp_traverse slot in the _overlapped.Overlapped type
  to help to break reference cycles and identify referrers in the
  garbage collector.
* Always clear overlapped on failure: not only set type to
  TYPE_NOT_STARTED, but release also resources.

5 years agobpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)
Joannah Nanjekye [Fri, 11 Jan 2019 13:19:57 +0000 (16:19 +0300)]
bpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)

Document that the time.CLOCK_MONOTONIC_RAW constant
is now also available on macOS 10.12.

Co-authored-by: Ricardo Fraile <rfraile@rfraile.eu>
5 years agobpo-32146: Add documentation about frozen executables on Unix (GH-5850)
Bo Bayles [Thu, 10 Jan 2019 17:51:28 +0000 (11:51 -0600)]
bpo-32146: Add documentation about frozen executables on Unix (GH-5850)

5 years agobpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)
Joannah Nanjekye [Thu, 10 Jan 2019 16:56:38 +0000 (19:56 +0300)]
bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)

5 years agobpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH...
Zackery Spytz [Thu, 10 Jan 2019 16:12:31 +0000 (09:12 -0700)]
bpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH-11128)

5 years agobpo-24746: Fix doctest failures when running the testsuite with -R (#11501)
Pablo Galindo [Thu, 10 Jan 2019 14:29:40 +0000 (14:29 +0000)]
bpo-24746: Fix doctest failures when running the testsuite with -R (#11501)

5 years agoasyncio: __del__() keep reference to warnings.warn (GH-11491)
Victor Stinner [Thu, 10 Jan 2019 10:24:40 +0000 (11:24 +0100)]
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.

5 years agoIocpProactor: prevent modification if closed (GH-11494)
Victor Stinner [Thu, 10 Jan 2019 10:23:26 +0000 (11:23 +0100)]
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()

5 years agobpo-34855: Fix EXTERNALS_DIR build variable for Windows (GH-11177)
antektek [Thu, 10 Jan 2019 00:19:29 +0000 (01:19 +0100)]
bpo-34855: Fix EXTERNALS_DIR build variable for Windows (GH-11177)

5 years agoDistutils no longer needs to remain compatible with 2.3 (GH-11423)
Miro Hrončok [Wed, 9 Jan 2019 23:55:03 +0000 (00:55 +0100)]
Distutils no longer needs to remain compatible with 2.3 (GH-11423)

5 years agoUpdate bugs.rst (GH-9648)
Andre Delfino [Wed, 9 Jan 2019 22:54:12 +0000 (19:54 -0300)]
Update bugs.rst (GH-9648)

5 years agobpo-35404: Clarify how to import _structure in email.message doc (GH-10886)
Charles-Axel Dein [Wed, 9 Jan 2019 22:52:10 +0000 (23:52 +0100)]
bpo-35404: Clarify how to import _structure in email.message doc (GH-10886)

5 years agoAdd example to the documentation for calling unittest.mock.patch with create=True...
Pablo Galindo [Wed, 9 Jan 2019 21:43:24 +0000 (21:43 +0000)]
Add example to the documentation for calling unittest.mock.patch with create=True (GH-11056)

5 years agobpo-35641: Move IDLE blurb to IDLE directory (#11479)
Terry Jan Reedy [Wed, 9 Jan 2019 15:44:07 +0000 (10:44 -0500)]
bpo-35641: Move IDLE blurb to IDLE directory (#11479)

5 years agobpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639)
Sanyam Khurana [Wed, 9 Jan 2019 13:38:38 +0000 (19:08 +0530)]
bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639)

5 years agobpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)
Victor Stinner [Tue, 8 Jan 2019 13:23:09 +0000 (14:23 +0100)]
bpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)

Fix a memory leak in asyncio in the ProactorEventLoop when ReadFile()
or WSASend() overlapped operation fail immediately: release the
internal buffer.

5 years agobpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport restrictio...
Steve Dower [Tue, 8 Jan 2019 10:38:01 +0000 (02:38 -0800)]
bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport restrictions (GH-11465)

Also adds extra steps to the CI build for Windows on Azure Pipelines to validate that the various layouts at least execute.

5 years agobpo-35568: add 'raise_signal' function (GH-11335)
Vladimir Matveev [Tue, 8 Jan 2019 09:58:25 +0000 (01:58 -0800)]
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

5 years agobpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)
chrullrich [Tue, 8 Jan 2019 02:57:29 +0000 (03:57 +0100)]
bpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)

5 years agoRemove spurious quote in Azure Pipelines script (GH-10763)
Pierre Glaser [Tue, 8 Jan 2019 02:02:26 +0000 (03:02 +0100)]
Remove spurious quote in Azure Pipelines script (GH-10763)

5 years agobpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
Victor Stinner [Tue, 8 Jan 2019 01:46:59 +0000 (02:46 +0100)]
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.

5 years agobpo-35642: Remove asynciomodule.c from pythoncore.vcxproj (GH-11410)
Gregory Szorc [Tue, 8 Jan 2019 01:27:18 +0000 (18:27 -0700)]
bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj (GH-11410)

This module is built by _asyncio.vcxproj and does not need to be included in pythoncore.

5 years agobpo-33717: pythoninfo logs information of all clocks (GH-11460)
Victor Stinner [Tue, 8 Jan 2019 00:27:27 +0000 (01:27 +0100)]
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().

5 years agobpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)
Victor Stinner [Mon, 7 Jan 2019 22:55:57 +0000 (23:55 +0100)]
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.

5 years agobpo-35664: Optimize operator.itemgetter (GH-11435)
Raymond Hettinger [Mon, 7 Jan 2019 16:38:41 +0000 (09:38 -0700)]
bpo-35664: Optimize operator.itemgetter (GH-11435)

5 years agobpo-35560: Remove assertion from format(float, "n") (GH-11288)
Xtreak [Mon, 7 Jan 2019 15:09:14 +0000 (20:39 +0530)]
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.

5 years agotest_threading_local: add missing "import sys" (GH-8049)
cclauss [Sun, 6 Jan 2019 22:10:55 +0000 (23:10 +0100)]
test_threading_local: add missing "import sys" (GH-8049)

5 years agobpo-35660: Fix imports in idlelib.window (#11434)
Cheryl Sabella [Sun, 6 Jan 2019 20:55:52 +0000 (15:55 -0500)]
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.

5 years agobpo-35488: Add tests for ** glob matching in pathlib (GH-11171)
Anthony Shaw [Sun, 6 Jan 2019 20:31:29 +0000 (07:31 +1100)]
bpo-35488: Add tests for ** glob matching in pathlib (GH-11171)

5 years agoremove doc-string declaration no longer used after AC conversion (GH-11444)
Tal Einat [Sun, 6 Jan 2019 08:10:34 +0000 (10:10 +0200)]
remove doc-string declaration no longer used after AC conversion (GH-11444)

5 years agobpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)
Vladimir Matveev [Sat, 5 Jan 2019 20:44:59 +0000 (12:44 -0800)]
bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)

5 years agobpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)
Ville Skyttä [Fri, 4 Jan 2019 14:14:32 +0000 (16:14 +0200)]
bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)

https://bugs.python.org/issue35631

5 years agobpo-31450: Remove documentation mentioning that subprocess's child_traceback is avail...
Harmandeep Singh [Thu, 3 Jan 2019 19:53:56 +0000 (01:23 +0530)]
bpo-31450: Remove documentation mentioning that subprocess's child_traceback is available with the parent process (GH-11422)

5 years agobpo-35641: IDLE - format calltip properly when no docstring (GH-11415)
Emmanuel Arias [Thu, 3 Jan 2019 07:47:58 +0000 (04:47 -0300)]
bpo-35641: IDLE - format calltip properly when no docstring (GH-11415)

5 years agobpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395)
Terry Jan Reedy [Thu, 3 Jan 2019 03:04:06 +0000 (22:04 -0500)]
bpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395)

5 years agobpo-35525: Correct the argument name for NNTP.starttls() (GH-11310)
Harmandeep Singh [Wed, 2 Jan 2019 21:05:19 +0000 (02:35 +0530)]
bpo-35525: Correct the argument name for NNTP.starttls() (GH-11310)

5 years agocloses bpo-35643: Fix a SyntaxWarning: invalid escape sequence in Modules/_sha3/clean...
Mickaël Schoentgen [Wed, 2 Jan 2019 19:26:57 +0000 (20:26 +0100)]
closes bpo-35643: Fix a SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py (GH-11411)

5 years agoBump copyright years to 2019. (GH-11404)
Benjamin Peterson [Wed, 2 Jan 2019 15:46:53 +0000 (07:46 -0800)]
Bump copyright years to 2019. (GH-11404)

5 years agoRevert "bpo-35603: Escape table header of make_table output that can cause potential...
Serhiy Storchaka [Wed, 2 Jan 2019 12:49:25 +0000 (14:49 +0200)]
Revert "bpo-35603: Escape table header of make_table output that can cause potential XSS. (GH-11341)" (GH-11356)

This reverts commit 78de01198b047347abc5e458851bb12c48429e24.

5 years agobpo-35588: Speed up mod, divmod and floordiv operations for Fraction type (#11322)
Stefan Behnel [Wed, 2 Jan 2019 12:22:06 +0000 (13:22 +0100)]
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.

5 years agobpo-35636: Remove redundant check in unicode_hash(). (GH-11402)
animalize [Wed, 2 Jan 2019 12:16:06 +0000 (20:16 +0800)]
bpo-35636: Remove redundant check in unicode_hash(). (GH-11402)

_Py_HashBytes() does the check for empty string.

5 years agocloses bpo-35623: Fix integer overflow when sorting large lists (GH-11380)
sth [Wed, 2 Jan 2019 02:01:54 +0000 (03:01 +0100)]
closes bpo-35623: Fix integer overflow when sorting large lists (GH-11380)

There is already a `Py_ssize_t i` defined at function scope that is used
for similar loops. By removing the local `int i` declaration that `i` is
used, which has the appropriate type.

5 years agocloses bpo-35630: Use code tag for 'python3' in 'README.rst' (GH-11394)
Suriyaa ✌️️ [Wed, 2 Jan 2019 01:57:42 +0000 (02:57 +0100)]
closes bpo-35630: Use code tag for 'python3' in 'README.rst' (GH-11394)

5 years agobpo-35598: IDLE - Globalize some config_key objects (GH-11392)
Cheryl Sabella [Mon, 31 Dec 2018 20:06:35 +0000 (15:06 -0500)]
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.

5 years agobpo-20182: AC convert Python/sysmodule.c (GH-11328)
Tal Einat [Mon, 31 Dec 2018 15:12:08 +0000 (17:12 +0200)]
bpo-20182: AC convert Python/sysmodule.c (GH-11328)

5 years agobpo-32492: Tweak _collections._tuplegetter. (GH-11367)
Serhiy Storchaka [Mon, 31 Dec 2018 12:15:16 +0000 (14:15 +0200)]
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.

5 years agobpo-35609: Remove examples for deprecated decorators in the abc module. (GH-11355)
Serhiy Storchaka [Mon, 31 Dec 2018 07:56:21 +0000 (09:56 +0200)]
bpo-35609: Remove examples for deprecated decorators in the abc module. (GH-11355)

5 years agoFix typo in test module usage message (GH-11374)
sth [Mon, 31 Dec 2018 05:41:39 +0000 (06:41 +0100)]
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

5 years agobpo-35614: Fix pydoc help() on metaclasses (#11357)
Sanyam Khurana [Mon, 31 Dec 2018 05:14:47 +0000 (10:44 +0530)]
bpo-35614: Fix pydoc help() on metaclasses (#11357)

5 years agobpo-35214: Annotate posix calls for clang MSan. (#11389)
Gregory P. Smith [Mon, 31 Dec 2018 05:13:02 +0000 (21:13 -0800)]
bpo-35214: Annotate posix calls for clang MSan. (#11389)

It doesn't know the details of a few less common libc functions.

5 years agobpo-35214: Skip test_io tests that'd cause a huge malloc under msan (#11385)
Gregory P. Smith [Mon, 31 Dec 2018 04:17:57 +0000 (20:17 -0800)]
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

5 years agoFix typos in test_faulthandler skipIfs for ubsan. (GH-11386)
Gregory P. Smith [Mon, 31 Dec 2018 04:15:41 +0000 (20:15 -0800)]
Fix typos in test_faulthandler skipIfs for ubsan. (GH-11386)

5 years agobpo-35550: Fix incorrect Solaris define guards (GH-11275)
Jakub Kulík [Mon, 31 Dec 2018 02:16:40 +0000 (03:16 +0100)]
bpo-35550: Fix incorrect Solaris define guards (GH-11275)

Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used.

Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system#Solaris

https://bugs.python.org/issue35550

5 years agoCleanup test_faulthandler sanitizer skip logic. (GH-11381)
Gregory P. Smith [Mon, 31 Dec 2018 02:09:26 +0000 (18:09 -0800)]
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.

5 years agoDead code removal from _hashopenssl. (GH-11379)
Gregory P. Smith [Mon, 31 Dec 2018 01:54:53 +0000 (17:54 -0800)]
Dead code removal from _hashopenssl. (GH-11379)

HASH_OBJ_CONSTRUCTOR has always been defined as 0 since I created
hashlib in Python 2.5.  Delete all code associated with it.

5 years agobpo-35214: MSan workarounds for socket, time, and test_faulthandler. (GH-11375)
Gregory P. Smith [Mon, 31 Dec 2018 01:05:36 +0000 (17:05 -0800)]
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.

5 years agobpo-28503: Use crypt_r() when available instead of crypt() (GH-11373)
Gregory P. Smith [Sun, 30 Dec 2018 23:42:32 +0000 (15:42 -0800)]
bpo-28503: Use crypt_r() when available instead of crypt() (GH-11373)

Use crypt_r() when available instead of crypt() in the crypt module.

As a nice side effect: This also avoids a memory sanitizer flake as clang msan doesn't know about crypt's internal libc allocated buffer.

5 years agoFix typo in documentation of AbstractEventLoopPolicy.set_child_watcher() (GH-11369)
sth [Sun, 30 Dec 2018 22:01:28 +0000 (23:01 +0100)]
Fix typo in documentation of AbstractEventLoopPolicy.set_child_watcher() (GH-11369)

`set_child_watcher()` *sets* the watcher.

5 years agobpo-35598: IDLE: Switch config_key dialog to ttk widgets (GH-11365)
Cheryl Sabella [Sun, 30 Dec 2018 19:48:51 +0000 (14:48 -0500)]
bpo-35598: IDLE: Switch config_key dialog to ttk widgets (GH-11365)

5 years agobpo-32492: 1.6x speed up in namedtuple attribute access using C fast-path (#10495)
Pablo Galindo [Sun, 30 Dec 2018 09:24:03 +0000 (09:24 +0000)]
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.

5 years agobpo-35598: IDLE: Increase test coverage for config_key.py (#11360)
Cheryl Sabella [Sun, 30 Dec 2018 04:25:09 +0000 (23:25 -0500)]
bpo-35598: IDLE: Increase test coverage for config_key.py (#11360)

5 years agobpo-33234: Simplify list_preallocate_exact() (GH-11220)
Sergey Fedoseev [Sat, 29 Dec 2018 22:31:36 +0000 (03:31 +0500)]
bpo-33234: Simplify list_preallocate_exact() (GH-11220)

5 years agobpo-35602: Make sure the transport is always closed in SelectorEventLoopUnixSockSendf...
Pablo Galindo [Sat, 29 Dec 2018 19:18:38 +0000 (19:18 +0000)]
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.

5 years agobpo-35603: Escape table header of make_table output that can cause potential XSS...
Xtreak [Sat, 29 Dec 2018 08:53:14 +0000 (14:23 +0530)]
bpo-35603: Escape table header of make_table output that can cause potential XSS. (GH-11341)

5 years agoMake sure file object is close if socket.create_connection fails (GH-11334)
Pablo Galindo [Sat, 29 Dec 2018 01:42:16 +0000 (01:42 +0000)]
Make sure file object is close if socket.create_connection fails (GH-11334)

The problem affects _testWithTimeoutTriggeredSend in test_socket.py.

5 years agobpo-35601: Alleviate race condition when waiting for SIGALRM in test_asyncio (GH...
Pablo Galindo [Sat, 29 Dec 2018 01:40:21 +0000 (01:40 +0000)]
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.

5 years agobpo-34055: Revert deletion of line in IDLE's PyShell (#11346)
Terry Jan Reedy [Sat, 29 Dec 2018 01:06:16 +0000 (20:06 -0500)]
bpo-34055: Revert deletion of line in IDLE's PyShell (#11346)

The attribute is still used in other modules.

5 years ago bpo-28097: IDLE - Add Previous/Next History to Shell menu (#11325)
Cheryl Sabella [Fri, 28 Dec 2018 20:11:30 +0000 (15:11 -0500)]
 bpo-28097: IDLE - Add Previous/Next History to Shell menu (#11325)

5 years agoIDLE: Create function to update menu item state. (GH-11343)
Cheryl Sabella [Fri, 28 Dec 2018 18:15:30 +0000 (13:15 -0500)]
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.

5 years agobpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson)
jab [Fri, 28 Dec 2018 18:03:40 +0000 (13:03 -0500)]
bpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson)

5 years agobpo-11191: skip unsupported test_distutils case for AIX with xlc (GH-8709)
Michael Felt [Fri, 28 Dec 2018 14:03:17 +0000 (15:03 +0100)]
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)

5 years agobpo-34373: fix test_mktime and test_pthread_getcpuclickid tests on AIX (GH-8726)
Michael Felt [Fri, 28 Dec 2018 13:57:37 +0000 (14:57 +0100)]
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.

5 years agobpo-35591: IDLE Find Selection now works when selection not found (GH-11339)
Terry Jan Reedy [Fri, 28 Dec 2018 07:41:35 +0000 (02:41 -0500)]
bpo-35591: IDLE Find Selection now works when selection not found (GH-11339)

5 years agobpo-35598: IDLE: Update config_key.py with PEP8 names (GH-11330)
Cheryl Sabella [Fri, 28 Dec 2018 03:47:54 +0000 (22:47 -0500)]
bpo-35598: IDLE: Update config_key.py with PEP8 names (GH-11330)

A few other changes make the code easier to follow.

5 years agomacOS installer build: mitigate hdiutil resource busy bug (GH-11333)
Ned Deily [Thu, 27 Dec 2018 21:38:41 +0000 (16:38 -0500)]
macOS installer build: mitigate hdiutil resource busy bug (GH-11333)

5 years agoRevert "bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101...
Ned Deily [Thu, 27 Dec 2018 21:13:30 +0000 (16:13 -0500)]
Revert "bpo-35402: Update macOS installer to use Tcl 8.6.9 / Tk 8.6.9.1 (GH-11101)" (GH-11332)

This reverts commit 7cf3d8e25174c8871883e42f3240fd7f01efd3a8.

Due to regressions found with using Tk 8.6.9.1, build the python.org macOS installers with Tcl/Tk 8.6.8 as used in previous releases.

https://bugs.python.org/issue35402

5 years agobpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple times....
Steve Dower [Thu, 27 Dec 2018 20:44:25 +0000 (12:44 -0800)]
bpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple times. (GH-11329)

https://bugs.python.org/issue35596

5 years agobpo-20182: AC convert remaining functions/methods in _hashopenssl.c (GH-9213)
Tal Einat [Thu, 27 Dec 2018 13:43:43 +0000 (15:43 +0200)]
bpo-20182: AC convert remaining functions/methods in _hashopenssl.c (GH-9213)

5 years agoSpeed-up building enums by value, e.g. http.HTTPStatus(200) (#11318)
Andrew Svetlov [Wed, 26 Dec 2018 18:45:33 +0000 (20:45 +0200)]
Speed-up building enums by value, e.g. http.HTTPStatus(200) (#11318)

bpo-35585: Speed up enum by-value lookup

5 years agobpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
Vaibhav Gupta [Wed, 26 Dec 2018 14:47:17 +0000 (20:17 +0530)]
bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)

https://bugs.python.org/issue35579

https://bugs.python.org/issue35579

5 years agobpo-34897: avoid distutils test error when CXX is not set (GH-9706)
Michael Felt [Wed, 26 Dec 2018 05:45:19 +0000 (06:45 +0100)]
bpo-34897: avoid distutils test error when CXX is not set (GH-9706)

Depending on system config, a missing candidate compiler name may be
reported as the empty string rather than as None, so adjust the test
helper accordingly.

5 years agobpo-34711: Return HTTPStatus.NOT_FOUND if path.endswith('/') and not a directory...
Michael Felt [Wed, 26 Dec 2018 05:43:42 +0000 (06:43 +0100)]
bpo-34711: Return HTTPStatus.NOT_FOUND if path.endswith('/') and not a directory (GH-9687)

AIX allows a trailing slash on local file system paths, which isn't what we want
in http.server. Accordingly, check explicitly for this case in the server code,
rather than relying on the OS raising an exception.

Patch by Michael Felt.

5 years agobpo-27643 - skip test_ctypes test case with XLC compiler. (GH-5164)
Michael Felt [Wed, 26 Dec 2018 03:54:22 +0000 (04:54 +0100)]
bpo-27643 - skip test_ctypes test case with XLC compiler. (GH-5164)

This test case needs "signed short" bitfields, but the
IBM XLC compiler (on AIX) does not support this.

Skip the code and test when AIX and XLC are used.

Use __xlc__ as identifier to detect the XLC compiler.

5 years agobpo-11192: Skip unsupported cases in test_socket on AIX (GH-8954)
Michael Felt [Wed, 26 Dec 2018 03:34:37 +0000 (04:34 +0100)]
bpo-11192: Skip unsupported cases in test_socket on AIX (GH-8954)

* use platform.system() as runtime test, rather than sys.platform() build-time test
* IPv6 zone id support on AIX is limited to inet_pton6_zone(), so skip related
  getaddrinfo() and getnameinfo() tests as not supported

5 years agoRedo PR 785 -- Add cross reference links (GH-11319)
Raymond Hettinger [Wed, 26 Dec 2018 01:53:36 +0000 (17:53 -0800)]
Redo PR 785 -- Add cross reference links (GH-11319)

5 years agoRevert "bpo-35565: Add detail to assertion failure message in wsgiref" (GH-11317)
Raymond Hettinger [Tue, 25 Dec 2018 23:59:07 +0000 (15:59 -0800)]
Revert "bpo-35565: Add detail to assertion failure message in wsgiref" (GH-11317)

* Revert part of "bpo-35565:  Remove incorrect test and one that wasn't needed for the fix.

5 years agobpo-35565: Add detail to assertion failure message in wsgiref (GH-11293)
Cheryl Sabella [Tue, 25 Dec 2018 23:19:11 +0000 (18:19 -0500)]
bpo-35565: Add detail to assertion failure message in wsgiref (GH-11293)

5 years agobpo-23867: Argument Clinic: inline parsing code for a single positional parameter...
Serhiy Storchaka [Tue, 25 Dec 2018 11:23:47 +0000 (13:23 +0200)]
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)

5 years agobpo-20180: Simplify char_converter in Argument Clinic. (GH-9828)
Serhiy Storchaka [Tue, 25 Dec 2018 09:10:05 +0000 (11:10 +0200)]
bpo-20180: Simplify char_converter in Argument Clinic. (GH-9828)

Fix also handling non-ascii default values.

5 years agobpo-35578: Add an example file for testing Argument Clinic converters. (GH-11306)
Serhiy Storchaka [Tue, 25 Dec 2018 08:17:28 +0000 (10:17 +0200)]
bpo-35578: Add an example file for testing Argument Clinic converters. (GH-11306)

5 years agoMinor grammar improvement in types.rst (GH-11308)
Mariatta [Mon, 24 Dec 2018 23:56:05 +0000 (15:56 -0800)]
Minor grammar improvement in types.rst (GH-11308)

defines utility function -> defines utility functions

Reported in https://mail.python.org/pipermail/docs/2018-December/038693.html

5 years agobpo-35208: Fix IDLE Squeezer line counting (GH-10449)
Tal Einat [Mon, 24 Dec 2018 12:05:51 +0000 (14:05 +0200)]
bpo-35208: Fix IDLE Squeezer line counting (GH-10449)