]> granicus.if.org Git - python/log
python
5 years agobpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)
Dong-hee Na [Thu, 17 Jan 2019 12:14:45 +0000 (21:14 +0900)]
bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)

Add a deprecated warning for the threading.Thread.isAlive() method.

5 years agoFixes typo in asyncio.queue doc (GH-11581)
Slam [Thu, 17 Jan 2019 11:52:17 +0000 (13:52 +0200)]
Fixes typo in asyncio.queue doc (GH-11581)

Typo fix for method doc, I'm pretty sure coro is meant, because there's no consumer threads for thread-unsafe queue.

Most probably this piece of doc was copied from `queue.Queue`

There's not BPO bug for this, afaik.

5 years agobpo-35486: Note Py3.6 import system API requirement change (GH-11540)
Nick Coghlan [Thu, 17 Jan 2019 10:41:29 +0000 (20:41 +1000)]
bpo-35486: Note Py3.6 import system API requirement change (GH-11540)

While the introduction of ModuleNotFoundError was fully backwards
compatible on the import API consumer side, folks providing alternative
implementations of `__import__` need to make an update to be
forward compatible with clients that start relying on the new subclass.

https://bugs.python.org/issue35486

5 years agoRevert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)
Victor Stinner [Wed, 16 Jan 2019 22:38:06 +0000 (23:38 +0100)]
Revert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)

This reverts commit 07858894689047c77f9c12ddc061d30681368d19.

5 years agobpo-35537: subprocess can now use os.posix_spawnp (GH-11579)
Victor Stinner [Wed, 16 Jan 2019 14:26:20 +0000 (15:26 +0100)]
bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)

The subprocess module can now use the os.posix_spawnp() function,
if it is available, to locate the program in the PATH.

5 years agobpo-35674: Add os.posix_spawnp() (GH-11554)
Joannah Nanjekye [Wed, 16 Jan 2019 13:29:26 +0000 (16:29 +0300)]
bpo-35674: Add os.posix_spawnp() (GH-11554)

Add a new os.posix_spawnp() function.

5 years agobpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)
Victor Stinner [Tue, 15 Jan 2019 23:02:35 +0000 (00:02 +0100)]
bpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)

The subprocess module can now use the os.posix_spawn() function
in some cases for better performance. Currently, it is only used on macOS
and Linux (using glibc 2.24 or newer) if all these conditions are met:

* executable path contains a directory
* close_fds=False
* preexec_fn, pass_fds, cwd, stdin, stdout, stderr
  and start_new_session parameters are not set

Co-authored-by: Joannah Nanjekye <nanjekyejoannah@gmail.com>
5 years agobpo-35746: Fix segfault in ssl's cert parser (GH-11569)
Christian Heimes [Tue, 15 Jan 2019 22:47:42 +0000 (23:47 +0100)]
bpo-35746: Fix segfault in ssl's cert parser (GH-11569)

Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
distribution points with empty DP or URI correctly. A malicious or buggy
certificate can result into segfault.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue35746

5 years agobpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)
Victor Stinner [Tue, 15 Jan 2019 12:58:38 +0000 (13:58 +0100)]
bpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)

asyncio.ProactorEventLoop now catchs and logs send errors when the
self-pipe is full: BaseProactorEventLoop._write_to_self() now catchs
and logs OSError exceptions, as done by
BaseSelectorEventLoop._write_to_self().

5 years agobpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)
Serhiy Storchaka [Tue, 15 Jan 2019 11:26:38 +0000 (13:26 +0200)]
bpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)

Handle the case of an empty module name in PYTHONBREAKPOINT.

Fixes a regression introduced in bpo-34756.

5 years agobpo-11555: Enhance IocpProactor.close() log again (GH-11563)
Victor Stinner [Tue, 15 Jan 2019 11:13:48 +0000 (12:13 +0100)]
bpo-11555: Enhance IocpProactor.close() log again (GH-11563)

Add repr(self) to the log to display the number of pending overlapped
in the log.

5 years agobpo-34323: Enhance IocpProactor.close() log (GH-11555)
Victor Stinner [Tue, 15 Jan 2019 10:48:00 +0000 (11:48 +0100)]
bpo-34323: Enhance IocpProactor.close() log (GH-11555)

IocpProactor.close() now uses time to decide when to log: wait 1
second before the first log, then log every second. Log also the
number of seconds since close() was called.

5 years agobpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)
Henry Chen [Tue, 15 Jan 2019 10:29:21 +0000 (02:29 -0800)]
bpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)

Show correct number of repeats.

5 years agobpo-29707: Document that os.path.ismount() is not able to reliable detect bind mounts...
Serhiy Storchaka [Tue, 15 Jan 2019 08:55:40 +0000 (10:55 +0200)]
bpo-29707: Document that os.path.ismount() is not able to reliable detect bind mounts. (GH-11238)

5 years agobpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)
Serhiy Storchaka [Tue, 15 Jan 2019 08:53:18 +0000 (10:53 +0200)]
bpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)

5 years agobpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). ...
Serhiy Storchaka [Mon, 14 Jan 2019 10:58:37 +0000 (12:58 +0200)]
bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)

5 years agobpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)
MichaelSaah [Mon, 14 Jan 2019 10:23:39 +0000 (05:23 -0500)]
bpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)

Previously, calling the strftime() method on a datetime object with a
trailing '%' in the format string would result in an exception. However,
this only occured when the datetime C module was being used; the python
implementation did not match this behavior. Datetime is now PEP-399
compliant, and will not throw an exception on a trailing '%'.

5 years agobpo-35730: Disable IDLE test_reload assertion. (GH-11543)
Terry Jan Reedy [Sun, 13 Jan 2019 17:50:29 +0000 (12:50 -0500)]
bpo-35730: Disable IDLE test_reload assertion. (GH-11543)

IDLE's test_squeezer.SqueezerTest.test_reload, added for issue 35196,
failed on both Gentoo buildbots.

5 years agobpo-35196: Optimize Squeezer's write() interception (GH-10454)
Tal Einat [Sun, 13 Jan 2019 15:01:50 +0000 (17:01 +0200)]
bpo-35196: Optimize Squeezer's write() interception (GH-10454)

The new functionality of Squeezer.reload() is also tested, along with some general
re-working of the tests in test_squeezer.py.

5 years agobpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)
Anthony Sottile [Sun, 13 Jan 2019 04:05:13 +0000 (20:05 -0800)]
bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)

5 years agobpo-34512: Document platform-specific strftime() behavior for non-ASCII format string...
Alexey Izbyshev [Sat, 12 Jan 2019 17:21:54 +0000 (00:21 +0700)]
bpo-34512: Document platform-specific strftime() behavior for non-ASCII format strings (GH-8948)

5 years agobpo-35552: Fix reading past the end in PyUnicode_FromFormat() and PyBytes_FromFormat...
Serhiy Storchaka [Sat, 12 Jan 2019 08:30:35 +0000 (10:30 +0200)]
bpo-35552: Fix reading past the end in PyUnicode_FromFormat() and PyBytes_FromFormat(). (GH-11276)

Format characters "%s" and "%V" in PyUnicode_FromFormat() and "%s" in PyBytes_FromFormat()
no longer read memory past the limit if precision is specified.

5 years agobpo-35634: Raise an error when first passed kwargs contains duplicated keys. (GH...
Serhiy Storchaka [Sat, 12 Jan 2019 08:12:24 +0000 (10:12 +0200)]
bpo-35634: Raise an error when first passed kwargs contains duplicated keys. (GH-11438)

5 years agobpo-35494: Improve syntax error messages for unbalanced parentheses in f-string....
Serhiy Storchaka [Sat, 12 Jan 2019 07:46:50 +0000 (09:46 +0200)]
bpo-35494: Improve syntax error messages for unbalanced parentheses in f-string. (GH-11161)

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)