]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 years agobpo-41070: Simplify pyshellext.dll build (GH-21037)
Nikita Nemkin [Tue, 23 Jun 2020 23:32:23 +0000 (04:32 +0500)] 
bpo-41070: Simplify pyshellext.dll build (GH-21037)

Replace MIDL-generated file with manual GUID definition.
Use the same .def file for release and debug builds.
Update setup build to support latest toolset

5 years agobpo-40521: Optimize PyUnicode_New(0, maxchar) (GH-21099)
Victor Stinner [Tue, 23 Jun 2020 22:34:07 +0000 (00:34 +0200)] 
bpo-40521: Optimize PyUnicode_New(0, maxchar) (GH-21099)

Functions of unicodeobject.c, like PyUnicode_New(), no longer check
if the empty Unicode singleton has been initialized or not. Consider
that it is always initialized. The Unicode API must not be used
before _PyUnicode_Init() or after _PyUnicode_Fini().

5 years agobpo-40521: Make empty Unicode string per interpreter (GH-21096)
Victor Stinner [Tue, 23 Jun 2020 22:10:40 +0000 (00:10 +0200)] 
bpo-40521: Make empty Unicode string per interpreter (GH-21096)

Each interpreter now has its own empty Unicode string singleton.

5 years agobpo-31938: Fix default-value signatures of several functions in the select module...
Anthony Sottile [Tue, 23 Jun 2020 21:49:56 +0000 (14:49 -0700)] 
bpo-31938: Fix default-value signatures of several functions in the select module (GH-21066)

5 years agobpo-40521: Make MemoryError free list per interpreter (GH-21086)
Victor Stinner [Tue, 23 Jun 2020 20:55:46 +0000 (22:55 +0200)] 
bpo-40521: Make MemoryError free list per interpreter (GH-21086)

Each interpreter now has its own MemoryError free list: it is not
longer shared by all interpreters.

Add _Py_exc_state structure and PyInterpreterState.exc_state member.
Move also errnomap into _Py_exc_state.

5 years agobpo-41039: Simplify python3.dll build (GH-20989)
Nikita Nemkin [Tue, 23 Jun 2020 19:33:23 +0000 (00:33 +0500)] 
bpo-41039: Simplify python3.dll build (GH-20989)

Use linker comment #pragma and preprocessor for re-exporting stable
API functions and variables.

Module definition file, custom build targets and entry point code
become unnecessary and can be removed.

This change also fixes missing _PyErr_BadInternalCall export on x86.

5 years agobpo-41054: Simplify resource compilation on Windows (GH-21004)
Nikita Nemkin [Tue, 23 Jun 2020 19:05:57 +0000 (00:05 +0500)] 
bpo-41054: Simplify resource compilation on Windows (GH-21004)

Remove auto-generated resource header. Pass definitions required
by resource files (ORIGINAL_FILENAME and FIELD3) directly to resource
compiler.

Remove unused MS_DLL_ID resource string and related dead code.

5 years agoOn path with known exact float, extract the double with the fast macro. (GH-21072)
Raymond Hettinger [Tue, 23 Jun 2020 18:45:25 +0000 (11:45 -0700)] 
On path with known exact float, extract the double with the fast macro. (GH-21072)

5 years agobpo-41089: Filters and other issues in Visual Studio projects (GH-21070)
Nikita Nemkin [Tue, 23 Jun 2020 18:41:49 +0000 (23:41 +0500)] 
bpo-41089: Filters and other issues in Visual Studio projects (GH-21070)

* Add missing header files to pythoncore.
* Add missing file filters ("Resource Files" in particular) to
  all projects.
* Add new sub-filters for private headers in pythoncore and
  for 3rd party source files.
* Add missing _zoneinfo configurations in pcbuild.sln.
* Update bdist_wininst with the new zlib location.

5 years agobpo-40521: Empty frozenset is no longer a singleton (GH-21085)
Raymond Hettinger [Tue, 23 Jun 2020 15:42:55 +0000 (08:42 -0700)] 
bpo-40521: Empty frozenset is no longer a singleton (GH-21085)

* Revert "bpo-40521: Make the empty frozenset per interpreter (GH-21068)"

This reverts commit 261cfedf7657a515e04428bba58eba2a9bb88208.

* bpo-40521: Empty frozensets are no longer singletons

* Complete the removal of the frozenset singleton

5 years agobpo-40521: Cleanup code of free lists (GH-21082)
Victor Stinner [Tue, 23 Jun 2020 14:40:40 +0000 (16:40 +0200)] 
bpo-40521: Cleanup code of free lists (GH-21082)

Add get_xxx_state() function to factorize duplicated code.

5 years agobpo-41065: Use zip-strict in zoneinfo (GH-21031)
Ram Rachum [Tue, 23 Jun 2020 14:21:26 +0000 (17:21 +0300)] 
bpo-41065: Use zip-strict in zoneinfo (GH-21031)

5 years agoCall _PyWarnings_InitState() in subinterpreters (GH-21078)
Victor Stinner [Tue, 23 Jun 2020 13:55:45 +0000 (15:55 +0200)] 
Call _PyWarnings_InitState() in subinterpreters (GH-21078)

Py_InitializeFromConfig() now calls also _PyWarnings_InitState() in
subinterpreters.

5 years agobpo-36710: Pass tstate explicitly in abstract.c (GH-21075)
Victor Stinner [Tue, 23 Jun 2020 13:55:06 +0000 (15:55 +0200)] 
bpo-36710: Pass tstate explicitly in abstract.c (GH-21075)

In functions calling more than one PyErr function, get tstate and
then pass it explicitly.

5 years agobpo-40521: Make bytes singletons per interpreter (GH-21074)
Victor Stinner [Tue, 23 Jun 2020 13:54:35 +0000 (15:54 +0200)] 
bpo-40521: Make bytes singletons per interpreter (GH-21074)

Each interpreter now has its own empty bytes string and single byte
character singletons.

Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.

5 years agobpo-40521: Remove freelist from collections.deque() (GH-21073)
Raymond Hettinger [Tue, 23 Jun 2020 13:50:15 +0000 (06:50 -0700)] 
bpo-40521: Remove freelist from collections.deque() (GH-21073)

5 years agobpo-41085: Fix array.array.index() on 64-bit Windows (GH-21071)
WildCard65 [Tue, 23 Jun 2020 13:21:16 +0000 (09:21 -0400)] 
bpo-41085: Fix array.array.index() on 64-bit Windows (GH-21071)

Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
for index larger than ``2**31``.

5 years agobpo-40521: Make the empty frozenset per interpreter (GH-21068)
Victor Stinner [Tue, 23 Jun 2020 12:07:52 +0000 (14:07 +0200)] 
bpo-40521: Make the empty frozenset per interpreter (GH-21068)

Each interpreter now has its own empty frozenset singleton.

5 years agobpo-40521: Make dict free lists per-interpreter (GH-20645)
Victor Stinner [Tue, 23 Jun 2020 09:33:18 +0000 (11:33 +0200)] 
bpo-40521: Make dict free lists per-interpreter (GH-20645)

Each interpreter now has its own dict free list:

* Move dict free lists into PyInterpreterState.
* Move PyDict_MAXFREELIST define to pycore_interp.h
* Add _Py_dict_state structure.
* Add tstate parameter to _PyDict_ClearFreeList() and _PyDict_Fini().
* In debug mode, ensure that the dict free lists are not used after
  _PyDict_Fini() is called.
* Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS".

5 years agoSmall clean-ups for the random module (GH-21038)
Raymond Hettinger [Tue, 23 Jun 2020 02:38:59 +0000 (19:38 -0700)] 
Small clean-ups for the random module (GH-21038)

5 years agoImprove asyncio.loop.call_soon() documentation (GH-20883)
Roger Iyengar [Tue, 23 Jun 2020 02:16:00 +0000 (22:16 -0400)] 
Improve asyncio.loop.call_soon() documentation (GH-20883)

* Add a glossary entry for the term "callback"
* Link to it in loop.call_soon() and in the "Concurrency and Multithreading" section

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years agobpo-41078: Fix bltinmodule.c with Py_TRACE_REFS (GH-21058)
Victor Stinner [Mon, 22 Jun 2020 16:02:49 +0000 (18:02 +0200)] 
bpo-41078: Fix bltinmodule.c with Py_TRACE_REFS (GH-21058)

Add pycore_object.h include to fix bltinmodule.c when Py_TRACE_REFS
macro is defined.

5 years agobpo-1635741: Port _lzma module to multiphase initialization (GH-19382)
Dong-hee Na [Mon, 22 Jun 2020 15:53:07 +0000 (00:53 +0900)] 
bpo-1635741: Port _lzma module to multiphase initialization  (GH-19382)

5 years agobpo-41078: Add pycore_list.h internal header file (GH-21057)
Victor Stinner [Mon, 22 Jun 2020 15:39:32 +0000 (17:39 +0200)] 
bpo-41078: Add pycore_list.h internal header file (GH-21057)

* Move _PyList_ITEMS() to pycore_list.h.
* The C extension "_heapq" is now built with Py_BUILD_CORE_MODULE
  macro defined to access the internal C API.

5 years agobpo-41078: Rename pycore_tupleobject.h to pycore_tuple.h (GH-21056)
Victor Stinner [Mon, 22 Jun 2020 15:27:35 +0000 (17:27 +0200)] 
bpo-41078: Rename pycore_tupleobject.h to pycore_tuple.h (GH-21056)

5 years agobpo-41005: Fixed perrmission error (GH-20936)
Krishna Chivukula [Mon, 22 Jun 2020 09:06:07 +0000 (10:06 +0100)] 
bpo-41005: Fixed perrmission error (GH-20936)

* fixed issue 41005: webbrowser fails when xdg-settings cannot be executed

Co-authored-by: KrishnaSai2020 <krishnasai.chivukula@gmal.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
5 years agobpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)
Serhiy Storchaka [Mon, 22 Jun 2020 08:24:11 +0000 (11:24 +0300)] 
bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)

5 years agobpo-26407: Do not mask errors in csv. (GH-20536)
Serhiy Storchaka [Mon, 22 Jun 2020 08:21:59 +0000 (11:21 +0300)] 
bpo-26407: Do not mask errors in csv. (GH-20536)

Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in csv.reader(), csv.writer.writerow() and
csv.writer.writerows().

5 years agobpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)
Serhiy Storchaka [Mon, 22 Jun 2020 07:43:35 +0000 (10:43 +0300)] 
bpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)

Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().

5 years agobpo-41061: Fix incorrect expressions in hashtable (GH-21028)
Christian Heimes [Mon, 22 Jun 2020 07:41:48 +0000 (09:41 +0200)] 
bpo-41061: Fix incorrect expressions in hashtable (GH-21028)

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-41056: Fix a possible MemoryError leak within zoneinfo. (GH-21007)
Gregory P. Smith [Mon, 22 Jun 2020 07:39:28 +0000 (00:39 -0700)] 
bpo-41056: Fix a possible MemoryError leak within zoneinfo. (GH-21007)

This was detected by our Coverity scan as a REVERSE_INULL issue.

Automerge-Triggered-By: @gpshead
5 years agobpo-41056: Fix reference to deallocated stack in pathconfig (Coverity) (GH-21013)
Gregory P. Smith [Mon, 22 Jun 2020 07:27:20 +0000 (00:27 -0700)] 
bpo-41056: Fix reference to deallocated stack in pathconfig (Coverity) (GH-21013)

Reported by Coverity.  (CID 1457554 RETURN_LOCAL)

path0 is assigned as a pointer to this right before it goes out of scope.

5 years agoSkip tests to fix bot (GH-20777)
Joannah Nanjekye [Sun, 21 Jun 2020 23:59:43 +0000 (20:59 -0300)] 
Skip tests to fix bot (GH-20777)

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
5 years agobpo-40939: Rename PyPegen* functions to PyParser* (GH-21016)
Lysandros Nikolaou [Sun, 21 Jun 2020 23:47:46 +0000 (02:47 +0300)] 
bpo-40939: Rename PyPegen* functions to PyParser* (GH-21016)

Rename PyPegen* functions to PyParser*, so that we can remove the
old set of PyParser* functions that were using the old parser.

5 years agobpo-41052: Opt out serialization/deserialization for _random.Random (GH-21002)
Dong-hee Na [Sun, 21 Jun 2020 09:44:58 +0000 (18:44 +0900)] 
bpo-41052: Opt out serialization/deserialization for _random.Random (GH-21002)

5 years agobpo-41055: Remove outdated tests for the tp_print slot. (GH-21006)
Serhiy Storchaka [Sun, 21 Jun 2020 08:11:17 +0000 (11:11 +0300)] 
bpo-41055: Remove outdated tests for the tp_print slot. (GH-21006)

5 years agobpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)
Serhiy Storchaka [Sun, 21 Jun 2020 08:07:50 +0000 (11:07 +0300)] 
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)

5 years agobpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020)
Lysandros Nikolaou [Sun, 21 Jun 2020 02:18:01 +0000 (05:18 +0300)] 
bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020)

`GET_INVALID_TARGET` might unexpectedly return `NULL`, which if not
caught will cause a SEGFAULT. Therefore, this commit introduces a new
inline function `RAISE_SYNTAX_ERROR_INVALID_TARGET` that always
checks for `GET_INVALID_TARGET` returning NULL and can be used in
the grammar, replacing the long C ternary operation used till now.

5 years agobpo-41056: Use the fildes converter for fd to please Coverity. (GH-21011)
Gregory P. Smith [Sat, 20 Jun 2020 22:06:48 +0000 (15:06 -0700)] 
bpo-41056: Use the fildes converter for fd to please Coverity. (GH-21011)

There are a bunch of other fd: int uses in this file, I expect many if not
all of them would be better off using the fildes converter.  This particular
one was flagged by Coverity as it presumably flags fpathconf as not accepting
negative fds.  I'd expect the other fd's to have been flagged as well
otherwise.

I'm marking this one as skip news as it really is a no-op.

5 years agobpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl module. ...
Gregory P. Smith [Sat, 20 Jun 2020 19:15:03 +0000 (12:15 -0700)] 
bpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl module. (GH-21009)

Detected by Coverity.

5 years agobpo-40939: Remove the old parser (Part 2) (GH-21005)
Lysandros Nikolaou [Sat, 20 Jun 2020 18:07:25 +0000 (21:07 +0300)] 
bpo-40939: Remove the old parser (Part 2) (GH-21005)

Remove some remaining files and Makefile targets for the old parser

5 years agobpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)
Batuhan Taskaya [Sat, 20 Jun 2020 17:40:06 +0000 (20:40 +0300)] 
bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoAdd link to .pypirc specification (GH-20680)
Brian Rutledge [Sat, 20 Jun 2020 17:10:25 +0000 (13:10 -0400)] 
Add link to .pypirc specification (GH-20680)

Related to https://github.com/pypa/twine/issues/638 and https://github.com/pypa/packaging.python.org/issues/730, I wrote a spec based on the one that was removed in https://github.com/python/cpython/pull/13087. However, a Google search for "pypirc" turned up at least one [blog post](https://truveris.github.io/articles/configuring-pypirc/) that links to https://docs.python.org/3/distutils/packageindex.html#the-pypirc-file, which now just links to this document. So, I thought a link to the spec would be handy.

Automerge-Triggered-By: @jaraco
5 years agobpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)
Lysandros Nikolaou [Sat, 20 Jun 2020 12:57:27 +0000 (15:57 +0300)] 
bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)

5 years agobpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for '...
Vincent Férotin [Sat, 20 Jun 2020 12:55:05 +0000 (14:55 +0200)] 
bpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for '… (GH-20964)

…choices' argument of 'argparse.ArgumentParser.add_argument'.

Here's a short first proposal of doc. enhancement addressing [bpo-41024]().

Automerge-Triggered-By: @csabella
5 years agobpo-41043: Escape literal part of the path for glob(). (GH-20994)
Serhiy Storchaka [Sat, 20 Jun 2020 08:10:31 +0000 (11:10 +0300)] 
bpo-41043: Escape literal part of the path for glob(). (GH-20994)

5 years agobpo-41040: Fix test_modulefinder. (GH-20991)
Serhiy Storchaka [Fri, 19 Jun 2020 21:06:07 +0000 (00:06 +0300)] 
bpo-41040: Fix test_modulefinder. (GH-20991)

5 years agobpo-40636: Documentation for zip-strict (#20961)
Ram Rachum [Fri, 19 Jun 2020 20:39:22 +0000 (23:39 +0300)] 
bpo-40636: Documentation for zip-strict (#20961)

5 years agobpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)
Victor Stinner [Fri, 19 Jun 2020 16:01:20 +0000 (18:01 +0200)] 
bpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)

skip_if_broken_multiprocessing_synchronize() only attempts for create
a semaphore on Linux to fix multiprocessing
test_resource_tracker_reused() on macOS.

5 years agobpo-40077: Convert _bz2 module to use PyType_FromSpec (GH-20960)
Dong-hee Na [Fri, 19 Jun 2020 15:56:13 +0000 (00:56 +0900)] 
bpo-40077: Convert _bz2 module to use PyType_FromSpec (GH-20960)

5 years agoImprove blake2 comment for Victor (GH-20981)
Christian Heimes [Fri, 19 Jun 2020 14:11:02 +0000 (16:11 +0200)] 
Improve blake2 comment for Victor (GH-20981)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agoImprove readability of `formataddr` docstring (GH-20963)
Jürgen Gmach [Fri, 19 Jun 2020 11:57:30 +0000 (13:57 +0200)] 
Improve readability of `formataddr` docstring (GH-20963)

For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
5 years agobpo-40636: PEP 618: add strict parameter to zip() (GH-20921)
Guido van Rossum [Fri, 19 Jun 2020 10:16:57 +0000 (03:16 -0700)] 
bpo-40636: PEP 618: add strict parameter to zip() (GH-20921)

zip() now supports PEP 618's strict parameter, which raises a
ValueError if the arguments are exhausted at different lengths.
Patch by Brandt Bucher.

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Co-authored-by: Ram Rachum <ram@rachum.com>
5 years agobpo-40943: PY_SSIZE_T_CLEAN required for '#' formats (GH-20784)
Victor Stinner [Fri, 19 Jun 2020 09:45:31 +0000 (11:45 +0200)] 
bpo-40943: PY_SSIZE_T_CLEAN required for '#' formats (GH-20784)

The PY_SSIZE_T_CLEAN macro must now be defined to use
PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#",
"s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353.

Update _testcapi.test_buildvalue_issue38913().

5 years agobpo-40334: Produce better error messages on invalid targets (GH-20106)
Lysandros Nikolaou [Thu, 18 Jun 2020 23:10:43 +0000 (02:10 +0300)] 
bpo-40334: Produce better error messages on invalid targets (GH-20106)

The following error messages get produced:
- `cannot delete ...` for invalid `del` targets
- `... is an illegal 'for' target` for invalid targets in for
  statements
- `... is an illegal 'with' target` for invalid targets in
  with statements

Additionally, a few `cut`s were added in various places before the
invocation of the `invalid_*` rule, in order to speed things
up.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoUpdate CODEOWNERS to account for the new parser location (GH-20971)
Pablo Galindo [Thu, 18 Jun 2020 22:23:40 +0000 (23:23 +0100)] 
Update CODEOWNERS to account for the new parser location (GH-20971)

5 years agobpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075)
Serhiy Storchaka [Thu, 18 Jun 2020 19:08:27 +0000 (22:08 +0300)] 
bpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075)

5 years agobpo-40884: Added defaults parameter for logging.Formatter (GH-20668)
Bar Harel [Thu, 18 Jun 2020 14:18:58 +0000 (17:18 +0300)] 
bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)

Docs and tests are underway.

Automerge-Triggered-By: @vsajip
5 years agobpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)
Victor Stinner [Thu, 18 Jun 2020 12:53:19 +0000 (14:53 +0200)] 
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)

On Linux, skip tests using multiprocessing if the current user cannot
create a file in /dev/shm/ directory. Add the
skip_if_broken_multiprocessing_synchronize() function to the
test.support module.

5 years agobpo-41006: What's New: less => fewer modules (GH-20955)
Victor Stinner [Wed, 17 Jun 2020 23:20:51 +0000 (01:20 +0200)] 
bpo-41006: What's New: less => fewer modules (GH-20955)

Typo spotted by Eric V. Smith ;-)

5 years agobpo-41006: Remove init_sys_streams() hack (GH-20954)
Victor Stinner [Wed, 17 Jun 2020 23:11:46 +0000 (01:11 +0200)] 
bpo-41006: Remove init_sys_streams() hack (GH-20954)

The encodings.latin_1 module is no longer imported at startup. Now it
is only imported when it is the filesystem encoding or the stdio encoding.

5 years agobpo-41006: Document the runpy optimization (GH-20953)
Victor Stinner [Wed, 17 Jun 2020 21:58:58 +0000 (23:58 +0200)] 
bpo-41006: Document the runpy optimization (GH-20953)

5 years agobpo-41006: importlib.util no longer imports typing (GH-20938)
Victor Stinner [Wed, 17 Jun 2020 21:15:59 +0000 (23:15 +0200)] 
bpo-41006: importlib.util no longer imports typing (GH-20938)

Create importlib._abc submodule to avoid importing typing when
importlib.util is imported. Move Loader ABC into importlib._abc.

5 years agobpo-40637: Do not emit warnings for disabled builtin hashes (GH-20937)
stratakis [Wed, 17 Jun 2020 17:26:08 +0000 (19:26 +0200)] 
bpo-40637: Do not emit warnings for disabled builtin hashes (GH-20937)

test_hashlib emits some warnings when it cannot find some hashes
as it assumes they failed to compile. Since we can disable hashes
through configure, we emit the warnings only in the case that we
did not intentionaly disable them.

Automerge-Triggered-By: @tiran
5 years agobpo-41006: pkgutil imports lazily re (GH-20939)
Victor Stinner [Wed, 17 Jun 2020 17:11:50 +0000 (19:11 +0200)] 
bpo-41006: pkgutil imports lazily re (GH-20939)

The pkgutil module now imports lazily the re module to speedup Python
startup time.

5 years agobpo-41006: collections imports lazily heap (GH-20940)
Victor Stinner [Wed, 17 Jun 2020 17:10:47 +0000 (19:10 +0200)] 
bpo-41006: collections imports lazily heap (GH-20940)

The collections module now imports lazily the heapq modules in the
Counter.most_common() method to speedup Python startup time.

5 years agobpo-41009: fix requires_OS_version() class decorator (GH-20942)
Christian Heimes [Wed, 17 Jun 2020 17:09:10 +0000 (19:09 +0200)] 
bpo-41009: fix requires_OS_version() class decorator (GH-20942)

Signed-off-by: Christian Heimes <christian@python.org>
Automerge-Triggered-By: @tiran
5 years agobpo-41003: Fix test_copyreg when numpy is installed (GH-20935)
Victor Stinner [Wed, 17 Jun 2020 16:07:13 +0000 (18:07 +0200)] 
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935)

Fix test_copyreg when numpy is installed: test.pickletester now
saves/restores warnings.filters when importing numpy, to ignore
filters installed by numpy.

Add the save_restore_warnings_filters() function to the
test.support.warnings_helper module.

5 years agobpo-36346: Make unicodeobject.h C89 compatible (GH-20934)
Inada Naoki [Wed, 17 Jun 2020 14:43:01 +0000 (23:43 +0900)] 
bpo-36346: Make unicodeobject.h C89 compatible (GH-20934)

5 years agobpo-35059: Enhance _PyObject_GC_TRACK() macros (GH-20931)
Victor Stinner [Wed, 17 Jun 2020 12:23:04 +0000 (14:23 +0200)] 
bpo-35059: Enhance _PyObject_GC_TRACK() macros (GH-20931)

* Rename _PyObject_GC_TRACK_impl() to _PyObject_GC_TRACK()
* Rename _PyObject_GC_UNTRACK_impl() to _PyObject_GC_UNTRACK()
* Omit filename and lineno parameters if NDEBUG is defined.

5 years agobpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)
Inada Naoki [Wed, 17 Jun 2020 11:09:44 +0000 (20:09 +0900)] 
bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
5 years agobpo-32604: Clean up test.support.interpreters. (gh-20926)
Eric Snow [Wed, 17 Jun 2020 00:24:40 +0000 (18:24 -0600)] 
bpo-32604: Clean up test.support.interpreters. (gh-20926)

There were some minor adjustments needed and a few tests were missing.

https://bugs.python.org/issue32604

5 years agobpo-1635741: Port _gdbm module to multiphase initialization (GH-20920)
Dong-hee Na [Tue, 16 Jun 2020 16:41:23 +0000 (01:41 +0900)] 
bpo-1635741: Port _gdbm module to multiphase initialization (GH-20920)

5 years agobpo-40958: Avoid buffer overflow in the parser when indexing the current line (GH...
Pablo Galindo [Tue, 16 Jun 2020 15:49:43 +0000 (16:49 +0100)] 
bpo-40958: Avoid buffer overflow in the parser when indexing the current line (GH-20875)

5 years agobpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)
Victor Stinner [Tue, 16 Jun 2020 15:29:50 +0000 (17:29 +0200)] 
bpo-40989: Make _PyTraceMalloc_NewReference() internal (GH-20915)

Make the _PyTraceMalloc_NewReference() function fully internal:
remove it from the public C API and don't export it anymore.

5 years agobpo-40993: Don't run Travis CI coverage on PRs (GH-20916)
Victor Stinner [Tue, 16 Jun 2020 15:27:30 +0000 (17:27 +0200)] 
bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)

C and Python coverage jobs of Travis CI are no longer run on pull
requests, only on branches like master.

5 years agoRemove old comment in string_parser.c (GH-20906)
Pablo Galindo [Tue, 16 Jun 2020 01:13:33 +0000 (02:13 +0100)] 
Remove old comment in string_parser.c (GH-20906)

5 years agobpo-19569: Add a macro to suppress deprecation warnings (GH-9004)
Zackery Spytz [Tue, 16 Jun 2020 00:56:27 +0000 (18:56 -0600)] 
bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)

Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
5 years agobpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888)
Lysandros Nikolaou [Tue, 16 Jun 2020 00:27:33 +0000 (03:27 +0300)] 
bpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888)

When a file ends with a line that contains a line continuation character
the text of the emitted SyntaxError is empty, contrary to the old
parser, where the error text contained the text of the last line.

5 years agocloses bpo-28557: error message for bad raw readinto (GH-7496)
David Szotten [Mon, 15 Jun 2020 23:53:57 +0000 (00:53 +0100)] 
closes bpo-28557: error message for bad raw readinto (GH-7496)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agobpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901)
Victor Stinner [Mon, 15 Jun 2020 23:28:07 +0000 (01:28 +0200)] 
bpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901)

The PyObject_INIT() and PyObject_INIT_VAR() macros become aliases to,
respectively, PyObject_Init() and PyObject_InitVar() functions.

Rename _PyObject_INIT() and _PyObject_INIT_VAR() static inline
functions to, respectively, _PyObject_Init() and _PyObject_InitVar(),
and move them to pycore_object.h. Remove their return value:
their return type becomes void.

The _datetime module is now built with the Py_BUILD_CORE_MODULE macro
defined.

Remove an outdated comment on _Py_tracemalloc_config.

5 years agobpo-36020: Require vsnprintf() to build Python (GH-20899)
Victor Stinner [Mon, 15 Jun 2020 22:54:44 +0000 (00:54 +0200)] 
bpo-36020: Require vsnprintf() to build Python (GH-20899)

The C99 functions snprintf() and vsnprintf() are now required
to build Python.

PyOS_snprintf() and PyOS_vsnprintf() no longer call Py_FatalError().
Previously, they called Py_FatalError() on a buffer overflow on platforms
which don't provide vsnprintf().

5 years agobpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)
Victor Stinner [Mon, 15 Jun 2020 19:59:47 +0000 (21:59 +0200)] 
bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)

On Windows, #include "pyerrors.h" no longer defines "snprintf" and
"vsnprintf" macros.

PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
behavior.

Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
calls with PyOS_vsnprintf().

5 years agobpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491)
Xavier Fernandez [Mon, 15 Jun 2020 19:16:48 +0000 (21:16 +0200)] 
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491)

5 years agobpo-40448: ensurepip: Do not use cache (GH-19812)
Krzysztof Konopko [Mon, 15 Jun 2020 17:28:46 +0000 (19:28 +0200)] 
bpo-40448: ensurepip: Do not use cache (GH-19812)

ensurepip optionally installs or upgrades 'pip' and 'setuptools' using
the version of those modules bundled with Python.  The internal PIP
installation routine by default temporarily uses its cache, if it
exists.  This is undesirable as Python builds and installations may be
independent of the user running the build, whilst PIP cache location
is dependent on the user's environment and outside of the build
environment.

At the same time, there's no value in using the cache while installing
bundled modules.

This change disables PIP caching when used in ensurepip.

5 years agobpo-1635741: Port _dbm module to multiphase initialization (GH-20848)
Dong-hee Na [Mon, 15 Jun 2020 16:20:54 +0000 (01:20 +0900)] 
bpo-1635741: Port _dbm module to multiphase initialization (GH-20848)

5 years agobpo-34226: fix cgi.parse_multipart without content_length (GH-8530)
roger [Mon, 15 Jun 2020 14:58:54 +0000 (16:58 +0200)] 
bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)

In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.

5 years agobpo-40910: PyConfig_Clear() clears _orig_argv (GH-20886)
Victor Stinner [Mon, 15 Jun 2020 14:27:47 +0000 (16:27 +0200)] 
bpo-40910: PyConfig_Clear() clears _orig_argv (GH-20886)

bpo-40910, bpo-40953: PyConfig_Clear() clears _orig_argv.

5 years agoImprove readability and style in parser files (GH-20884)
Pablo Galindo [Mon, 15 Jun 2020 13:23:43 +0000 (14:23 +0100)] 
Improve readability and style in parser files (GH-20884)

5 years agobpo-29782: Consolidate _Py_Bit_Length() (GH-20739)
Niklas Fiekas [Mon, 15 Jun 2020 12:33:48 +0000 (14:33 +0200)] 
bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)

In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better
location. GH-20518 added a more appropriate header file for bit utilities. It
also shows how to properly use intrinsics. This allows reconsidering bpo-29782.

* Move the function to the new header.
* Changed return type to match __builtin_clzl() and reviewed usage.
* Use intrinsics where available.
* Pick a fallback implementation suitable for inlining.

5 years agobpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() (GH-20563)
Rémi Lapeyre [Mon, 15 Jun 2020 08:03:07 +0000 (10:03 +0200)] 
bpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() (GH-20563)

Automerge-Triggered-By: @vsajip
5 years agoFix trailing whitespace in keyword.py (GH-20881)
Pablo Galindo [Mon, 15 Jun 2020 03:33:33 +0000 (04:33 +0100)] 
Fix trailing whitespace in keyword.py (GH-20881)

5 years agoInclude soft keywords in keyword.py (GH-20877)
Pablo Galindo [Mon, 15 Jun 2020 02:55:15 +0000 (03:55 +0100)] 
Include soft keywords in keyword.py (GH-20877)

5 years agobpo-40890: Fix compiler warning in dictobject.c (GH-20876)
Pablo Galindo [Mon, 15 Jun 2020 01:05:20 +0000 (02:05 +0100)] 
bpo-40890: Fix compiler warning in dictobject.c (GH-20876)

5 years agoFixes dead links to Django's logging config docs (GH-20823)
kevin seelbach [Sun, 14 Jun 2020 17:23:47 +0000 (12:23 -0500)] 
Fixes dead links to Django's logging config docs (GH-20823)

Fixes two outdated URLs to point at the current "stable" version of Django's logging documentation.

Automerge-Triggered-By: @vsajip
5 years agobpo-30064: Fix slow asyncio sock test (GH-20868)
Fantix King [Sun, 14 Jun 2020 07:43:57 +0000 (02:43 -0500)] 
bpo-30064: Fix slow asyncio sock test (GH-20868)

Using a log2n way to fill a much smaller buffer, and receiving in a cleaner way with EOF.

The failing test was reproducible using the following command thanks to @aeros :

```bash
./python -m test test_asyncio.test_sock_lowlevel --match test_sock_client_racing -j100 -F -v
```

According to test results, we may still need to bump the timeout:

https://github.com/python/cpython/blob/5aad027db9618f22f6fa2274e05dd50f928d2ed7/Lib/test/test_asyncio/test_sock_lowlevel.py#L256-L257

5 years agoSome reformatting (suggested by Black) and minor factoring. (GH-20865)
Raymond Hettinger [Sun, 14 Jun 2020 02:17:28 +0000 (19:17 -0700)] 
Some reformatting (suggested by Black) and minor factoring. (GH-20865)

5 years agobpo-40855: Fix ignored mu and xbar parameters (GH-20835)
Raymond Hettinger [Sat, 13 Jun 2020 22:55:52 +0000 (15:55 -0700)] 
bpo-40855: Fix ignored mu and xbar parameters (GH-20835)

5 years agobpo-37674: Tweak imp module deprecation note in the docs (GH-20480)
Zackery Spytz [Sat, 13 Jun 2020 17:35:08 +0000 (11:35 -0600)] 
bpo-37674: Tweak imp module deprecation note in the docs (GH-20480)

5 years agoMinor code clean-ups (GH-20838)
Raymond Hettinger [Sat, 13 Jun 2020 16:46:47 +0000 (09:46 -0700)] 
Minor code clean-ups (GH-20838)