Commit graph

107604 commits

Author SHA1 Message Date
Vincent Férotin 344c2a75c1
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
2020-06-20 05:55:05 -07:00
Serhiy Storchaka 9355868458
bpo-41043: Escape literal part of the path for glob(). (GH-20994) 2020-06-20 11:10:31 +03:00
Serhiy Storchaka a041e116db
bpo-41040: Fix test_modulefinder. (GH-20991) 2020-06-20 00:06:07 +03:00
Ram Rachum 59cf853332
bpo-40636: Documentation for zip-strict (#20961) 2020-06-19 13:39:22 -07:00
Victor Stinner 3358da4054
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.
2020-06-19 18:01:20 +02:00
Dong-hee Na ec68918795
bpo-40077: Convert _bz2 module to use PyType_FromSpec (GH-20960) 2020-06-20 00:56:13 +09:00
Christian Heimes 8a0fe7b454
Improve blake2 comment for Victor (GH-20981)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-06-19 07:11:02 -07:00
Jürgen Gmach 66a65ba43c
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
2020-06-19 04:57:30 -07:00
Guido van Rossum 310f6aa7db
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>
2020-06-19 12:16:57 +02:00
Victor Stinner 37bb289556
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().
2020-06-19 11:45:31 +02:00
Lysandros Nikolaou 01ece63d42
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>
2020-06-19 00:10:43 +01:00
Pablo Galindo d906f0ec1a
Update CODEOWNERS to account for the new parser location (GH-20971) 2020-06-18 23:23:40 +01:00
Serhiy Storchaka 8a64ceaf98
bpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075) 2020-06-18 22:08:27 +03:00
Bar Harel 8f192d12af
bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)
Docs and tests are underway.

Automerge-Triggered-By: @vsajip
2020-06-18 07:18:58 -07:00
Victor Stinner ddbeb2f3e0
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.
2020-06-18 14:53:19 +02:00
Victor Stinner 2c2a4f3d85
bpo-41006: What's New: less => fewer modules (GH-20955)
Typo spotted by Eric V. Smith ;-)
2020-06-18 01:20:51 +02:00
Victor Stinner 1bf7959dce
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.
2020-06-18 01:11:46 +02:00
Victor Stinner 4c18fc8f1d
bpo-41006: Document the runpy optimization (GH-20953) 2020-06-17 23:58:58 +02:00
Victor Stinner 9e09849d20
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.
2020-06-17 23:15:59 +02:00
stratakis 236a0f5cf0
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
2020-06-17 10:26:08 -07:00
Victor Stinner 98ce7b107e
bpo-41006: pkgutil imports lazily re (GH-20939)
The pkgutil module now imports lazily the re module to speedup Python
startup time.
2020-06-17 19:11:50 +02:00
Victor Stinner 7824cc05bf
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.
2020-06-17 19:10:47 +02:00
Christian Heimes bb6ec14479
bpo-41009: fix requires_OS_version() class decorator (GH-20942)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: @tiran
2020-06-17 10:09:10 -07:00
Victor Stinner 8362893e3f
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.
2020-06-17 18:07:13 +02:00
Inada Naoki 8e34e92caa
bpo-36346: Make unicodeobject.h C89 compatible (GH-20934) 2020-06-17 23:43:01 +09:00
Victor Stinner 07923f32b1
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.
2020-06-17 14:23:04 +02:00
Inada Naoki 2c4928d37e
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>
2020-06-17 20:09:44 +09:00
Eric Snow 818f5b597a
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
2020-06-16 18:24:40 -06:00
Dong-hee Na c4862e333a
bpo-1635741: Port _gdbm module to multiphase initialization (GH-20920) 2020-06-17 01:41:23 +09:00
Pablo Galindo 51c5896b62
bpo-40958: Avoid buffer overflow in the parser when indexing the current line (GH-20875) 2020-06-16 16:49:43 +01:00
Victor Stinner fcc60e40bb
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.
2020-06-16 17:29:50 +02:00
Victor Stinner fc710ee266
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.
2020-06-16 17:27:30 +02:00
Pablo Galindo e0bec69854
Remove old comment in string_parser.c (GH-20906) 2020-06-16 02:13:33 +01:00
Zackery Spytz de4304dad8
bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)
Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
2020-06-16 09:56:27 +09:00
Lysandros Nikolaou 113e2b0a07
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.
2020-06-16 01:27:33 +01:00
David Szotten 8666356280
closes bpo-28557: error message for bad raw readinto (GH-7496)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-06-15 18:53:57 -05:00
Victor Stinner 04fc4f2a46
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.
2020-06-16 01:28:07 +02:00
Victor Stinner 7ab92d54b5
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().
2020-06-16 00:54:44 +02:00
Victor Stinner e822e37946
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().
2020-06-15 21:59:47 +02:00
Xavier Fernandez 5f79f46612
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491) 2020-06-15 15:16:48 -04:00
Krzysztof Konopko 4a3a682b12
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.
2020-06-15 13:28:46 -04:00
Dong-hee Na bf69a8f99f
bpo-1635741: Port _dbm module to multiphase initialization (GH-20848) 2020-06-16 01:20:54 +09:00
roger d8cf3514dd
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.
2020-06-15 07:58:54 -07:00
Victor Stinner e2d47a0568
bpo-40910: PyConfig_Clear() clears _orig_argv (GH-20886)
bpo-40910, bpo-40953: PyConfig_Clear() clears _orig_argv.
2020-06-15 16:27:47 +02:00
Pablo Galindo fb61c42361
Improve readability and style in parser files (GH-20884) 2020-06-15 14:23:43 +01:00
Niklas Fiekas 794e7d1ab2
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.
2020-06-15 14:33:48 +02:00
Rémi Lapeyre 25f38d7044
bpo-40836: Add docstring to logging.fatal() and logging.Logger.fatal() (GH-20563)
Automerge-Triggered-By: @vsajip
2020-06-15 01:03:07 -07:00
Pablo Galindo 5fc4f8ae68
Fix trailing whitespace in keyword.py (GH-20881) 2020-06-15 04:33:33 +01:00
Pablo Galindo 78319e373d
Include soft keywords in keyword.py (GH-20877) 2020-06-15 03:55:15 +01:00
Pablo Galindo 10c3b2120a
bpo-40890: Fix compiler warning in dictobject.c (GH-20876) 2020-06-15 02:05:20 +01:00