Serhiy Storchaka [Sat, 22 Dec 2018 09:18:40 +0000 (11:18 +0200)]
bpo-30455: Generate all token related code and docs from Grammar/Tokens. (GH-10370)
"Include/token.h", "Lib/token.py" (containing now some data moved from
"Lib/tokenize.py") and new files "Parser/token.c" (containing the code
moved from "Parser/tokenizer.c") and "Doc/library/token-list.inc" (included
in "Doc/library/token.rst") are now generated from "Grammar/Tokens" by
"Tools/scripts/generate_token.py". The script overwrites files only if
needed and can be used on the read-only sources tree.
"Lib/symbol.py" is now generated by "Tools/scripts/generate_symbol_py.py"
instead of been executable itself.
Added new make targets "regen-token" and "regen-symbol" which are now
dependencies of "regen-all".
The documentation contains now strings for operators and punctuation tokens.
Cheryl Sabella [Sat, 22 Dec 2018 06:25:45 +0000 (01:25 -0500)]
bpo-22703: IDLE: Improve Code Context and Zoom Height menu labels (GH-11214)
The Code Context menu label now toggles between Show/Hide Code Context.
The Zoom Height menu now toggles between Zoom/Restore Height.
Zoom Height has moved from the Window menu to the Options menu.
Matt McCormick [Sat, 22 Dec 2018 01:37:59 +0000 (20:37 -0500)]
bpo-11566: Extension build errors on Windows for _hypot (GH-11283)
This addresses C extension build errors related to an undefined _hypot
symbol when building with the Microsoft Visual C++ Compiler for Python
2.7 [1] or MinGWPy [2]. It also addresses errors when building a C++
extension with MinGWPy and C++11 from cmath, 'error "::hypot' has not
been declared'
Serhiy Storchaka [Thu, 20 Dec 2018 07:33:58 +0000 (09:33 +0200)]
bpo-18085: Update refcounts.dat. (GH-11247)
Fixed some errors in refcounts.dat, remove functions removed in
Python 3, and add more entries for documented functions. This will
add several automatically generated notes about return values.
stratakis [Wed, 19 Dec 2018 17:19:01 +0000 (18:19 +0100)]
bpo-35257: Avoid leaking LTO linker flags into distutils (GH-10900)
When compiling 3rd party C extensions, the linker flags used by the
compiler for the interpreter and the stdlib modules, will get
leaked into distutils. In order to avoid that, the PY_CORE_LDFLAGS
and PY_LDFLAGS_NODIST are introduced to keep those flags separated.
Fix a race condition in check_interrupted_write() of test_io:
create directly the thread with SIGALRM signal blocked,
rather than blocking the signal later from the thread. Previously, it
was possible that the thread gets the signal before the signal is
blocked.
Victor Stinner [Mon, 17 Dec 2018 21:06:10 +0000 (22:06 +0100)]
bpo-35519: Rename test.bisect to test.bisect_cmd (GH-11200)
Rename test.bisect module to test.bisect_cmd to avoid conflict with
bisect module when running directly a test like
"./python Lib/test/test_xmlrpc.py".
TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test: time.time()
can go backwards, whereas time.perf_counter() is monotonic.
Similar change made in libregrtest, pprint and random.
Paul Ganssle [Mon, 17 Dec 2018 07:59:02 +0000 (02:59 -0500)]
bpo-35186: Remove "built with" comment in setup.py upload (GH-10414)
platform.dist() is deprecated and slated for removal in Python 3.8. The
upload command itself should also not be used to upload to PyPI, but
while it continues to exist it should not use deprecated functions.
Victor Stinner [Sun, 16 Dec 2018 17:00:42 +0000 (18:00 +0100)]
bpo-35499: make profile-opt don't override CFLAGS_NODIST (GH-11164)
"make profile-opt" no longer replaces CFLAGS_NODIST with CFLAGS. It
now adds profile-guided optimization (PGO) flags to CFLAGS_NODIST,
existing CFLAGS_NODIST flags are kept.
Victor Stinner [Fri, 14 Dec 2018 12:06:50 +0000 (13:06 +0100)]
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
bpo-34279, bpo-35412: support.run_unittest() no longer raises
TestDidNotRun if a test result contains skipped tests. The
exception is now only raised if no test have been run and no test
have been skipped.
* Add the pid and parent pid to multiprocessing.BaseProcess.__repr__().
* Add negative sign (ex: "-SIGTERM") to exitcode (process killed
by a signal)
* Only call _popen.poll() once.
Example:
<ForkProcess(ForkPoolWorker-1, started daemon)>
becomes:
<ForkProcess name='ForkPoolWorker-1' pid=12449 parent=12448 started daemon>
Victor Stinner [Mon, 10 Dec 2018 10:30:21 +0000 (11:30 +0100)]
bpo-31374: Include pyconfig.h earlier in expat (GH-11064)
Include <pyconfig.h> ealier in Modules/expat/xmltok.c to define
properly _POSIX_C_SOURCE. Python defines _POSIX_C_SOURCE as 200809L,
whereas <features.h> (included indirectly by <string.h>) defines
_POSIX_C_SOURCE as 199506L.
The length check for AF_ALG salg_name and salg_type had a off-by-one
error. The code assumed that both values are not necessarily NULL
terminated. However the Kernel code for alg_bind() ensures that the last
byte of both strings are NULL terminated.
Signed-off-by: Christian Heimes <christian@python.org>
Victor Stinner [Mon, 10 Dec 2018 10:12:53 +0000 (11:12 +0100)]
bpo-35052: Fix handler on xml.dom.minidom.cloneNode() (GH-11061)
Fix xml.dom.minidom cloneNode() on a document with an entity: pass
the correct arguments to the user data handler of an entity (fix an
old copy/paste mistake).
Bug spotted and fix proposed by Charalampos Stratakis, initial
reproducer written by Petr Viktorin.
Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com> Co-Authored-By: Petr Viktorin <encukou@gmail.com>