Commit Graph

1450 Commits

Author SHA1 Message Date
Miss Islington (bot) 51c9cc73cb
bpo-37173: Show passed class in inspect.getfile error (GH-13861)
Currently, inspect.getfile(str) will report nonsense:

```pytb
>>> inspect.getfile(str)
TypeError: <module 'builtins' (built-in)> is a built-in class
```

This fixes that

https://bugs.python.org/issue37173
(cherry picked from commit d407d2a726)

Co-authored-by: Philipp A <flying-sheep@web.de>
2019-06-08 08:27:06 -07:00
Miss Islington (bot) 10b4fd9814
bpo-34886: Fix subprocess.run handling of exclusive arguments (GH-11727)
Fix an unintended ValueError from :func:`subprocess.run` when checking for
conflicting `input` and `stdin` or `capture_output` and `stdout` or `stderr` args
when they were explicitly provided but with `None` values within a passed in
`**kwargs` dict rather than as passed directly by name.
(cherry picked from commit 8cc605acdd)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-06-08 08:24:10 -07:00
Zackery Spytz e36ed475ea [3.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13896)
(cherry picked from commit dc2476500d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-07 17:41:10 +02:00
Miss Islington (bot) 685b806549
bpo-37177: make IDLE's search dialogs transient (GH-13869)
This avoids the search dialogs being hidden behind the editor window.
(cherry picked from commit 554450fb4e)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-06-06 23:37:32 -07:00
Miss Islington (bot) dc20fc4311 bpo-21315: Fix parsing of encoded words with missing leading ws. (GH-13425) (#13846)
* bpo-21315: Fix parsing of encoded words with missing leading ws.

Because of missing leading whitespace, encoded word would get parsed as
unstructured token. This patch fixes that by looking for encoded words when
splitting tokens with whitespace.

Missing trailing whitespace around encoded word now register a defect
instead.

Original patch suggestion by David R. Murray on bpo-21315.
(cherry picked from commit 66c4f3f38b)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-06 10:08:43 -07:00
Miss Islington (bot) 28be388e69
Don't report deleted attributes in __dir__ (GHGH-10148)
When an attribute is deleted from a Mock, a sentinel is added rather
than just deleting the attribute. This commit checks for such sentinels
when returning the child mocks in the __dir__ method as users won't
expect deleted attributes to appear when performing dir(mock).
(cherry picked from commit 0df635c7f8)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2019-06-06 03:39:30 -07:00
Miss Islington (bot) f62a372928
bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598)
* bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding

Parsing an email containing a multipart Content-Type, along with a
Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte
will fail. email.feedparser.FeedParser._parsegen() gets the header and
attempts to convert it to lowercase before comparing it with the accepted
encodings, but as the header contains an invalid byte, it's returned as a
Header object rather than a str.

Cast the Content-Transfer-Encoding header to a str to avoid this.

Found using the AFL fuzzer.

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au>

* Add email and NEWS entry for the bugfix.
(cherry picked from commit aa79707262)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-05 03:23:37 -07:00
Miss Islington (bot) 3d75bd15ac
bpo-35763: Make IDLE calltip note about '/' less obtrusive (GH-13791)
Add it to the end of the first line if there is room.  Tests were reworked.
(cherry picked from commit 949fe976d5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-04 19:15:48 -07:00
Miss Islington (bot) 5f8443eec9 bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816) (GH-13819)
test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
(cherry picked from commit bc6469f79c)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-04 21:07:03 +02:00
Miss Islington (bot) cad4ff65eb
bpo-36868: Fix what's new for SSLContext.hostname_checks_common_name (GH-13248)
What's new now mentions SSLContext.hostname_checks_common_name instead of SSLContext.host_flags.

https://bugs.python.org/issue36868
(cherry picked from commit 47eb223406)

Co-authored-by: Christian Heimes <christian@python.org>
2019-06-03 12:02:11 -07:00
Miss Islington (bot) 3344197040
[3.7] bpo-37081: Test with OpenSSL 1.1.1c (GH-13631) (GH-13782)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 06651ee418)


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


https://bugs.python.org/issue37081
2019-06-03 11:39:57 -07:00
Inada Naoki 8766cb74e1 [3.7] bpo-27987: align PyGC_Head to alignof(long double) (GH-13335) (GH-13581)
This reverts commit 2156fec1f7.

Now that 1b85f4ec45 is in, this change makes sense.
2019-06-02 18:51:31 -07:00
Miss Islington (bot) b4e0bfd477
bpo-35610: IDLE - Replace .context_use_ps1 with .prompt_last_line (GH-11307)
Changes in bpo- 31858 made the less informative 'context_use_ps1' redundant.
(cherry picked from commit 6bdc4dee01)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-02 12:35:53 -07:00
Miss Islington (bot) c76add7afd
Improve version added references in `typing` module docs (GH-13457)
(cherry picked from commit b7daabd711)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-06-01 17:23:40 -07:00
Miss Islington (bot) ac60d1afd2
bpo-32411: IDLE: Remove line number sort in browser.py (GH-5011)
Insertion in line order makes sorting keys by line order unneeded.
(cherry picked from commit 1a4d9ffa1a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-01 15:26:00 -07:00
Miss Islington (bot) f286e0373f
bpo-36813: Fix QueueListener to call task_done() upon termination. (GH-13113)
Fixed QueueListener in order to avoid random deadlocks.
Unable to add regression tests atm due to time constraints, will add it in a bit.
Regarding implementation, although it's nested, it does not cause performance issues whatsoever, and does not call task_done() in case of an exception (which is the right thing to do IMHO).

https://bugs.python.org/issue36813
(cherry picked from commit 6b282e1887)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2019-06-01 02:36:29 -07:00
Miss Islington (bot) a6dc5d4e1c bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
(cherry picked from commit a6ec1ce1ac)

Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
2019-05-31 23:03:22 +03:00
Miss Islington (bot) 49fc57abf5
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)
msilib.Directory.start_component() was passing an extra argument to CAB.gen_id().
(cherry picked from commit c8d5bf6c3f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-31 10:22:14 -07:00
Miss Islington (bot) fc3b8437c8
bpo-25735: math.factorial doc should mention integer return type (GH-6420)
(cherry picked from commit 4612671df2)

Co-authored-by: Akshay Sharma <akshay.sharma09695@gmail.com>
2019-05-31 09:58:27 -07:00
Miss Islington (bot) f1487b3235 bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
(cherry picked from commit a16387ab2d)

Co-authored-by: Ying Wang <me@yingw787.com>
2019-05-30 13:58:30 +08:00
Anthony Sottile 3a98bbf727 [3.7] bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456) (GH-13662)
https://bugs.python.org/issue36983

Fixes issue 36983
2019-05-29 21:05:33 -07:00
Miss Islington (bot) 8ea0fd85bc bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132) (GH-13643)
Co-Authored-By: brianquinlan <brian@sweetapp.com>
(cherry picked from commit 39889864c0)

Co-authored-by: Brian Quinlan <brian@sweetapp.com>
2019-05-28 23:12:30 -04:00
Miss Islington (bot) 0eb69990c8
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
(cherry picked from commit ab0716ed1e)

Co-authored-by: Francisco Facioni <fran6co@gmail.com>
2019-05-28 16:33:21 -07:00
Miss Islington (bot) e7ddf586ae
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
(cherry picked from commit 05f16416d9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-28 06:17:43 -07:00
Miss Islington (bot) 0f352d44e7
bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)
Fix destructor _pyio.BytesIO and _pyio.TextIOWrapper: initialize
their _buffer attribute as soon as possible (in the class body),
because it's used by __del__() which calls close().
(cherry picked from commit a3568417c4)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-05-27 17:05:49 -07:00
Andrew Svetlov a79b6c578f
[3.7] bpo-37035: Don't log OSError (GH-13548) (#13594)
https://bugs.python.org/issue37035.
(cherry picked from commit 1f39c28e48)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-05-27 18:52:05 +03:00
Miss Islington (bot) bfd0b77201
[3.7] bpo-28866: No type cache for types with specialized mro, invalidation is hard. (GH-13157) (GH-13589)
* No type cache for types with specialized mro, invalidation is hard.

* FIX: Don't disable method cache custom types that do not implement mro().

* fixing implem.

* Avoid storing error flags, also decref.

* news entry

* Clear as soon as we're getting an error.

* FIX: Reference leak.
(cherry picked from commit 180dc1b0f4)


Co-authored-by: Julien Palard <julien@palard.fr>


https://bugs.python.org/issue28866
2019-05-26 15:14:23 -07:00
Michael Blahay f3d909428c BPO-27639: Correct return type for UserList slicing operation (#13203)
Added logic to __getitem__ magic method for UserList to ensure that the return
type matches that of self.
2019-05-26 15:28:09 +01:00
Miss Islington (bot) 1b85f4ec45
bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)
(cherry picked from commit f0be4bbb9b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-05-25 10:18:34 -07:00
Gregory P. Smith 2156fec1f7
[3.7] Revert "align PyGC_Head to alignof(long double) (GH-13335)" (GH-13569)
This reverts commit ea2b76bdc5.
See the bug for discussion.

https://bugs.python.org/issue27987
2019-05-25 10:05:01 -07:00
Inada Naoki ea2b76bdc5
bpo-27987: align PyGC_Head to alignof(long double) (GH-13335) 2019-05-25 21:13:33 +09:00
Miss Islington (bot) c70ab1cca0
bpo-37038: Make idlelib.run runnable; add test clause (GH-13560)
(cherry picked from commit 81bb97df61)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-24 22:10:09 -07:00
Victor Stinner cee4ac8135
bpo-35907: Clarify the NEWS entry (GH-13558) 2019-05-24 23:29:10 +02:00
Miss Islington (bot) 310f414bbd
bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
(cherry picked from commit 608876b6b1)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2019-05-24 02:22:38 -07:00
Miss Islington (bot) 7cc47e9c19
bpo-37008: make mock_open handle able to honor next() (GH-13492)
I've reported the issue on https://bugs.python.org/issue37008 and now I'm trying to bring a solution to this minor issue.

I think it could be trivially backported to 3.7 branch.

https://bugs.python.org/issue37008
(cherry picked from commit 394119afc6)

Co-authored-by: Damien Nadé <Anvil@users.noreply.github.com>
2019-05-23 03:21:11 -07:00
Miss Islington (bot) 0416d6f05a bpo-27737: Allow whitespace only headers encoding (GH-13478) (#13517)
(cherry picked from commit ef5bb25e2d)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2019-05-22 21:41:43 -04:00
Miss Islington (bot) b73c21c0be
bpo-33110: Catch errors raised when running add_done_callback on already completed futures (GH-13141)
Wrap the callback call within the `add_done_callback` function within concurrent.futures, in order to behave in an identical manner to callbacks added to a running future are triggered once it has completed.
(cherry picked from commit 2a3a2ece50)

Co-authored-by: Sam Martin <ABitMoreDepth@users.noreply.github.com>
2019-05-22 15:02:24 -07:00
Victor Stinner 34bab21559
bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-13474) (GH-13505)
CVE-2019-9948: Avoid file reading as disallowing the unnecessary URL
scheme in URLopener().open() and URLopener().retrieve()
of urllib.request.

Co-Authored-By: SH <push0ebp@gmail.com>
(cherry picked from commit 0c2b6a3943)
2019-05-22 23:28:28 +02:00
Jelle Zijlstra 81c5ec9e41 [3.7] bpo-33482: fix codecs.StreamRecoder.writelines (GH-6779) (GH-13502)
A very simple fix. I found this while writing typeshed stubs for StreamRecoder.

https://bugs.python.org/issue33482.
(cherry picked from commit b3be407288)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>





https://bugs.python.org/issue33482
2019-05-22 09:28:38 -07:00
Victor Stinner a58db9628d
bpo-36829: Enhance PyErr_WriteUnraisable() (GH-13487)
PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a strong reference to sys.stderr
while using it.

Document that an exception must be set when calling
PyErr_WriteUnraisable(), but don't add an assertion to check it at
runtime.

Cleanup: use longer names for variables and create
write_unraisable_exc_file() subfunction.
2019-05-22 18:23:28 +02:00
Jeroen Demeyer d092caf096 bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381) (GH-13493) 2019-05-22 14:52:13 +02:00
Erik Janssens 791e5fcbab bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421) (GH-13471)
Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant.
Moreover, include windows.h on Windows, not only when MSC is used.

(cherry picked from commit 925af1d99b)
2019-05-22 13:04:06 +02:00
Miss Islington (bot) aea49b1875
[3.7] bpo-36035: fix Path.rglob for broken links (GH-11988) (GH-13469)
Links creating an infinite symlink loop would raise an exception.
(cherry picked from commit d5c120f7eb)


Co-authored-by: Jörg Stucke <joerg.stucke@fkie.fraunhofer.de>


https://bugs.python.org/issue36035
2019-05-21 12:05:08 -07:00
Miss Islington (bot) 3c9c2dc8dd
bpo-34144: Fix of venv acvtivate.bat for win 10 (GH-8321)
The script needs to be updated to support win 10/ 1803 chcp.com command (output has trailing dot)

https://bugs.python.org/issue34144
(cherry picked from commit 6955d44b41)

Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
2019-05-21 08:41:44 -07:00
Geoff Shannon cdb2dbfe92 [3.7] bpo-22865: Expand on documentation for the pty.spawn function (GH-11980) (GH-13455)
(cherry picked from commit 522ccef869)

Co-authored-by: Geoff Shannon <earthlingzephyr@gmail.com>
2019-05-21 11:36:57 +02:00
Miss Islington (bot) 50b3f205d8
bpo-36969: Make PDB args command display keyword only arguments (GH-13452)
(cherry picked from commit bf457c7d82)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-05-20 15:34:23 -07:00
Miss Islington (bot) 3887932e10
bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails (GH-11553)
This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it.

https://bugs.python.org/issue35721
(cherry picked from commit 9932fd91e8)

Co-authored-by: Niklas Fiekas <niklas.fiekas@backscattering.de>
2019-05-20 05:35:56 -07:00
Miss Islington (bot) 2d94d4f1a5
bpo-36958: In IDLE, print exit message (GH-13435)
Print any argument other than None or int passed to SystemExit
or sys.exit().
(cherry picked from commit 6d965b39b7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-20 00:16:53 -07:00
Miss Islington (bot) f393e8eb46 bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)
(cherry picked from commit 7c59362a15)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2019-05-19 19:28:38 +03:00
Miss Islington (bot) 3645d29a1d
bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)
(cherry picked from commit f4e1babf44)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2019-05-19 07:26:35 -07:00