Commit Graph

105969 Commits

Author SHA1 Message Date
Miss Islington (bot) 1813d318fd
bpo-41094: Fix decoding errors with audit when open files. (GH-21095)
(cherry picked from commit 6c6810d989)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-24 09:45:38 -07:00
Miss Islington (bot) fb4a624105
bpo-41038: Fix non-ASCII string corruption in Win32 resource files (GH-20985)
In absence of explicit declaration, resource compiler uses system
codepage. When this codepage is DBCS or UTF-8, Python's copyright
string is corrupted, because it contains copyright sign encoded
as \xA9.

The fix is to explicitly declare codepage 1252.
(cherry picked from commit 33b79b11b8)

Co-authored-by: Nikita Nemkin <nikita@nemkin.ru>
2020-06-24 09:42:55 -07:00
Miss Islington (bot) adf8708c44
bpo-41005: Fixed perrmission error (GH-20936) (GH-21052)
* fixed issue 41005: webbrowser fails when xdg-settings cannot be executed

Co-authored-by: KrishnaSai2020 <krishnasai.chivukula@gmal.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9e27bc0c1e)

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>
2020-06-24 14:58:27 +02:00
Miss Islington (bot) 0029099dec
Fix typo in dataclasses module (GH-21109) (#21111)
Automerge-Triggered-By: @matrixise
(cherry picked from commit 80526f6841)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2020-06-24 07:14:10 -04:00
Miss Islington (bot) 4f5dde463b
bpo-40707: Document that Popen.communicate sets the returncode attribute (GH-20283)
(cherry picked from commit bf2e515fa4)

Co-authored-by: Gareth Rees <gdr@garethrees.org>
2020-06-23 20:19:35 -07:00
Anthony Sottile 60cbdc81d1
[3.8] bpo-31938: Fix default-value signatures of several functions in the select module (GH-21066) (GH-21098)
(cherry picked from commit d051801052)

Automerge-Triggered-By: @vstinner
2020-06-23 15:17:02 -07:00
Ammar Askar 6eab52ffad
bpo-39699: Remove accidentally committed test change (GH-21089) 2020-06-23 19:28:25 +01:00
Miss Islington (bot) c6e24e7420
bpo-41085: Fix array.array.index() on 64-bit Windows (GH-21071)
Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
for index larger than ``2**31``.
(cherry picked from commit 1d3dad5f96)

Co-authored-by: WildCard65 <WildCard65@users.noreply.github.com>
2020-06-23 06:40:47 -07:00
Miss Islington (bot) 56d25add07
Improve asyncio.loop.call_soon() documentation (GH-20883)
* Add a glossary entry for the term "callback"
* Link to it in loop.call_soon() and in the "Concurrency and Multithreading" section

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

Co-authored-by: Roger Iyengar <ri@rogeriyengar.com>
2020-06-22 19:23:49 -07:00
Miss Islington (bot) d7f37d1ed4
bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)
(cherry picked from commit 36ff513f82)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:40:05 -07:00
Miss Islington (bot) b99824a8e1
bpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().
(cherry picked from commit cafe1b6e9d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:21:04 -07:00
Miss Islington (bot) d5ee9b9940
bpo-41056: Fix reference to deallocated stack in pathconfig (Coverity) (GH-21013)
Reported by Coverity.  (CID 1457554 RETURN_LOCAL)

path0 is assigned as a pointer to this right before it goes out of scope.
(cherry picked from commit 81328f3070)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-06-22 00:43:41 -07:00
Miss Islington (bot) 14195597b3
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)
(cherry picked from commit 19fcffa927)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-21 12:36:23 -07:00
Miss Islington (bot) 10bf6e4823
bpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl module. (GH-21009)
Detected by Coverity.
(cherry picked from commit eb0d5c38de)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-06-21 12:11:29 -07:00
Miss Islington (bot) a4c09560ea
Add link to .pypirc specification (GH-20680) (#21019)
Related to https://github.com/pypa/twine/issues/638 and https://github.com/pypa/packaging.python.org/issues/730, I wrote a spec based on the one that was removed in https://github.com/python/cpython/pull/13087. However, a Google search for "pypirc" turned up at least one [blog post](https://truveris.github.io/articles/configuring-pypirc/) that links to https://docs.python.org/3/distutils/packageindex.htmlGH-the-pypirc-file, which now just links to this document. So, I thought a link to the spec would be handy.

Automerge-Triggered-By: @jaraco
(cherry picked from commit af157fad28)

Co-authored-by: Brian Rutledge <brian@bhrutledge.com>

Co-authored-by: Brian Rutledge <brian@bhrutledge.com>
2020-06-20 17:12:27 -04:00
Miss Islington (bot) 80651ab9e3
bpo-41040: Fix test_modulefinder. (GH-20991)
(cherry picked from commit a041e116db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-19 14:25:25 -07:00
Miss Islington (bot) ec9bc2da42
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.
(cherry picked from commit 3358da4054)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-19 09:19:38 -07:00
Miss Islington (bot) 4dd10ed694
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
(cherry picked from commit 66a65ba43c)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2020-06-19 05:15:57 -07:00
Victor Stinner e8056180a1
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) (GH-20962) (GH-20966)
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.

(cherry picked from commit ddbeb2f3e0)
(cherry picked from commit b1e7361134)
2020-06-18 18:56:43 +02:00
Victor Stinner 3d974b2fc6
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935) (GH-20945) (GH-20946)
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.

(cherry picked from commit 8362893e3f)
(cherry picked from commit b39d41ba1b)
2020-06-17 19:09:49 +02:00
Miss Islington (bot) 071bed842e
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.
(cherry picked from commit fc710ee266)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-16 08:47:16 -07:00
Ned Deily e63cc2f646
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491) (GH-20900)
Co-authored-by: Xavier Fernandez <xav.fernandez@gmail.com>
2020-06-15 17:42:22 -04:00
Miss Islington (bot) a1d3be4623
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.
(cherry picked from commit 4a3a682b12)

Co-authored-by: Krzysztof Konopko <kkonopko@users.noreply.github.com>
2020-06-15 10:45:21 -07:00
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