]> granicus.if.org Git - python/log
python
5 years agobpo-18578: Rename and document test.bytecode_helper as test.support.bytecode_helper...
Joannah Nanjekye [Thu, 12 Sep 2019 09:02:59 +0000 (10:02 +0100)]
bpo-18578: Rename and document test.bytecode_helper as test.support.bytecode_helper (GH-15168)

Rename and document test.bytecode_helper as test.support.bytecode_helper

5 years agobpo-38120: Fix DeprecationWarning in test_random for invalid type of arguments to...
Xtreak [Thu, 12 Sep 2019 08:13:20 +0000 (09:13 +0100)]
bpo-38120: Fix DeprecationWarning in test_random for invalid type of arguments to random.seed. (GH-15987)

5 years agoCorrect typos in the codecs module documentation (#15135)
Géry Ogam [Thu, 12 Sep 2019 07:41:32 +0000 (09:41 +0200)]
Correct typos in the codecs module documentation (#15135)

5 years agocloses bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
Benjamin Peterson [Wed, 11 Sep 2019 23:43:22 +0000 (00:43 +0100)]
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)

The >=, checking whether a module index was in already in the module-by-index list, needed to be strict.

Also, fold nested ifs into one and fix some bad spacing.

5 years agobpo-36876: Add a tool that identifies unsupported global C variables. (#15877)
Eric Snow [Wed, 11 Sep 2019 18:49:45 +0000 (19:49 +0100)]
bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)

5 years agobpo-36270: Doc: add link to traceback object reference (GH-13119)
Björn Meier [Wed, 11 Sep 2019 17:55:02 +0000 (19:55 +0200)]
bpo-36270: Doc: add link to traceback object reference (GH-13119)

5 years agoCorrect typo in min version test (GH-16000)
Christian Heimes [Wed, 11 Sep 2019 17:48:58 +0000 (19:48 +0200)]
Correct typo in min version test (GH-16000)

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)
Hai Shi [Wed, 11 Sep 2019 17:25:55 +0000 (12:25 -0500)]
bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)

https://bugs.python.org/issue37698

5 years agobpo-34001: Fix test_ssl with LibreSSL (GH-13783)
Christian Heimes [Wed, 11 Sep 2019 17:24:47 +0000 (19:24 +0200)]
bpo-34001: Fix test_ssl with LibreSSL (GH-13783)

5 years agoDoc: recursive glob ** follows symlinks to directories (GH-12918)
Marc [Wed, 11 Sep 2019 17:17:05 +0000 (10:17 -0700)]
Doc: recursive glob ** follows symlinks to directories (GH-12918)

5 years agobpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)
Dino Viehland [Wed, 11 Sep 2019 17:16:34 +0000 (10:16 -0700)]
bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)

Summary: This mostly migrates Python-ast.c to PEP384 and removes all statics from the whole file. This modifies the generator itself that generates the Python-ast.c. It leaves in the usage of _PyObject_LookupAttr even though it's not fully PEP384 compatible (this could always be shimmed in by anyone who needs it).

5 years agobpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)
Joannah Nanjekye [Wed, 11 Sep 2019 17:12:21 +0000 (18:12 +0100)]
bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)

The socket module now has the socket.send_fds() and socket.recv.fds() functions.
Contributed by Joannah Nanjekye, Shinya Okano (original patch)
and Victor Stinner.

Co-Authored-By: Victor Stinner <vstinner@redhat.com>
5 years agobpo-38117: Test with OpenSSL 1.1.1d (GH-15983)
Christian Heimes [Wed, 11 Sep 2019 16:45:52 +0000 (18:45 +0200)]
bpo-38117: Test with OpenSSL 1.1.1d (GH-15983)

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988)
Hai Shi [Wed, 11 Sep 2019 16:38:47 +0000 (11:38 -0500)]
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988)

https://bugs.python.org/issue37750

Automerge-Triggered-By: @matrixise
5 years agobpo-32592: Set Windows 8 as the minimum required version for API support (GH-15951)
Steve Dower [Wed, 11 Sep 2019 16:03:37 +0000 (17:03 +0100)]
bpo-32592: Set Windows 8 as the minimum required version for API support (GH-15951)

5 years agobpo-36528: Remove duplicate re tests. (GH-2689)
Xtreak [Wed, 11 Sep 2019 16:02:34 +0000 (17:02 +0100)]
bpo-36528: Remove duplicate re tests. (GH-2689)

Co-Authored-By: Makdon <makdon@makdon.me>
5 years agobpo-35923: Update the BuiltinImporter to use loader._ORIGIN instead of a hard-coded...
Dong-hee Na [Wed, 11 Sep 2019 16:00:02 +0000 (01:00 +0900)]
bpo-35923: Update the BuiltinImporter to use loader._ORIGIN instead of a hard-coded value (GH-15651)

5 years agoDoc: Fix missing negation. (GH-14640)
Julien Palard [Wed, 11 Sep 2019 15:55:22 +0000 (17:55 +0200)]
Doc: Fix missing negation. (GH-14640)

Reported by Hug Capella on docs@.

Automerge-Triggered-By: @matrixise
5 years agobpo-38113: Update Python/ast.c to PEP-384 (GH-15975)
Dino Viehland [Wed, 11 Sep 2019 15:47:17 +0000 (08:47 -0700)]
bpo-38113: Update Python/ast.c to PEP-384 (GH-15975)

Removes statics for better subinterpreter support and moves to _PyType_Name

https://bugs.python.org/issue38113

Automerge-Triggered-By: @tiran
5 years agoImprove clarity of try-return-finally-return (GH-15677)
toonarmycaptain [Wed, 11 Sep 2019 15:37:13 +0000 (10:37 -0500)]
Improve clarity of try-return-finally-return (GH-15677)

Clarify execution in try-return-finally-return case.

5 years agobpo-34331: Fix incorrectly pluralized abstract class error message. (GH-8670)
Daniel Andrade [Wed, 11 Sep 2019 15:29:44 +0000 (08:29 -0700)]
bpo-34331: Fix incorrectly pluralized abstract class error message. (GH-8670)

5 years agobpo-38114: Do not include pip.ini in Nuget package (GH-15964)
Steve Dower [Wed, 11 Sep 2019 15:16:27 +0000 (16:16 +0100)]
bpo-38114: Do not include pip.ini in Nuget package (GH-15964)

5 years agobpo-33166: Change os.cpu_count to return active (real) processors (GH-15949)
Steve Dower [Wed, 11 Sep 2019 15:15:39 +0000 (16:15 +0100)]
bpo-33166: Change os.cpu_count to return active (real) processors (GH-15949)

5 years agobpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
Jakub Kulík [Wed, 11 Sep 2019 15:11:57 +0000 (17:11 +0200)]
bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)

Use fdwalk() on platforms that support it to implement os.closerange().

5 years agobpo-36182: Update pathlib.Path.write_text() docs (GH-12161)
Lysandros Nikolaou [Wed, 11 Sep 2019 15:08:10 +0000 (18:08 +0300)]
bpo-36182: Update pathlib.Path.write_text() docs (GH-12161)

with the case of an existing file

5 years agobpo-36260: Add pitfalls to zipfile module documentation (#13378)
JunWei Song [Wed, 11 Sep 2019 15:04:12 +0000 (23:04 +0800)]
bpo-36260: Add pitfalls to zipfile module documentation (#13378)

* bpo-36260: Add pitfalls to zipfile module documentation

We saw vulnerability warning description (including zip bomb) in Doc/library/xml.rst file.
This gave us the idea of documentation improvement.

So, we moved a little bit forward :P
And the doc patch can be found (pr).

* fix trailing whitespace

* 📜🤖 Added by blurb_it.

* Reformat text for consistency.

5 years agobpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)
Daniel Abrahamsson [Wed, 11 Sep 2019 14:58:56 +0000 (16:58 +0200)]
bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)

Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:

```
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```

5 years agoImprove the io module documentation (GH-15099)
Géry Ogam [Wed, 11 Sep 2019 14:55:13 +0000 (16:55 +0200)]
Improve the io module documentation (GH-15099)

* Update io.rst

* Apply suggestions from code review

Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
5 years agobpo-36634: Fixes activate.bat when existing values contain double quotes (GH-15924)
Steve Dower [Wed, 11 Sep 2019 14:41:21 +0000 (15:41 +0100)]
bpo-36634: Fixes activate.bat when existing values contain double quotes (GH-15924)

5 years agobpo-35224: Additional documentation for Assignment Expressions (GH-15935)
Emily Morehouse [Wed, 11 Sep 2019 14:37:12 +0000 (15:37 +0100)]
bpo-35224: Additional documentation for Assignment Expressions (GH-15935)

Add or update assignment expression documentation for:
- FAQ - Design
- Reference - Expressions
- Reference - Lexical Analysis

https://bugs.python.org/issue35224

Automerge-Triggered-By: @matrixise
5 years agobpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining...
blhsing [Wed, 11 Sep 2019 14:28:06 +0000 (07:28 -0700)]
bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable (GH-15565)

* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable

* 📜🤖 Added by blurb_it.

* Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst

added name of the contributor

* bpo-37972: made all dunder methods chainable for _Call

* bpo-37972: delegate only attributes of tuple instead to __getattr__

5 years agoDoc: Indicate locations of parse_qs, parse_qsl, escape (GH-14828)
Simon Willison [Wed, 11 Sep 2019 14:25:26 +0000 (09:25 -0500)]
Doc: Indicate locations of parse_qs, parse_qsl, escape (GH-14828)

Since they have been removed from cgi it's useful to remind people where they
can be found instead.

5 years agoUpdate ftplib.all_errors documentation to match code (#15026)
Andrew Scheller [Wed, 11 Sep 2019 14:18:00 +0000 (15:18 +0100)]
Update ftplib.all_errors documentation to match code (#15026)

The documentation doesn't mention the `EOFError` that https://github.com/python/cpython/blob/master/Lib/ftplib.py#L66 includes

5 years agobpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895)
Raymond Hettinger [Wed, 11 Sep 2019 14:17:32 +0000 (07:17 -0700)]
bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895)

* bpo-38096: Clean up the "struct sequence" / "named tuple" docs

* Fix remaining occurrences of "struct sequence"

* Repair a user visible docstring

5 years agobpo-37651: Document CancelledError is now a subclass of BaseException (GH-15950)
Xtreak [Wed, 11 Sep 2019 14:12:51 +0000 (15:12 +0100)]
bpo-37651: Document CancelledError is now a subclass of BaseException (GH-15950)

https://bugs.python.org/issue37651

Automerge-Triggered-By: @1st1
5 years agobpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861)
Anjali Bansal [Wed, 11 Sep 2019 14:09:53 +0000 (19:39 +0530)]
bpo-33187: Document ElementInclude (XInclude) support in ElementTree (GH-8861)

5 years agobpo-23460: Fix documentation for decimal string :g formatting (GH-11850)
Brennan D Baraban [Wed, 11 Sep 2019 13:59:37 +0000 (06:59 -0700)]
bpo-23460: Fix documentation for decimal string :g formatting (GH-11850)

5 years agobpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)
Joannah Nanjekye [Wed, 11 Sep 2019 13:58:42 +0000 (14:58 +0100)]
bpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)

https://bugs.python.org/issue37488

Automerge-Triggered-By: @pganssle
5 years agobpo-36919: make test_source_encoding.test_issue2301 implementation-independent (...
Pavel Koneski [Wed, 11 Sep 2019 13:57:33 +0000 (06:57 -0700)]
bpo-36919: make test_source_encoding.test_issue2301 implementation-independent (#13639)

* bpo-36919: make test_issue2301 implementation-independent

5 years agocloses bpo-37252: Fix devpoll tests. (GH-14017)
Jakub Kulík [Wed, 11 Sep 2019 13:42:04 +0000 (15:42 +0200)]
closes bpo-37252: Fix devpoll tests. (GH-14017)

5 years agobpo-37305: add MIME type for Web App Manifest (#14199)
Filip Š [Wed, 11 Sep 2019 13:32:04 +0000 (15:32 +0200)]
bpo-37305: add MIME type for Web App Manifest (#14199)

* bpo-37305: add MIME type for Web App Manifest

* bpo-37305: add news entry

* Restore indentation and sort by value

5 years agobpo-31163: Added return values to pathlib.Path instance's rename and replace methods...
hui shang [Wed, 11 Sep 2019 13:26:49 +0000 (21:26 +0800)]
bpo-31163: Added return values to pathlib.Path instance's rename and replace methods. (GH-13582)

* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.

5 years agobpo-33944: note about the intended use of code in .pth files (GH-10131)
native-api [Wed, 11 Sep 2019 13:21:04 +0000 (16:21 +0300)]
bpo-33944: note about the intended use of code in .pth files (GH-10131)

https://bugs.python.org/issue33944

5 years agoTurn off AppVeyor CI (GH-15929)
Zachary Ware [Wed, 11 Sep 2019 13:17:53 +0000 (14:17 +0100)]
Turn off AppVeyor CI (GH-15929)

5 years agobpo-33459: Fix "tuple displays" term in Expressions.rst (GH-6760)
Andre Delfino [Wed, 11 Sep 2019 13:16:11 +0000 (10:16 -0300)]
bpo-33459: Fix "tuple displays" term in Expressions.rst (GH-6760)

https://bugs.python.org/issue33459

Automerge-Triggered-By: @matrixise
5 years agobpo-34519: Add additional aliases for HP Roman 8 (GH-8956)
Michael Osipov [Wed, 11 Sep 2019 13:08:41 +0000 (15:08 +0200)]
bpo-34519: Add additional aliases for HP Roman 8 (GH-8956)

* bpo-34519: Add additional aliases for HP Roman 8

HP Roman 8 is known under mode aliases than listed in aliases.py.

Patch by Michael Osipov.

5 years agobpo-38107: Replace direct future and task contructor calls with factories in asyncio...
Andrew Svetlov [Wed, 11 Sep 2019 13:07:37 +0000 (16:07 +0300)]
bpo-38107: Replace direct future and task contructor calls with factories in asyncio tests (GH-15928)

5 years agobpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler (GH-11398)
Géry Ogam [Wed, 11 Sep 2019 13:03:46 +0000 (15:03 +0200)]
bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler (GH-11398)

5 years agoDoc: Use walrus operator in example. (GH-15934)
Julien Palard [Wed, 11 Sep 2019 13:01:18 +0000 (15:01 +0200)]
Doc: Use walrus operator in example. (GH-15934)

5 years agobpo-35943: Prevent PyImport_GetModule() from returning a partially-initialized module...
Joannah Nanjekye [Wed, 11 Sep 2019 12:47:39 +0000 (13:47 +0100)]
bpo-35943: Prevent PyImport_GetModule() from returning a partially-initialized module (GH-15057)

5 years agoDoc: Fix typo in fastsearch comments (GH-14608)
Valentin Haenel [Wed, 11 Sep 2019 12:43:29 +0000 (14:43 +0200)]
Doc: Fix typo in fastsearch comments (GH-14608)

5 years agobpo-37326: Include libffi license when available (GH-15921)
Steve Dower [Wed, 11 Sep 2019 12:43:00 +0000 (13:43 +0100)]
bpo-37326: Include libffi license when available (GH-15921)

5 years agobpo-35649: update http client example (GH-11441)
Ashwin Ramaswami [Wed, 11 Sep 2019 12:41:54 +0000 (05:41 -0700)]
bpo-35649: update http client example (GH-11441)

5 years agoMinor ReST formatting fixes in subprocess docs (#14876)
Tim Hoffmann [Wed, 11 Sep 2019 11:26:31 +0000 (13:26 +0200)]
Minor ReST formatting fixes in subprocess docs (#14876)

5 years agobpo-35603: Add a note on difflib table header interpreted as HTML (GH-11439)
Xtreak [Wed, 11 Sep 2019 11:21:31 +0000 (12:21 +0100)]
bpo-35603: Add a note on difflib table header interpreted as HTML (GH-11439)

5 years agobpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (#10638)
Pierre Quentel [Wed, 11 Sep 2019 11:05:53 +0000 (13:05 +0200)]
bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (#10638)

* bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has no content-length header

* Add Misc/NEWS.d/next file.

* Add rst formatting for NEWS.d/next file

* Reaplce assert by self.assertEqual

5 years agobpo-35168: Make shlex.punctuation_chars read-only (#11631)
Alex [Wed, 11 Sep 2019 11:04:04 +0000 (14:04 +0300)]
bpo-35168: Make shlex.punctuation_chars read-only (#11631)

* bpo-35168: Documentation about shlex.punctuation_chars now states that it should be set in __init__.py

* bpo-35168: Convert shlex.punctuation_chars to read-only property

* Add NEWS.d entry

5 years agobpo-32972: Document IsolatedAsyncioTestCase of unittest module (GH-15878)
Xtreak [Wed, 11 Sep 2019 11:02:14 +0000 (12:02 +0100)]
bpo-32972: Document IsolatedAsyncioTestCase of unittest module (GH-15878)

* Document `unittest.IsolatedAsyncioTestCase` API
* Add a simple example with respect to order of evaluation of setup and teardown calls.

https://bugs.python.org/issue32972

Automerge-Triggered-By: @asvetlov
5 years agobpo-37151: remove special case for PyCFunction from PyObject_Call (GH-14684)
Jeroen Demeyer [Wed, 11 Sep 2019 11:01:01 +0000 (13:01 +0200)]
bpo-37151: remove special case for PyCFunction from PyObject_Call (GH-14684)

bpo-37151: remove special case for PyCFunction from PyObject_Call

Alse, make the undocumented function PyCFunction_Call an alias
of PyObject_Call and deprecate it.

5 years agobpo-38103: fix conflicting labels in the docs. (GH-15906)
Ezio Melotti [Wed, 11 Sep 2019 10:57:59 +0000 (11:57 +0100)]
bpo-38103: fix conflicting labels in the docs. (GH-15906)

5 years agobpo-35066: Make trailing percent test more portable. (GH-15907)
Benjamin Peterson [Wed, 11 Sep 2019 10:50:38 +0000 (11:50 +0100)]
bpo-35066: Make trailing percent test more portable. (GH-15907)

Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.

5 years agobpo-28494: install ziptestdata to fix install bot (GH-15902)
Gregory P. Smith [Wed, 11 Sep 2019 10:31:37 +0000 (05:31 -0500)]
bpo-28494: install ziptestdata to fix install bot (GH-15902)

5 years agobpo-25810: Clarify eval() docs, it does not keywords (GH-15173)
smokephil [Wed, 11 Sep 2019 10:30:04 +0000 (12:30 +0200)]
bpo-25810: Clarify eval() docs, it does not keywords (GH-15173)

5 years agobpo-37409: fix relative import with no parent (#14956)
Ben Lewis [Wed, 11 Sep 2019 10:09:47 +0000 (20:09 +1000)]
bpo-37409: fix relative import with no parent (#14956)

Relative imports use resolve_name to get the absolute target name,
which first seeks the current module's absolute package name from the globals:
If __package__ (and __spec__.parent) are missing then
import uses __name__, truncating the last segment if
the module is a submodule rather than a package __init__.py
(which it guesses from whether __path__ is defined).

The __name__ attempt should fail if there is no parent package (top level modules),
if __name__ is '__main__' (-m entry points), or both (scripts).
That is, if both __name__ has no subcomponents and the module does not seem
to be a package __init__ module then import should fail.

5 years agobpo-37585: Add clarification regarding comparing dict.values() (GH-14954)
Kyle Stanley [Wed, 11 Sep 2019 10:01:41 +0000 (06:01 -0400)]
bpo-37585: Add clarification regarding comparing dict.values() (GH-14954)

5 years agobpo-16438: Doc: confusing text regarding numeric precedence corrected (GH-10521)
Anjali [Wed, 11 Sep 2019 09:58:27 +0000 (04:58 -0500)]
bpo-16438: Doc: confusing text regarding numeric precedence corrected (GH-10521)

5 years agobpo-38081: Fixes ntpath.realpath('NUL') (GH-15899)
Steve Dower [Wed, 11 Sep 2019 09:48:36 +0000 (10:48 +0100)]
bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899)

5 years agobpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823)
Greg Price [Wed, 11 Sep 2019 09:25:26 +0000 (02:25 -0700)]
bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823)

A root cause of bpo-37936 is that it's easy to write a .gitignore
rule that's intended to apply to a specific file (e.g., the
`pyconfig.h` generated by `./configure`) but actually applies to all
similarly-named files in the tree (e.g., `PC/pyconfig.h`.)

Specifically, any rule with no non-trailing slashes is applied in an
"unrooted" way, to files anywhere in the tree.  This means that if we
write the rules in the most obvious-looking way, then

 * for specific files we want to ignore that happen to be in
   subdirectories (like `Modules/config.c`), the rule will work
   as intended, staying "rooted" to the top of the tree; but

 * when a specific file we want to ignore happens to be at the root of
   the repo (like `platform`), then the obvious rule (`platform`) will
   apply much more broadly than intended: if someone tries to add a
   file or directory named `platform` somewhere else in the tree, it
   will unexpectedly get ignored.

That's surprising behavior that can make the .gitignore file's
behavior feel finicky and unpredictable.

To avoid it, we can simply always give a rule "rooted" behavior when
that's what's intended, by systematically using leading slashes.

Further, to help make the pattern obvious when looking at the file and
minimize any need for thinking about the syntax when adding new rules:
separate the rules into one group for each type, with brief comments
identifying them.

For most of these rules it's clear whether they're meant to be rooted
or unrooted, but in a handful of cases I've only guessed.  In that
case the safer default (the choice that won't hide information) is the
narrower, rooted meaning, with a leading slash.  If for some of these
the unrooted meaning is desired after all, it'll be easy to move them
to the unrooted section at the top.

5 years agobpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)
Gregory P. Smith [Wed, 11 Sep 2019 09:23:05 +0000 (04:23 -0500)]
bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)

Fixes a possible hang when using a timeout on subprocess.run() while
capturing output. If the child process spawned its own children or otherwise
connected its stdout or stderr handles with another process, we could hang
after the timeout was reached and our child was killed when attempting to read
final output from the pipes.

5 years agoOverhaul datetime documentation (GH-13410)
Brad [Wed, 11 Sep 2019 09:19:05 +0000 (05:19 -0400)]
Overhaul datetime documentation (GH-13410)

This is a restructuring of the datetime documentation to hopefully make
them more user-friendly and approachable to new users without losing any
of the detail.

Changes include:
 - Creating dedicated subsections for some concepts such as:
    - "Constants"
    - "Naive vs Aware"
    - "Determining if an Object is Aware"
 - Give 'naive vs aware' its own subsection
 - Give 'constants' their own subsection
 - Overhauling the strftime-strptime section by:
    - Breaking it into logical, linkable, and digestable parts
    - Adding a high-level comparison table
    - Moving the technical detail to bottom: readers come to this
      section primarily to remind themselves to things:
      - How do I write the format code for X?
      - strptime/strftime: which one is which again?
 - Touching up fromisoformat + isoformat sections by:
    - Revising fromisoformat + isoformat for date, time, and
      datetime
    - Adding basic examples
    - Enforcing consistency about putting formats (i.e. ``HH:MM``)
      in double backticks.  This was previously done in some places
      but not all
    - Putting long 'supported formats', on their own line to improve
      readability
 - Moving the 'seealso' section to the top and add a link to dateutil
    Rationale: This doesn't really belong nested under the
    'constants' section.  Let readers know right away that
    datetime is one of several related tools.
 - Moving common features of several types into one place:
    Previously, each type went out of its way to note separately
    that it was hashable and picklable.  These can be brought
    into one single place that is more prominent.
 - Reducing some verbose explanations to improve readability
 - Breaking up long paragraphs into digestable chunks
 - Displaying longer "equivalent to" examples, as short code blocks
 - Using the dot notation for datetime/time classes:
    Use :class:`.time` and :class:`.datetime` rather than :class:`time` and
    :class:`datetime`; otherwise, the generated links will route to the
    respective modules, not classes.
 - Rewording the tzinfo class description
    The top paragraph should get straight to the point of telling the reader
    what subclasses of tzinfo _do_.  Previously, that was hidden in a later
    paragraph.
 - Adding a note on .today() versus .now()
 - Rearranging and expanding example blocks, including:
    - Moved long, multiline inline examples to standalone examples
    - Simplified the example block for timedelta arithmetic:
        - Broke the example into two logical sections:
          1. normalization/parameter 'merging'
          2. timedelta arithmetic
        - Reduced the complexity of the some of the examples.  Show
          reasonable, real-world uses cases that are easy to follow
          along with and progres in difficult slightly.
    - Broke up the example sections for date and datetime sections by putting
      the easy examples first, progressing to more esoteric situations and
      breaking it up into logical sections based on what the methods are
      doing at a high level.
    - Simplified the KabulTz example:
        - Put the class definition itself into a non-REPL block since there is
          no interactive output involved there
        - Briefly explained what's happening before launching into the code
        - Broke the example section into visually separate chunks
 - Various whitespace, formatting, style and grammar fixes including:
    - Consistently using backctics for 'date_string' formats
    - Consistently using one space after periods.
    - Consistently using bold for vocab terms
    - Consistently using italics when referring to params:
      See https://devguide.python.org/documenting/#id4
    - Using '::' to lead into code blocks
        Per https://devguide.python.org/documenting/#source-code, this will
        let the reader use the 'expand/collapse' top-right button for REPL
        blocks to hide or show the prompt.
    - Using consistent captialization schemes
    - Removing use of the default role
    - Put 'example' blocks in Markdown subsections

This is a combination of 66 commits.

See bpo-36960: https://bugs.python.org/issue36960

5 years agobpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
Eddie Elizondo [Wed, 11 Sep 2019 09:17:13 +0000 (05:17 -0400)]
bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)

The instance destructor for a type is responsible for preparing
an instance for deallocation by decrementing the reference counts
of its referents.

If an instance belongs to a heap type, the type object of an instance
has its reference count decremented while for static types, which
are permanently allocated, the type object is unaffected by the
instance destructor.

Previously, the default instance destructor searched the class
hierarchy for an inherited instance destructor and, if present,
would invoke it.

Then, if the instance type is a heap type, it would decrement the
reference count of that heap type.  However, this could result in the
premature destruction of a type because the inherited instance
destructor should have already decremented the reference count
of the type object.

This change avoids the premature destruction of the type object
by suppressing the decrement of its reference count when an
inherited, non-default instance destructor has been invoked.

Finally, an assertion on the Py_SIZE of a type was deleted.  Heap
types have a non zero size, making this into an incorrect assertion.

https://github.com/python/cpython/pull/15323

5 years agobpo-36373: Fix deprecation warnings (GH-15889)
Andrew Svetlov [Wed, 11 Sep 2019 08:20:24 +0000 (11:20 +0300)]
bpo-36373: Fix deprecation warnings (GH-15889)

https://bugs.python.org/issue36373

5 years agobpo-38034: Fix typo in logging.handlers.rst (GH-15708)
wwuck [Wed, 11 Sep 2019 06:44:37 +0000 (16:44 +1000)]
bpo-38034: Fix typo in logging.handlers.rst (GH-15708)

5 years agobpo-28494: Test existing zipfile working behavior. (GH-15853)
Gregory P. Smith [Tue, 10 Sep 2019 16:14:11 +0000 (17:14 +0100)]
bpo-28494: Test existing zipfile working behavior. (GH-15853)

Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.

5 years agoRemove unneeded assignment in PyBytes_Concat() (GH-15274)
Sergey Fedoseev [Tue, 10 Sep 2019 16:11:10 +0000 (21:11 +0500)]
Remove unneeded assignment in PyBytes_Concat() (GH-15274)

The `wb.len = -1` assignment is unneeded since its introduction in 161d695fb0455ce52530d4f43a9eac4c738f64bb as `PyObject_GetBuffer` always fills it in.

5 years agobpo-37574: Mention helper functions for find_spec documentation (GH-14739)
jdkandersson [Tue, 10 Sep 2019 16:06:22 +0000 (02:06 +1000)]
bpo-37574: Mention helper functions for find_spec documentation (GH-14739)

5 years agobpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)
Jordon Xu [Tue, 10 Sep 2019 16:04:08 +0000 (00:04 +0800)]
bpo-37752: Delete redundant Py_CHARMASK in normalizestring() (GH-15095)

5 years agobpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests optional...
Steve Dower [Tue, 10 Sep 2019 15:53:03 +0000 (16:53 +0100)]
bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests optional (GH-15851)

5 years agobpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy(...
Gordon P. Hemsley [Tue, 10 Sep 2019 15:22:01 +0000 (11:22 -0400)]
bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy() (GH-12995)

5 years agobpo-36253: Remove use after free reference in ctypes test suite (GH-12257)
Ben Harper [Tue, 10 Sep 2019 15:20:15 +0000 (11:20 -0400)]
bpo-36253: Remove use after free reference in ctypes test suite (GH-12257)

5 years agobpo-33602: Doc: Remove set and queue references from Data Types (GH-7055)
Andre Delfino [Tue, 10 Sep 2019 15:11:16 +0000 (12:11 -0300)]
bpo-33602: Doc: Remove set and queue references from Data Types (GH-7055)

5 years agoDocs: Small tweaks to c-api/intro#Include_Files (GH-14698)
Kyle Stanley [Tue, 10 Sep 2019 15:09:34 +0000 (11:09 -0400)]
Docs: Small tweaks to c-api/intro#Include_Files (GH-14698)

5 years agoCorrect info about "f.read(size)". (GH13852)
William Andrea [Tue, 10 Sep 2019 14:50:26 +0000 (10:50 -0400)]
Correct info about "f.read(size)". (GH13852)

In text mode, the "size" parameter indicates the number of characters, not bytes.

5 years agoCorrect minor grammatical mistake in open docs (GH-15865)
Andre Delfino [Tue, 10 Sep 2019 14:48:05 +0000 (11:48 -0300)]
Correct minor grammatical mistake in open docs (GH-15865)

5 years agobpo-37504: Fix documentation build with texinfo builder (GH-14606)
Dmitry Shachnev [Tue, 10 Sep 2019 14:40:50 +0000 (17:40 +0300)]
bpo-37504: Fix documentation build with texinfo builder (GH-14606)

In the table model used by docutils, the `cols` attribute of `tgroup`
nodes is mandatory, see [1]. It is used in texinfo builder in [2].

[1]: https://www.oasis-open.org/specs/tm9901.htm#AEN348
[2]: https://github.com/sphinx-doc/sphinx/blob/v2.1.2/sphinx/writers/texinfo.py#L1129

* Doc: Add texinfo support to the Makefile

5 years agobpo-37913: Link to NotImplemented from new docs (GH-15860)
Steve Dower [Tue, 10 Sep 2019 14:25:12 +0000 (15:25 +0100)]
bpo-37913: Link to NotImplemented from new docs (GH-15860)

5 years agobpo-37913: document that __length_hint__ can return NotImplemented (GH-15383)
Jeroen Demeyer [Tue, 10 Sep 2019 14:01:13 +0000 (16:01 +0200)]
bpo-37913: document that __length_hint__ can return NotImplemented (GH-15383)

5 years agobpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)
Jason R. Coombs [Tue, 10 Sep 2019 13:53:31 +0000 (14:53 +0100)]
bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)

https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21

5 years agobpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850)
Steve Dower [Tue, 10 Sep 2019 13:52:48 +0000 (14:52 +0100)]
bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850)

5 years agobpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset instal...
Steve Dower [Tue, 10 Sep 2019 13:52:23 +0000 (14:52 +0100)]
bpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset installed (GH-15849)

5 years agoFix subprocess docstring typo (GH-15812)
Matthias [Tue, 10 Sep 2019 13:51:09 +0000 (15:51 +0200)]
Fix subprocess docstring typo (GH-15812)

5 years agoFix typo in ssl.RAND_bytes documentation (GH-14791)
Zach Thompson [Tue, 10 Sep 2019 13:40:14 +0000 (08:40 -0500)]
Fix typo in ssl.RAND_bytes documentation (GH-14791)

It looks like "cryptographically strong" is the preferred phrase from the surrounding documentation.

Automerge-Triggered-By: @tiran
5 years agobpo-38090: Fix reference leak in ceval.c (GH-15848)
Pablo Galindo [Tue, 10 Sep 2019 13:32:54 +0000 (14:32 +0100)]
bpo-38090: Fix reference leak in ceval.c (GH-15848)

5 years agobpo-36781: Optimize sum() for bools. (#13074)
Serhiy Storchaka [Tue, 10 Sep 2019 13:31:01 +0000 (16:31 +0300)]
bpo-36781: Optimize sum() for bools. (#13074)

* Optimize sum() for bools.

* Fix sum([], False).

* Add a NEWS entry.

5 years ago Note regarding + mode truncation applies to both text and binary mode (#11314)
Andre Delfino [Tue, 10 Sep 2019 13:04:22 +0000 (10:04 -0300)]
 Note regarding + mode truncation applies to both text and binary mode (#11314)

* Improve doc on open's mode +

* Improve wording

* Address comment from Rémi

5 years agobpo-38073: Make pwd module PEP-384 compatible (GH-15790)
Dino Viehland [Tue, 10 Sep 2019 12:59:43 +0000 (13:59 +0100)]
bpo-38073: Make pwd module PEP-384 compatible (GH-15790)

Makes the pwd module PEP-384 compatible

https://bugs.python.org/issue38073

Automerge-Triggered-By: @tiran
5 years agobpo-38066: Hide internal Stream methods (GH-15762)
Andrew Svetlov [Tue, 10 Sep 2019 12:56:14 +0000 (15:56 +0300)]
bpo-38066: Hide internal Stream methods (GH-15762)

feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.

https://bugs.python.org/issue38066

5 years agobpo-21018: added missing documentation about escaping characters for configparser...
Arun Persaud [Tue, 10 Sep 2019 12:51:09 +0000 (05:51 -0700)]
bpo-21018: added missing documentation about escaping characters for configparser (GH-6137)

Document how $ and % can be escaped in configparser.

5 years agocloses bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)
Bernt Røskar Brenna [Tue, 10 Sep 2019 12:43:58 +0000 (14:43 +0200)]
closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)

5 years agobpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] ...
Emmanuel Arias [Tue, 10 Sep 2019 11:46:12 +0000 (08:46 -0300)]
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)

This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

fourth step: queue.py

https://bugs.python.org/issue36373