Commit Graph

105946 Commits

Author SHA1 Message Date
Miss Islington (bot) c72b7f703e
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.
(cherry picked from commit d8cf3514dd)

Co-authored-by: roger <rogerduran@gmail.com>
2020-06-15 08:51:35 -07:00
Miss Islington (bot) 811e040b6e
bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (GH-20863) 2020-06-13 16:57:17 -07:00
Miss Islington (bot) f8c05bb3a6
[3.8] bpo-37674: Tweak imp module deprecation note in the docs (GH-20480) (GH-20860)
(cherry picked from commit dea3223740)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Automerge-Triggered-By: @brettcannon
2020-06-13 13:55:56 -07:00
Miss Islington (bot) a8936fa5c0
bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-13 09:15:05 -07:00
Miss Islington (bot) 26db10a431
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
(cherry picked from commit 29c117202e)

Co-authored-by: An Long <aisk@users.noreply.github.com>
2020-06-13 05:44:50 -07:00
Steve Dower 7e57c367d6
bpo-40164: Update Windows OpenSSL to 1.1.1g (GH-20834)
Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2020-06-12 22:14:53 +01:00
Christian Heimes adce133378
bpo-40964: disable remote IMAP tests (GH-20836)
Remote host cyrus.andrew.cmu.edu is blocking incoming connections and is
causing test suite to fail.

Signed-off-by: Christian Heimes <christian@python.org>
2020-06-12 15:08:32 -04:00
Miss Islington (bot) a3d6d23a92
bpo-40626: Support HDF5 in mimetypes (GH-20042)
Add hdf5 with .h5 file extension

See 'Recommendations' section for mime types from the HDF group:  https://www.hdfgroup.org/2018/06/citations-for-hdf-data-and-software/

Patch by Mark Schwab.
(cherry picked from commit 60c2a810e3)

Co-authored-by: MARK SCHWAB <32745414+schwabm@users.noreply.github.com>
2020-06-11 12:32:37 -07:00
Miss Islington (bot) 3e499cda47
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-20816)
unittest.TestCase.assertWarns no longer raises a RuntimeException
when accessing a module's ``__warningregistry__`` causes importation of a new
module, or when a new module is imported in another thread.
(cherry picked from commit 46398fba4d)

Co-authored-by: kernc <kerncece@gmail.com>
2020-06-11 14:31:46 -04:00
Miss Islington (bot) 5b8e3a5335
bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)
The GDB provided by HPE on HP-UX contains a modified version string. Therefore
the tests fail. Adapt the regex to match that string.

Patch by Michael Osipov.

Co-Authored-by: Michael Osipov <michael.osipov@siemens.com>
(cherry picked from commit b2dca49ca3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-11 07:07:39 -07:00
Antoine Pitrou 972aba86ed
[3.8] bpo-40895: Update weakref documentation to remove old warnings (GH-20687) (GH-20792)
The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the `WeakKeyDictionary` and `WeakValueDictionary` are susceptible to the problem of dictionary mutation during iteration.

These notes present the user with a problem that has no easy solution.

I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an `_IterationGuard` context manager to the implementation, which delays mutation while an iteration is in progress.

I asked for confirmation and @pitrou agreed that these notes could be removed:
c1baa601e2GH-commitcomment-39514438.
(cherry picked from commit 1642c0ef75)

Co-authored-by: Daniel Fortunov <asqui@users.noreply.github.com>

Automerge-Triggered-By: @pitrou
2020-06-10 13:38:42 -07:00
Victor Stinner c7a6c7b527
bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779) (GH-20785) (GH-20787)
test_repl.test_close_stdin() now calls
support.suppress_msvcrt_asserts() to fix the test on Windows.

* Move suppress_msvcrt_asserts() from test.libregrtest.setup to
  test.support. Make its verbose parameter optional: verbose=False by
  default.
* SuppressCrashReport now uses SetErrorMode() of the msvcrt module,
  rather than using ctypes.
* Remove also an unused variable (deadline) in wait_process().

(cherry picked from commit f6e58aefde)
(cherry picked from commit 4a4f660cfd)
2020-06-10 19:45:47 +02:00
Miss Islington (bot) 663836e117
[3.8] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20771)
Follow-up to GH-8014
(cherry picked from commit 7aed0524d4)


Co-authored-by: Éric Araujo <merwok@netwok.org>

Automerge-Triggered-By: @merwok
2020-06-09 18:26:16 -07:00
Stefan Krah 0f5a28f834
[3.8] Revert bpo-39576: Prevent memory error for overly optimistic precisions (GH-20747)
This reverts commit b6271025c6.
2020-06-09 01:57:11 +02:00
Stefan Krah 32c1fb07e6
[3.8] Revert bpo-39576: docs: set context for decimal arbitrary precision arithmetic (GH-20745)
This reverts commit d6965ff026.
2020-06-09 01:33:08 +02:00
Stefan Krah 706de4e5a4
[3.8] Revert bpo-39576: Clarify the word size for the 32-bit build. (GH-20743)
This reverts commit c6ecd9c140.
2020-06-09 01:20:58 +02:00
Miss Islington (bot) 14073c5090
bpo-24914: mention Python supports multiple paradigms in the FAQ (GH-20658) (GH-20738)
(cherry picked from commit 3ab3475c42)

Co-authored-by: Brett Cannon <brett@python.org>

Co-authored-by: Brett Cannon <brett@python.org>
2020-06-08 11:53:25 -07:00
Miss Islington (bot) 30513b6277
bpo-40861: Enable optimizations when building liblzma (GH-20724)
(cherry picked from commit 3a3a30c5a4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-06-08 10:07:27 -07:00
Miss Islington (bot) 12dfbae2ec
bpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)
Also added an example in shutil in order to make more clear how they are to be used.

Initially reported by Weinan Li on bpo.
(cherry picked from commit 7633371dac)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-07 22:08:51 -07:00
Miss Islington (bot) 264e4fd961
bpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)
(cherry picked from commit 37eed5a9ee)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-07 19:43:35 -07:00
Miss Islington (bot) 83a9ba4426
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
(cherry picked from commit 68874a8502)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-06-06 10:04:47 -07:00
Shantanu f7ed4d4e83
bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20466)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94ff1)
2020-06-06 11:08:48 +01:00
Miss Islington (bot) c067183605
bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486)
* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 052d3fc090)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-06-06 01:24:45 -07:00
Terry Jan Reedy a5d6aba318
[3.8] bpo-40807: Backport test_codeop change [GH-19670]
A tiny sliver of a 3.9 PEG parser patch needed to backport the test added by #20486.
2020-06-04 22:42:44 -04:00
Miss Islington (bot) c935b33322
Fix spacing in docs for tarfile (GH-20629)
Before
```
content.txt is 42 bytes in size and isa regular file.
folder is 420 bytes in size and isa directory.
magic is 4200 bytes in size and issomething else.
```

After:
```
content.txt is 42 bytes in size and is a regular file.
folder is 420 bytes in size and is a directory.
magic is 4200 bytes in size and is something else.
```

Automerge-Triggered-By: @orsenthil
(cherry picked from commit 7a280197f4)

Co-authored-by: Harsha Laxman <HarshaLaxman@users.noreply.github.com>
2020-06-04 13:19:47 -07:00
Victor Stinner 6f7346bb39
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 18:28:18 +02:00
Miss Islington (bot) 5b8787ef19
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.pyGH-L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.
(cherry picked from commit c822efeda9)

Co-authored-by: Jeremy Attali <jeremy.attali@gmail.com>
2020-06-03 06:02:33 -07:00
Miss Islington (bot) 139f1bafcf
Ensure correct version of Sphinx is used for Windows builds (GH-20582)
(cherry picked from commit fe5dd78182)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-06-01 14:25:32 -07:00
Miss Islington (bot) d0dc369a90
bpo-40831: Remove an incorrect statement in the Windows docs (GH-20570)
(cherry picked from commit c8966667bb)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-06-01 08:53:33 -07:00
Miss Islington (bot) 9c0ff178a5
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-01 00:17:16 -07:00
Miss Islington (bot) ba1c2c85b3
bpo-40798: Generate a different message for already removed elements (GH-20483)
(cherry picked from commit 735d902b36)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-30 00:54:58 -07:00
Miss Islington (bot) ef2f9acf8f
closes bpo-29017: Update the bindings for Qt information with PySide2 (GH-20149)
Reference to PySide has been removed has it is for Qt 4, which has reached end of life.
(cherry picked from commit 4649202ea7)

Co-authored-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-05-29 19:04:24 -07:00
Miss Islington (bot) 3dcccd1186
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.
(cherry picked from commit 97e4e0f53d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-29 16:13:00 -07:00
Miss Islington (bot) 00a240bf7f
bpo-40784: Fix sqlite3 deterministic test (GH-20448)
(cherry picked from commit c610d970f5)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-29 05:46:34 -07:00
Andrew Kuchling b86636bff4
[3.8] bpo-25872: Fix KeyError in linecache when multithreaded (GH-18007) (GH-20092)
Backporting to 3.8 and adding a NEWS item (I should have added one to the master branch -- oh well).
2020-05-29 04:59:44 -07:00
Miss Islington (bot) 6381ee077d
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.
(cherry picked from commit 21017ed904)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2020-05-29 04:43:27 -07:00
Miss Islington (bot) f89d7bcdee
Note the output ordering of combinatoric functions (GH-19732) (GH-20502) 2020-05-28 13:33:57 -07:00
Miss Islington (bot) c0c5db54cf
Improve IO tutorial's "Old string formatting" section (GH-16251)
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit eaca2aa117)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2020-05-27 18:41:31 -07:00
Miss Islington (bot) 45ce0dbc4f
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-27 15:56:36 -07:00
Miss Islington (bot) b5ecbf02e4
bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)
require `_generate_next_value_` to be defined before members
2020-05-27 13:12:08 -07:00
Miss Islington (bot) a285af7e62
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:53:03 -07:00
Miss Islington (bot) 75635c6095
bpo-39073: validate Address parts to disallow CRLF (GH-19007)
Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
(cherry picked from commit 614f17211c)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-05-27 06:37:40 -07:00
Miss Islington (bot) 5594c07d97
Clean up compatibility code in importlib fixtures (GH-19156) (#19543)
(cherry picked from commit 574547a75c)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-05-27 09:05:03 -04:00
Miss Islington (bot) 7c82528d40
Fix the link to ncurses patch download in macos installer build script (GH-20421)
Reason: the link `ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2` is dead, which prevents `Mac/BuildScript/build-installer.py` from completing. Looks like the host of the FTP server was changed to `ftp.invisible-island.net`, thus this proposal.

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
(cherry picked from commit 7da46b676a)

Co-authored-by: Oleg Höfling <hoefling@users.noreply.github.com>
2020-05-27 03:28:45 -07:00
Miss Islington (bot) 285ff63351
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
(cherry picked from commit db098bc1f0)

Co-authored-by: idomic <michael.ido@gmail.com>
2020-05-26 08:13:59 -07:00
Tal Einat e3e800f3d2
[3.8] bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
(cherry picked from commit 372ee27d49)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-05-26 15:59:32 +03:00
Zackery Spytz 5ff5edfef6
[3.8] bpo-35714: Reject null characters in struct format strings (GH-16928) (GH-20419)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)
2020-05-26 11:57:09 +03:00
Miss Islington (bot) c2a177adf3
bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20415)
* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"
(cherry picked from commit af7553ac95)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 09:33:42 +01:00
Miss Islington (bot) 5c1d745da5
bpo-39830: Add zipfile.Path to __all__ (GH-19115) (GH-19116)
(cherry picked from commit 9a81ab107a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 02:44:57 -04:00
Miss Islington (bot) b38bd8888a
bpo-40745: Fix typos in NewType docs (GH-20379)
(cherry picked from commit 2b0e654f91)

Co-authored-by: ziheng <zihenglv@gmail.com>
2020-05-25 21:52:55 -07:00