Commit Graph

104919 Commits

Author SHA1 Message Date
Miss Islington (bot) 5b398520a8 Update logging cookbook to show multiple worker processes using the concurrent.futures module. (GH-14905) (GH-14906)
(cherry picked from commit d309352c6f)
2019-07-22 13:25:46 +01:00
Miss Islington (bot) 22fd679dc3 bpo-21478: Record calls to parent when autospecced objects are used as child with attach_mock (GH 14688) (GH-14902)
* Clear name and parent of mock in autospecced objects used with attach_mock

* Add NEWS entry

* Fix reversed order of comparison

* Test child and standalone function calls

* Use a helper function extracting mock to avoid code duplication and refactor tests.
(cherry picked from commit 7397cda997)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-07-22 08:59:00 +01:00
Kyle Stanley 24b5b360fa [3.8] Fix typos in docs, comments and test assert messages (GH-14872). (#14900)
(cherry picked from commit 96e12d5f4f)

Co-authored-by: Min ho Kim <minho42@gmail.com>
2019-07-21 22:48:45 -04:00
Miss Islington (bot) 0104841d12 Add examples to elucidate the formulas (GH-14898) (GH-14899)
(cherry picked from commit b530a4460b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-07-21 16:39:08 -07:00
Miss Islington (bot) 52ee929957
bpo-37627: Add acknowledgment (GH-14883)
(cherry picked from commit 4214f1ec3b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-21 13:38:09 -07:00
Miss Islington (bot) 9325f4091b
bpo-37627: Initialize IDLE Custom Run dialog with previous entries (GH-14870)
Repeat the command line arguments most recently entered before so the user can edit them.
(cherry picked from commit 35b87e6001)

Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
2019-07-21 13:25:43 -07:00
Miss Islington (bot) a8cac5762c
Fix typo found by Min ho Kim (GH-14879)
(cherry picked from commit 8e3a7380ec)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-21 12:44:28 -07:00
Miss Islington (bot) e8b3a2e78a Minor whitespace, indentation, and quoting changes to improve internal consistency and appease linters (GH-14888) (GH-14889)
(cherry picked from commit 1c0e9bb94b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-07-21 12:38:58 -07:00
Miss Islington (bot) 8f501647ca
Bpo-37644: update suspicious.csv for distutils/examples (GH-14885)
(cherry picked from commit 22f0483d44)

Co-authored-by: Ned Deily <nad@python.org>
2019-07-21 11:08:57 -07:00
Miss Islington (bot) c613c3319e bpo-36324: Make internal attributes for statistics.NormalDist() private. (GH-14871) (GH-14875) 2019-07-21 00:55:13 -07:00
Miss Islington (bot) 3015191b29
Adjust builtins.zip() docstring to better communicate its signature (GH-14833)
(cherry picked from commit af2f5b1723)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2019-07-19 11:29:58 -07:00
Miss Islington (bot) e5bfd1ce9d bpo-36546: Clean-up comments (GH-14857) (#14859)
(cherry picked from commit eed5e9a956)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-07-19 02:17:53 -07:00
Miss Islington (bot) a50a6225a0 bpo-37624: Document weight assumptions for random.choices() (GH-14855) (GH-14858)
(cherry picked from commit 8dbe563aa6)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-07-19 02:17:21 -07:00
Miss Islington (bot) 840352455d
bpo-37610: improve Using Python doc wrt Editors & IDE (GH-14850)
Move the Editors and IDE section out of the Unix section, to its own section.

https://bugs.python.org/issue37610
(cherry picked from commit 8f040b7a9f)

Co-authored-by: aldwinaldwin <aldwinaldwin@users.noreply.github.com>
2019-07-18 18:31:41 -07:00
Miss Islington (bot) 86eb5daaf3 bpo-33610: IDLE's code-context always shows current context immediately (GH-14821) (#14846)
Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8fb5c)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-18 16:47:26 -04:00
Miss Islington (bot) 652b667b13
bpo-37552: Skip failing tests in strptime/strftime with UCRT version 17763.615 (GH-14460)
A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
(cherry picked from commit 9cd39b16e2)

Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
2019-07-18 07:17:58 -07:00
Miss Islington (bot) 028f1d2479 bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) (GH-14829)
Add two indent spec methods from editor and Rstrip to existing file.
Tests are not added for indent methods because they need change
in lights of 3.x's prohibition on mixing tabs and spaces.
(cherry picked from commit 1b38922434)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-17 21:21:08 -04:00
Miss Islington (bot) 635743355d
Fix IndexError when parsing unexpectedly ending quoted-string. (GH-14813)
This exception was caused because the input ended unexpectedly with only one
single quote instead of a pair with some value inside it.
(cherry picked from commit 719a062bcb)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-07-17 10:29:18 -07:00
Miss Islington (bot) 6816ca30af
bpo-37461: Fix infinite loop in parsing of specially crafted email headers (GH-14794)
* bpo-37461: Fix infinite loop in parsing of specially crafted email headers.

Some crafted email header would cause the get_parameter method to run in an
infinite loop causing a DoS attack surface when parsing those headers. This
patch fixes that by making sure the DQUOTE character is handled to prevent
going into an infinite loop.
(cherry picked from commit a4a994bd3e)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-07-17 10:13:54 -07:00
Miss Islington (bot) 1fc43a3faf bpo-36390: IDLE: Combine region formatting methods. (GH-12481) (GH-14811)
Rename paragraph.py to format.py and add region formatting methods
from editor.py.  Add tests for the latter.
(cherry picked from commit 82494aa6d9)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-07-17 10:45:20 -04:00
Miss Islington (bot) 6cf7c45cb5
bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)
* Only create CodeContext instances for "real" editors windows, but
  not e.g. shell or output windows.
* Remove configuration update Tk event fired every second, by having
  the editor window ask its code context widget to update when
  necessary, i.e. upon font or highlighting updates.
* When code context isn't being shown, avoid having a Tk event fired
  every 100ms to check whether the code context needs to be updated.
* Use the editor window's getlineno() method where applicable.
* Update font of the code context widget before the main text widget
(cherry picked from commit 7036e1de3a)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-17 01:44:55 -07:00
Miss Islington (bot) 35d36dacd4
Docs: Correct formatting of a multiline code block (GH-13806)
(cherry picked from commit bd26a4466b)

Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
2019-07-17 01:32:53 -07:00
Miss Islington (bot) 178f09f8b7 bpo-27452: IDLE: Cleanup config.py code (GH-14577) (GH-14802)
(cherry picked from commit f8d4cc7dbb)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-07-16 17:19:10 -04:00
Miss Islington (bot) 6a2aec0ff5
Fix infinite loop in email folding logic (GH-12732)
As far as I can tell, this infinite loop would be triggered if:

1. The value being folded contains a single word (no spaces) longer than
   max_line_length
2. The max_line_length is shorter than the encoding's name + 9
   characters.

bpo-36564: https://bugs.python.org/issue36564
(cherry picked from commit f69d5c6198)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
2019-07-16 11:08:36 -07:00
Miss Islington (bot) 86742d4ce8
Replace backquote with command substitution in subprocess doc example (GH-13941)
Replace backquotes with POSIXy command substitution in example.
(cherry picked from commit 6a61714cde)

Co-authored-by: David Jones <drj@pobox.com>
2019-07-16 08:05:39 -07:00
Miss Islington (bot) 1ff4c42774
bpo-37284: Add note to sys.implementation doc (GH-14328)
Add a brief note to indicate that any new required attributes must go through the PEP process.

https://bugs.python.org/issue37284
(cherry picked from commit 52693c10e8)

Co-authored-by: Giovanni Cappellotto <gcappellotto@fb.com>
2019-07-15 07:45:12 -07:00
Miss Islington (bot) cf9a63c6c7
bpo-37593: Swap the positions of posonlyargs and args in the constructor of ast.parameters nodes (GH-14778)
https://bugs.python.org/issue37593
(cherry picked from commit cd6e83b481)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-07-14 16:49:52 -07:00
Miss Islington (bot) 3958b7aae8
Clarify that plistlib's load and dump functions take a binary file object (GH-9825)
The documentation says that the fp parameter to plistlib.load "should be a
readable and binary file object" but the docstring only mentions that it
should be readable. Similarly, plistlib.dump's docstring only mentions
"writable". This commit clarifies that fp should also be binary.

https://docs.python.org/3/library/plistlib.htmlGH-plistlib.load
https://docs.python.org/3/library/plistlib.htmlGH-plistlib.dump
(cherry picked from commit 0d4f4352ef)

Co-authored-by: Collin Styles <collingstyles@gmail.com>
2019-07-14 02:25:43 -07:00
Miss Islington (bot) 7a430109b9 bpo-37590: Remove redundant docs of PyEval_EvalFrameEx (GH-14765)
(cherry picked from commit 40d2226a69)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2019-07-14 10:53:18 +02:00
Miss Islington (bot) 4f733f48b4
bpo-37571: Remove extra space in ctypes docs (GH14764)
(cherry picked from commit 68c74d05c1)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-07-14 01:22:57 -07:00
Miss Islington (bot) e7c114df38
bpo-37571: Add 'b' to prevent the TypeError exception. (GH-14721)
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 6b929580eb)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
2019-07-14 01:07:06 -07:00
Miss Islington (bot) 262779fb50
bpo-36261: Improve example of the preamble field in email docs (GH-14751)
(cherry picked from commit 8efade91b1)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
2019-07-14 00:53:15 -07:00
Miss Islington (bot) b1e4d1b603 bpo-26967: fix flag grouping with allow_abbrev=False (GH-14316) (GH-14759)
The `allow_abbrev` option for ArgumentParser is documented and intended to disable support for unique prefixes of --options, which may sometimes be ambiguous due to deferred parsing.

However, the initial implementation also broke parsing of grouped short flags, such as `-ab` meaning `-a -b` (or `-a=b`).  Checking the argument for a leading `--` before rejecting it fixes this.

This was prompted by pytest-dev/pytestGH-5469, so a backport to at least 3.8 would be great 😄
And this is my first PR to CPython, so please let me know if I've missed anything!

https://bugs.python.org/issue26967
(cherry picked from commit dffca9e925)

Co-authored-by: Zac Hatfield-Dodds <Zac-HD@users.noreply.github.com>
2019-07-14 07:59:56 +02:00
Miss Islington (bot) b815669c83
bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir (GH-1163)
Hi,

I've faced an issue w/ `mailbox.Maildir()`. The case is following:
1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty
2. I pass that folder path as an argument when instantiating `mailbox.Maildir()`
3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir

**Expected result:** subdirs are created during `Maildir()` instance creation.

**Actual result:** subdirs are assumed as existing which leads to exceptions during use.

**Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed.

**Fix:** This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.

https://bugs.python.org/issue30088
(cherry picked from commit e44184749c)

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
2019-07-13 07:59:48 -07:00
Miss Islington (bot) 143672cf02
bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726)
Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation.

This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation.

bpo-37579
(cherry picked from commit e6b46aafad)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-07-13 06:59:37 -07:00
Miss Islington (bot) 5da83b417e
bpo-37580: Fix typo in http.cookiejar documentation (GH-14731)
[bpo-37580](https://bugs.python.org/issue37580): Markup typo in http.cookiejar doc

https://bugs.python.org/issue37580
(cherry picked from commit b5bbb8a740)

Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.de>
2019-07-13 03:24:48 -07:00
Miss Islington (bot) 12f3312aa2 Enable publish of Windows releases through Azure Pipelines (GH-14720)
(cherry picked from commit 994a3b88dc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-07-13 12:10:33 +02:00
Miss Islington (bot) 25d371ab74
Fix typo in re.escape documentation (GH-14722)
(cherry picked from commit fb6c1f8d3b)

Co-authored-by: Robert DiPietro <rdipietro@gmail.com>
2019-07-13 01:42:25 -07:00
Miss Islington (bot) 36101c2c5d
closes bpo-37347: Fix refcount problem in sqlite3. (GH-14268)
(cherry picked from commit b9a0376b0d)

Co-authored-by: gescheit <gescheit@yandex-team.ru>
2019-07-12 20:33:53 -07:00
Miss Islington (bot) bfb709b771
[3.8] bpo-37521: No longer treat insertion into sys.modules as optional in importlib examples (GH-14723) (GH-14724)
Fix importlib examples to insert any newly created modules via importlib.util.module_from_spec() immediately into sys.modules instead of after calling loader.exec_module().

Thanks to Benjamin Mintz for finding the bug.


https://bugs.python.org/issue37521
(cherry picked from commit 0827064c95)


Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com>


https://bugs.python.org/issue37521
2019-07-12 15:51:48 -07:00
Miss Islington (bot) 3d58b78481
bpo-37558: Shared memory tests are failing due to double slashes (GH-14703)
With the addition of shared memory into Python 3.8, we now have three tests failing on Solaris, namely `test_multiprocessing_fork`, `test_multiprocessing_forkserver` and `test_multiprocessing_spawn`. The reason seems to be incorrect name handling which results in two slashes being prepended.

https://bugs.python.org/issue37558
(cherry picked from commit 4737265622)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-07-11 11:38:37 -07:00
Miss Islington (bot) 107171500d
closes bpo-37554: Remove `q:q` in os.rst documentation (GH-14692)
https://bugs.python.org/issue37554
(cherry picked from commit 7cbef72902)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
2019-07-11 10:45:36 -07:00
Miss Islington (bot) 242ad1f375 bpo-36390: simplify classifyws(), rename it and add unit tests (GH-14500)
(cherry picked from commit 9b5ce62cac)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-11 17:55:05 +03:00
Miss Islington (bot) dc0b6af42e
bpo-34369: make kqueue.control() docs better reflect that timeout is positional-only (GH-9499)
(cherry picked from commit 79042ac434)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-11 07:16:03 -07:00
Miss Islington (bot) aca8297763
Document default parameter of .seek() in the signature. (GH-14691)
(cherry picked from commit 2a3d4d9c53)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-07-10 19:49:49 -07:00
Miss Islington (bot) b82188d9ba bpo-26806: IDLE should run without docstrings (GH-14657) (GH-14677)
After fcf1d00, IDLE startup failed with python compiled without docstrings.
(cherry picked from commit 6aeb2fe606)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-09 14:59:19 -04:00
Miss Islington (bot) 68bd9c5691 bpo-18374: fix tests to check the correct thing about line numbers (GH-14659) (GH-14672)
(cherry picked from commit 430a9f44fe)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2019-07-09 14:28:56 +01:00
Miss Islington (bot) 4c403b8ca2
bpo-37322: ssl test_pha_required_nocert() ignores expected SSLError (GH-14670)
test_ssl.test_pha_required_nocert() now uses
support.catch_threading_exception() to ignore the expected SSLError
in ConnectionHandler of ThreadedEchoServer (it is only raised
sometimes on Windows).
(cherry picked from commit 73ea54620a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-09 05:55:08 -07:00
Miss Islington (bot) bbad695e78
bpo-37120: Fix _ssl get_num_tickets() (GH-14668)
Replace PyLong_FromLong() with PyLong_FromSize_t():
SSL_CTX_get_num_tickets() return type is size_t.

https://bugs.python.org/issue37120
(cherry picked from commit 76611c7c0a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-09 05:42:49 -07:00
Miss Islington (bot) 58f2c7f424 bpo-37526: Add support.catch_threading_exception() (GH-14664) (GH-14666)
Context manager catching threading.Thread exception using
threading.excepthook.
(cherry picked from commit 91b4f7ab7f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-09 13:35:59 +02:00