Commit Graph

105106 Commits

Author SHA1 Message Date
Miss Islington (bot) 590ed09a5b
bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)
(cherry picked from commit b761e3aed1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-13 07:25:51 -07:00
Miss Islington (bot) bd2e7cc3af
closes bpo-36002: Use AC_PATH_TOOL to find llvm-profdata and llvm-ar. (GH-14998)
(cherry picked from commit 0519d497b0)

Co-authored-by: Doyle Rowland <doyle.rowland@reliaqual.com>
2019-09-13 06:57:45 -07:00
Miss Islington (bot) c27bcc3b47
bpo-26468: Doc: improve the documentation of shutil.copy2 when it can fail. (GH-13765)
(cherry picked from commit 9585f46b97)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2019-09-13 06:43:34 -07:00
Andrew Svetlov 6638c92260
[3.8] bpo-38148: Add slots to asyncio transports (GH-16077) (GH-16093)
* bpo-38148: Add slots to asyncio transports

* Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 9eb35ab0d7)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-13 16:14:55 +03:00
Miss Islington (bot) 4556b1d35c
bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095)
(cherry picked from commit 375a3e2bdb)

Co-authored-by: Julien Palard <julien@palard.fr>
2019-09-13 06:14:42 -07:00
Miss Islington (bot) 60d5e2c5a5
Doc: Improve consistency of os.path.normcase with other os.path functions (GH-14004)
(cherry picked from commit 53f78ec9e1)

Co-authored-by: Kexuan Sun <me@kianasun.com>
2019-09-13 06:07:48 -07:00
Miss Islington (bot) 44cb89a78a
bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)
Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called.

Co-authored-by: Demian Brecht <demianbrecht@gmail.com>

https://bugs.python.org/issue12144

Automerge-Triggered-By: @asvetlov
(cherry picked from commit bb41147eab)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-13 04:47:51 -07:00
Miss Islington (bot) b9bfe143d1
bpo-36889: Document Stream class and add docstrings (GH-14488)
* This just copies the docs from `StreamWriter` and `StreamReader`.
* Add docstring for asyncio functions.

https://bugs.python.org/issue36889

Automerge-Triggered-By: @asvetlov
(cherry picked from commit d31b31516c)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-13 04:23:43 -07:00
Miss Islington (bot) 52c99aeb9f
Fix the ImportWarning regarding __spec__ and __package__ being None (GH-16003)
(cherry picked from commit 6e1a30b15e)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-13 03:53:22 -07:00
Miss Islington (bot) 8750dfe09e
bpo-37785: Fix xgettext warning in argparse (GH-15161)
(cherry picked from commit 42671aea2d)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-09-13 02:45:27 -07:00
Miss Islington (bot) 664d56a52e
bpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store (GH-16025)
(cherry picked from commit ed93a8852d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-12 10:36:14 -07:00
Miss Islington (bot) 4145f62759
Emphasize the need to always call PySequence_Fast. (GH-11140)
(cherry picked from commit 57b7dbc46e)

Co-authored-by: Matti Picus <matti.picus@gmail.com>
2019-09-12 09:26:17 -07:00
Miss Islington (bot) 21bfff9a5a
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
The "--" should not be included with long options passed to
getopt.getopt.

Fixes https://bugs.python.org/issue37803
(cherry picked from commit 855df7f273)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-09-12 09:05:52 -07:00
Miss Islington (bot) 6dc3e61c51
bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit b1a2abdb06)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-09-12 08:43:14 -07:00
Jason R. Coombs a0d4aac50b
[3.8] bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993) (GH-16064)
* bpo-38121: Sync importlib.metadata with 0.22 backport

* 📜🤖 Added by blurb_it..
(cherry picked from commit 8ed6503eca)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-12 16:41:31 +01:00
Miss Islington (bot) d04c85f5a7 bpo-38096: Complete the "structseq" and "named tuple" cleanup (GH-16010) (GH-16062)
(cherry picked from commit 4210ad5ebd)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-09-12 08:20:31 -07:00
Miss Islington (bot) 98a4a713d0 bpo-37935: Added tests for os.walk(), glob.iglob() and Path.glob() (GH-15956) (GH-16043)
Test that they do not keep too many file descriptors open for the host OS in a reasonable test scenario.

See [bpo-37935](https://bugs.python.org/issue37935).
(cherry picked from commit f9dc2ad890)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-12 16:07:47 +01:00
Stéphane Wirtel 36c29e444d [3.8] bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051) (GH-16057)
The defines are required for OpenSSL 1.0.2 and LibreSSL.

https://bugs.python.org/issue38134

Automerge-Triggered-By: @tiran
(cherry picked from commit 9a4963b932)

Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38137



Automerge-Triggered-By: @matrixise
2019-09-12 07:57:03 -07:00
Miss Islington (bot) 307c5fe942
bpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)
https://bugs.python.org/issue37488

Automerge-Triggered-By: @pganssle
(cherry picked from commit 1a53c785e6)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2019-09-12 07:55:48 -07:00
Miss Islington (bot) 824407f76e
bpo-21872: fix lzma library decompresses data incompletely (GH-14048)
* 1. add test case with wrong behavior
* 2. fix bug when max_length == -1
* 3. allow b"" as valid input data for decompress_buf()
* 4. when max_length >= 0, let needs_input mechanism works
* add more asserts to test case
(cherry picked from commit 4ffd05d7ec)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-09-12 07:41:11 -07:00
Miss Islington (bot) 8976359c59
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/GH-id4
    - Using '::' to lead into code blocks
        Per https://devguide.python.org/documenting/GH-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
(cherry picked from commit 3fb1363fe8)

Co-authored-by: Brad <brad.solomon.1124@gmail.com>
2019-09-12 07:37:36 -07:00
Miss Islington (bot) 717cc61ed1
bpo-36991: Fix incorrect exception escaping ZipFile.extract() (GH-13632)
(cherry picked from commit 2f1b857562)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2019-09-12 07:33:53 -07:00
Miss Islington (bot) 0d7cb5bb29
bpo-38132: Check EVP_DigestUpdate for error (GH-16041)
(cherry picked from commit 8c74574e0a)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-12 06:50:46 -07:00
Miss Islington (bot) 2f01cf6187
bpo-37363: Document internal audit events (GH-14663)
Three internal cpython events were not documented, yet.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue37363
(cherry picked from commit ed4b3216e5)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-12 06:20:26 -07:00
Miss Islington (bot) 67b90a079c bpo-38132: Simplify _hashopenssl code (GH-16023) (#16040)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 5a4f82f457)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-12 14:03:50 +01:00
Miss Islington (bot) 345bfc990f
bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)
(cherry picked from commit a488879cba)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-12 05:59:50 -07:00
Miss Islington (bot) 535863e3f5
bpo-26868: Fix example usage of PyModule_AddObject. (GH-15725)
* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
(cherry picked from commit 224b8aaa7e)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-09-12 05:26:46 -07:00
Miss Islington (bot) 14afe203d6
bpo-35325: Doc: imp.find_module() return value documentation discrepancy (GH-11040)
(cherry picked from commit 967b84c913)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2019-09-12 05:25:54 -07:00
Miss Islington (bot) 80e33655a2
bpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 64117e059b)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-12 05:18:38 -07:00
Miss Islington (bot) 648494b44a
bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
(cherry picked from commit 31a82e25b6)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
2019-09-12 04:37:05 -07:00
Miss Islington (bot) 94a684734f
bpo-36675: Remove obsolete code. (GH-16024)
Does no longer work since Sphinx moved the trim_doctest_flag option in
the configuration.
(cherry picked from commit 2c910c1e73)

Co-authored-by: Julien Palard <julien@palard.fr>
2019-09-12 04:31:17 -07:00
Stéphane Wirtel 1fc84b64f9
[3.8] bpo-32008: Prefer client or TLSv1_2 in examples (GH-5797) (GH-16027)
Prefer client or TLSv1_2 in examples

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 894d0f7d55)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-12 12:25:02 +01:00
Miss Islington (bot) 84eb42e3c9
bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
Use fdwalk() on platforms that support it to implement os.closerange().
(cherry picked from commit e20134f889)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-09-12 04:19:21 -07:00
Miss Islington (bot) db0d8a5b2c bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable (GH-15565) (GH-15965)
* 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__
(cherry picked from commit 72c359912d)

Co-authored-by: blhsing <github@ydooby.com>
2019-09-12 12:52:49 +02:00
Miss Islington (bot) f60fd95dcc closes bpo-37405: Make socket.getsockname() always return a tuple for AF_CAN. (GH-14392) (GH-16018)
This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
(cherry picked from commit 954900a3f9)

Co-authored-by: bggardner <brent@ebrent.net>
2019-09-12 11:34:28 +01:00
Miss Islington (bot) 52baf90a74
bpo-38008: Move builtin protocol whitelist to mapping instead of list (GH-15647)
Fixes https://bugs.python.org/issue38008
(cherry picked from commit 692a0dc915)

Co-authored-by: Divij Rajkumar <drajkuma1@gmail.com>
2019-09-12 03:32:36 -07:00
Miss Islington (bot) 1e17c4d414
bpo-13927: time.ctime and time.asctime return string explantion (GH-11303)
* bpo-13927: time.ctime and time.asctime return string explantion

* Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date

* Reformat linebreaks
(cherry picked from commit 2d32bf1ef2)

Co-authored-by: Harmandeep Singh <harmandeep.singh1@delhivery.com>
2019-09-12 03:31:43 -07:00
Miss Islington (bot) 79cbaf50ac
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
An exception may occur during a PyObject_IsSubclass() call.
(cherry picked from commit ea683deccc)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-12 03:28:05 -07:00
Petr Viktorin 3562ae2540
[3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323, GH-16004) (GH-15966)
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.
(cherry picked from commit ff023ed36e)
Fixup: https://github.com/python/cpython/pull/16004.
(cherry picked from commit 5e9caeec76)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
2019-09-12 10:44:46 +01:00
Miss Islington (bot) eb19c45298 Doc: Update pickle.rst (GH-14128) (GH-16014)
* Edits for readability and grammar
(cherry picked from commit 362f5350eb)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2019-09-12 09:19:12 +01:00
Paul Ganssle 2bb6bf0c8c bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) (GH-15961) 2019-09-11 19:50:29 -07:00
Miss Islington (bot) a5a7102636
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.
(cherry picked from commit 39de95b746)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-11 17:04:27 -07:00
Miss Islington (bot) 8af4e0c994 Correct typo in min version test (GH-16001)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit de606ea169)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-11 11:19:12 -07:00
Miss Islington (bot) f79a022d76
bpo-36270: Doc: add link to traceback object reference (GH-13119)
(cherry picked from commit 9936371af2)

Co-authored-by: Björn Meier <bjoern@opentrash.org>
2019-09-11 11:12:35 -07:00
Miss Islington (bot) d6ac67f48f bpo-34001: Fix test_ssl with LibreSSL (GH-13783) (#15997)
(cherry picked from commit c9bc49c5f6)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-11 19:59:13 +02:00
Miss Islington (bot) c0acc0e53e Improve clarity of try-return-finally-return (GH-15677) (GH-15981)
Clarify execution in try-return-finally-return case.
(cherry picked from commit 0cc27417f2)

Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
2019-09-11 19:42:21 +02:00
Stéphane Wirtel 965e53a9de
[3.8] bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15999)
https://bugs.python.org/issue37698
(cherry picked from commit 15f5a7527b)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-09-11 19:36:00 +02:00
Miss Islington (bot) d47993664e
Doc: recursive glob ** follows symlinks to directories (GH-12918)
(cherry picked from commit e24594bfe7)

Co-authored-by: Marc <Marc.Herbert+github@gmail.com>
2019-09-11 10:32:26 -07:00
Miss Islington (bot) 4cab7eb9e1 bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)
https://bugs.python.org/issue37750

Automerge-Triggered-By: @matrixise
(cherry picked from commit 5a56ce4a0e)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-09-11 19:09:57 +02:00
Miss Islington (bot) 0b7f3706e6
bpo-38117: Test with OpenSSL 1.1.1d (GH-15983)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 58ab13479d)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-11 10:09:28 -07:00