Commit Graph

105216 Commits

Author SHA1 Message Date
Miss Islington (bot) 80db4b4be5
bpo-16438: Doc: confusing text regarding numeric precedence corrected (GH-10521)
(cherry picked from commit 4576b5431b)

Co-authored-by: Anjali <anjali30malik@gmail.com>
2019-09-11 03:39:36 -07:00
Zachary Ware df935b5f0b
[3.8] bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823) (GH-15900)
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.

(cherry picked from commit 455122a009)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-11 11:31:12 +01:00
Miss Islington (bot) 872c85a179
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.
(cherry picked from commit 580d2782f7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-11 03:05:14 -07:00
Miss Islington (bot) f357cd022e bpo-38034: Fix typo in logging.handlers.rst (GH-15708) (GH-15893)
(cherry picked from commit efd5741ae9)

Co-authored-by: wwuck <301402+wwuck@users.noreply.github.com>
2019-09-11 07:56:10 +01:00
Miss Islington (bot) 74b0291b03
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.
(cherry picked from commit 3f4db4a0ba)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-10 15:57:54 -07:00
Miss Islington (bot) 98224d24d1
Remove unneeded assignment in PyBytes_Concat() (GH-15274)
The `wb.len = -1` assignment is unneeded since its introduction in 161d695fb0 as `PyObject_GetBuffer` always fills it in.
(cherry picked from commit afdeb189e9)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2019-09-10 10:46:52 -07:00
Miss Islington (bot) 63909cdc2f
bpo-37574: Mention helper functions for find_spec documentation (GH-14739)
(cherry picked from commit 9cbb97b29e)

Co-authored-by: jdkandersson <51036209+jdkandersson@users.noreply.github.com>
2019-09-10 10:13:55 -07:00
Miss Islington (bot) 78c3949407
Docs: Small tweaks to c-api/introGH-Include_Files (GH-14698)
(cherry picked from commit b6dafe5139)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-09-10 09:38:07 -07:00
Miss Islington (bot) 30a8fd7e73
Correct minor grammatical mistake in open docs (GH-15865)
(cherry picked from commit 05184515f9)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2019-09-10 09:24:06 -07:00
Miss Islington (bot) cdce233f61 bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests optional (GH-15851)
(cherry picked from commit 801f925998)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-10 17:20:16 +01:00
Miss Islington (bot) 6c588a00ed
Correct info about "f.read(size)". (GH13852)
In text mode, the "size" parameter indicates the number of characters, not bytes.
(cherry picked from commit faff81c05f)

Co-authored-by: William Andrea <william.j.andrea@gmail.com>
2019-09-10 09:00:09 -07:00
Victor Stinner d42a4fdc63
bpo-37531: Enhance regrtest multiprocess timeout (GH-15345) (GH-15871)
* Write a message when killing a worker process
* Put a timeout on the second popen.communicate() call
  (after killing the process)
* Put a timeout on popen.wait() call
* Catch popen.kill() and popen.wait() exceptions

(cherry picked from commit de2d9eed8b)
2019-09-10 17:54:51 +02:00
Miss Islington (bot) 58ef7d341c bpo-33602: Doc: Remove set and queue references from Data Types (GH-7055) (GH-15875)
(cherry picked from commit 912108891d)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2019-09-10 17:42:56 +02:00
Miss Islington (bot) 8072230882 Note regarding + mode truncation applies to both text and binary mode (GH-11314) (GH-15869)
* Improve doc on open's mode +

* Improve wording

* Address comment from Rémi
(cherry picked from commit c1d8c1cb8e)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2019-09-10 16:04:56 +01:00
Jason R. Coombs 97c2f68a4c
[3.8] bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840) (#15861)
https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21.
(cherry picked from commit 17499d8270)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-10 15:58:29 +01:00
Miss Islington (bot) 313f80192a 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.htmGH-AEN348
[2]: https://github.com/sphinx-doc/sphinx/blob/v2.1.2/sphinx/writers/texinfo.pyGH-L1129

* Doc: Add texinfo support to the Makefile
(cherry picked from commit c3d679fd39)

Co-authored-by: Dmitry Shachnev <mitya57@users.noreply.github.com>
2019-09-10 15:51:43 +01:00
Miss Islington (bot) 41c965f930
Fix subprocess docstring typo (GH-15812)
(cherry picked from commit 182e1d1f84)

Co-authored-by: Matthias <xmatthias@outlook.com>
2019-09-10 07:51:29 -07:00
Miss Islington (bot) 2ed0ac6bf1 bpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset installed (GH-15849)
(cherry picked from commit cd8221152d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-10 15:42:26 +01:00
Miss Islington (bot) 21dacea6ad Fix calling order of PyEval_InitThreads. (GH-15836)
As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called
before Py_Initialize() function.
(cherry picked from commit 9e61066355)

Co-authored-by: Kenta Murata <mrkn@users.noreply.github.com>
2019-09-10 15:37:56 +01:00
Steve Dower ed99bb9ca6
bpo-37913: document that __length_hint__ can return NotImplemented (GH-15383) 2019-09-10 15:31:26 +01:00
Miss Islington (bot) 45bc3928e2 bpo-38090: Fix reference leak in ceval.c (GH-15848)
(cherry picked from commit a511c7a496)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-09-10 15:31:07 +01:00
Steve Dower 206e4c3d35
bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850) 2019-09-10 15:29:28 +01:00
Miss Islington (bot) f12ff05bc0
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
(cherry picked from commit 12c122ae95)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-10 06:44:32 -07:00
Miss Islington (bot) 5cf8155bbd bpo-21018: added missing documentation about escaping characters for configparser (GH-6137) (GH-15846)
Document how $ and % can be escaped in configparser.
(cherry picked from commit 9a94093189)

Co-authored-by: Arun Persaud <arun@nubati.net>
2019-09-10 15:32:56 +02:00
Miss Islington (bot) c43f26eca3
closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)
(cherry picked from commit 734f1202a5)

Co-authored-by: Bernt Røskar Brenna <bernt.brenna@gmail.com>
2019-09-10 06:21:57 -07:00
Miss Islington (bot) c3008dd480
bpo-37251: Removes __code__ check from _is_async_obj. (GH-15830)
(cherry picked from commit f1a297acb6)

Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
2019-09-10 06:16:00 -07:00
Miss Islington (bot) eaa1b09412
docs: Add references to AsyncMock in unittest.mock.patch (GH-13681)
Update the docs as patch can now return an AsyncMock if the patched
object is an async function.
(cherry picked from commit f5e7f39d29)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-09-10 06:15:19 -07:00
Miss Islington (bot) eb1bc48c74 bpo-37619: update_one_slot() should not ignore wrapper descriptors for wrong type (GH-15838)
(cherry picked from commit 57ea335606)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
2019-09-10 05:55:12 -07:00
Miss Islington (bot) 55daf1a561
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
(cherry picked from commit 9008be303a)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
2019-09-10 05:50:14 -07:00
Miss Islington (bot) bb8fc8bd30
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [locks] (GH-13920)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Third step: locks.py

https://bugs.python.org/issue36373
(cherry picked from commit 537877d85d)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
2019-09-10 04:26:54 -07:00
Miss Islington (bot) ab74e52f76
bpo-37052: Add examples for mocking async iterators and context managers (GH-14660)
Add examples for mocking asynchronous iterators and asynchronous context managers.

https://bugs.python.org/issue37052
(cherry picked from commit c8dfa7333d)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-10 04:08:52 -07:00
Miss Islington (bot) 7d41e400d6
Remove macOS tests from Travis. (GH-15809)
Azure runs macOS, so we don't need Travis to do it.
(cherry picked from commit e45b217ae0)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-10 03:54:48 -07:00
Miss Islington (bot) 18fa272601
Fix typo in dict object comment (GH-15814)
(cherry picked from commit 359143c686)

Co-authored-by: dalgarno <32097481+dalgarno@users.noreply.github.com>
2019-09-10 03:13:36 -07:00
Victor Stinner ccaea52588 Revert "bpo-33418: Add tp_clear for function object (GH-8058)" (GH-15826)
This reverts commit 3c452404ae.
2019-09-10 02:57:31 -07:00
Steve Dower fdd17abc51
bpo-35941: Fix performance regression in SSL certificate code (GH-12610)
Accumulate certificates in a set instead of doing a costly list contain
operation. A Windows cert store can easily contain over hundred
certificates. The old code would result in way over 5,000 comparison
operations

Signed-off-by: Christian Heimes <christian@python.org>
2019-09-10 02:02:04 -07:00
Miss Islington (bot) 74b7413d3a
bpo-37662: Documented venv.EnvBuilder.upgrade_dependencies(). (GH-15768)
(cherry picked from commit 264e034f99)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2019-09-10 00:31:56 -07:00
Miss Islington (bot) d4391aa5eb
bpo-37383: Updates docs to reflect AsyncMock call_count after await. (GH-15761)
* bpo-351428: Updates documentation to reflect AsyncMock call_count after await.

* Adds skip and fixes warning.

* Removes extra >>>.

* Adds ... in front of await mock().
(cherry picked from commit b9f65f01fd)

Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
2019-09-10 00:31:34 -07:00
Miss Islington (bot) 29bde48ade
bpo-38077: IDLE no longer adds 'argv' to the user namespace (GH-15818)
This only happened when initializing the subprocess to run a module.
This recent bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
(cherry picked from commit c59295a1ca)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-09 20:29:01 -07:00
Zachary Ware 99df5e8373
[3.8] bpo-34293: Fix PDF documentation paper size (GH-8585) (GH-15816)
The "A4" pdfs were previously the wrong size due to a change in the options in Sphinx 1.5.

See also sphinx-doc/sphinxGH-5235
(cherry picked from commit b5381f6697)

Authored-by: Jean-François B <jfbu@free.fr>
2019-09-09 23:11:23 +01:00
Miss Islington (bot) c1c04cbc24
bpo-36502: Update link to UAX GH-44, the Unicode doc on the UCD. (GH-15301)
The link we have points to the version from Unicode 6.0.0, dated 2010.
There have been numerous updates to it since then:
  https://www.unicode.org/reports/tr44/GH-Modifications

Change the link to one that points to the current version. Also, use HTTPS.
(cherry picked from commit 64c6ac74e2)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-09 11:41:13 -07:00
Miss Islington (bot) e832963145
bpo-37649: Fix exec_prefix check (GH-14897)
(cherry picked from commit 09090d04ef)

Co-authored-by: Orivej Desh <orivej@gmx.fr>
2019-09-09 10:59:18 -07:00
Miss Islington (bot) 421ef39968
Fix punctuation in `os.execvpe` docstring. (GH-15051)
(cherry picked from commit fb6807b043)

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2019-09-09 10:44:46 -07:00
Miss Islington (bot) eadf6b8787
bpo-35803: Document and test dir=PathLike for tempfile (GH-11644)
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
(cherry picked from commit 370138ba9c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-09-09 10:31:31 -07:00
Miss Islington (bot) 0468a85cc4
Clarify that shutil's copy functions can accept path-like values (GH-15141)
(cherry picked from commit 9488a5289d)

Co-authored-by: Boris Verhovsky <boris.verk@gmail.com>
2019-09-09 10:18:51 -07:00
Miss Islington (bot) 5731172bb1
bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure
that the object is not freed. If it's freed, the program fails with
an assertion error and Python dumps informations about the freed
object.
(cherry picked from commit d91d4de317)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-09 10:18:09 -07:00
Steve Dower 2d5594fac2
bpo-20490: Improve circular import error message (GH-15308) 2019-09-09 09:45:18 -07:00
Miss Islington (bot) 78d15faf6c
bpo-38006: Avoid closure in weakref.WeakValueDictionary (GH-15641)
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
(cherry picked from commit a2af05a0d3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-09 09:24:16 -07:00
Miss Islington (bot) b6ef8f2beb
bpo-37876: Tests for ROT-13 codec (GH-15314)
The Rot-13 codec is for educational use but does not have unit tests,
dragging down test coverage. This adds a few very simple tests.
(cherry picked from commit b3b48c81f0)

Co-authored-by: Zeth <theology@gmail.com>
2019-09-09 09:12:01 -07:00
Miss Islington (bot) 0d4396c04c
bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)
Constants added by the site module like exit() "should not be used in programs"
(cherry picked from commit e3c59a7527)

Co-authored-by: Alan Yee <alanyee@users.noreply.github.com>
2019-09-09 08:20:36 -07:00
Miss Islington (bot) 3bd4bed78a bpo-34596: Fallback to a default reason when @unittest.skip is uncalled (GH-9082) (#15781)
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled

* Change default reason to empty string

* Fix rst formatting of NEWS entry
(cherry picked from commit d5fd75c53f)

Co-authored-by: Naitree Zhu <Naitreey@gmail.com>
2019-09-09 17:01:14 +02:00