Commit Graph

98759 Commits

Author SHA1 Message Date
Miss Islington (bot) 3f7d0b69f2
controlflow: Use full example for "5 through 9" (GH-5907)
Replace example result of "5 through 9" with complete list: "5, 6, 7, 8, 9".
This format is more consistent with the surrounding examples.
(cherry picked from commit 83d7062d2d)

Co-authored-by: Steven M. Vascellaro <S.Vascellaro@gmail.com>
2018-03-09 12:11:30 -08:00
Nathan Henrie 12f74d8608 bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
2018-03-09 12:43:45 -05:00
Steve Dower 32efcd1306
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032) 2018-03-08 14:50:30 -08:00
Miss Islington (bot) 2f3ba27185 [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) (GH-5954)
(cherry picked from commit 9ba3aa4d02)

Co-authored-by: Erik Bray <erik.m.bray@gmail.com>
2018-03-08 10:28:53 -05:00
Miss Islington (bot) 15425cf245
Fix some ipaddress documentation errors (GH-6021)
* fix a typo: documention -> documentation
* fix the type of IPv?Network.hostmask
* add documentation about IPv?Network.netmask
* fix IPv6Network constructor doc that extended netmasks are not supported
(cherry picked from commit e405096ea9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-07 20:41:27 -08:00
Miss Islington (bot) 7592c0a686
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
(cherry picked from commit bc3f2289b9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-06 21:46:10 -08:00
Miss Islington (bot) 387a055261
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bd)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-03-06 10:48:04 -08:00
Steve Dower baa4507946
[3.6] bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) (GH-5990) 2018-03-05 14:26:28 -08:00
Miss Islington (bot) 6935a51167
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-03-05 11:23:08 -08:00
Miss Islington (bot) 73a43960c7
bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701)
(cherry picked from commit 74382a3f17)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-04 03:42:41 -08:00
Benjamin Peterson c951675406
[3.6] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 0e6c8ee235)
2018-03-03 22:59:12 -08:00
Miss Islington (bot) bd92cfe632
Fix missing coroutine declaration in the asyncio documentation. (GH-5964)
(cherry picked from commit 13cfd57dcf)

Co-authored-by: Joongi Kim <me@daybreaker.info>
2018-03-03 13:23:31 -08:00
Serhiy Storchaka fbdd075c64
[3.6] bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930). (GH-5958)
(cherry picked from commit b21d155f57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-03 14:19:29 +02:00
Miss Islington (bot) 10fb1bf776 bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5946)
(cherry picked from commit 3e197c7a67)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-01 18:28:20 +08:00
Miss Islington (bot) 32f5392f64
bpo-32940: IDLE: Simplify StringTranslatePseudoMapping in pyparse (GH-5862)
The new code also runs faster.
(cherry picked from commit f0daa880a4)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-28 15:12:15 -08:00
Miss Islington (bot) 8c65360dd0
bpo-30928: Update idlelib/NEWS.txt, possibly for 3.7.0b2 (GH-5932)
(cherry picked from commit 0954c9e9c8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-27 16:31:25 -08:00
Serhiy Storchaka 5bf74859fe
[3.6] bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832). (GH-5906)
(cherry picked from commit 6f600ff173)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-27 03:39:53 +02:00
Miss Islington (bot) 3f6c172b70
bpo-32713: Fix tarfile.itn for large/negative float values. (GH-5434)
(cherry picked from commit 72d9b2be36)

Co-authored-by: Joffrey F <f.joffrey@gmail.com>
2018-02-26 17:11:01 -08:00
Miss Islington (bot) ec5569b08e
bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints (GH-4745)
(cherry picked from commit eee72d4778)

Co-authored-by: Tobotimus <Tobotimus@users.noreply.github.com>
2018-02-26 15:59:55 -08:00
Miss Islington (bot) e650fd362e Fix _socket module compilation on Cygwin. (GH-4137) (GH-4145)
(cherry picked from commit 63ae04461f)
2018-02-26 22:24:18 +02:00
Barry Warsaw 86ea851346
Revert "[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5504)" (#5911)
This reverts commit a71397fb66.
2018-02-26 11:23:24 -08:00
animalize 1278c21f52 [3.6] bpo-32394: Remove some TCP options on older version Windows. (GH-5585) 2018-02-26 10:13:51 -08:00
Miss Islington (bot) fbf7aac36b
bpo-18533: Avoid RecursionError from repr() of recursive dictview (GH-4823)
dictview_repr(): Use a Py_ReprEnter() / Py_ReprLeave() pair to check
for recursion, and produce "..." if so.

test_recursive_repr(): Check for the string rather than a
RecursionError.  (Test cannot be any tighter as contents are
implementation-dependent.)

test_deeply_nested_repr(): Add new test, replacing the original
test_recursive_repr().  It checks that a RecursionError is raised in
the case of a non-recursive but deeply nested structure.  (Very
similar to what test_repr_deep() in test/test_dict.py does for a
normal dict.)

OrderedDictTests: Add new test case, to test behavior on OrderedDict
instances containing their own values() or items().
(cherry picked from commit d7773d92bd)
2018-02-26 06:42:00 -08:00
Miss Islington (bot) 5a07608d08
bpo-31454: Include information about "import X as Y" in Modules tutorial (GH-4041)
(cherry picked from commit fbee88244e)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2018-02-25 11:33:14 -08:00
Miss Islington (bot) b9678d3aa1
bpo-25059: Clarify the print separator usage in tutorial (GH-5879)
By default `print` adds spaces between its arguments.
(cherry picked from commit 84c4b0cc67)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-25 11:21:15 -08:00
Miss Islington (bot) 8f2bcab923
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
(cherry picked from commit 5fb632e831)

Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
2018-02-25 07:56:56 -08:00
Christian Heimes a79591cfb8
[3.6] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5881)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 29eab55309)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 14:29:00 +01:00
Miss Islington (bot) 192bff4e2d [3.6] bpo-32647: Link ctypes extension with libdl. (GH-5550) (#5875)
The ctypes module used to depend on indirect linking for dlopen. The shared
extension is now explicitly linked against libdl on platforms with dl.

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

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 13:07:36 +01:00
Christian Heimes 48707a1baf
[3.6] bpo-30622: Improve NPN support detection (GH-5859) (#5861)
The ssl module now detects missing NPN support in LibreSSL.

Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org>
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 6cdb7954b0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:20:47 +01:00
Christian Heimes e9370a4738
bpo-32185: Don't send IP in SNI TLS extension (#5865)
The SSL module no longer sends IP addresses in SNI TLS extension on
platforms with OpenSSL 1.0.2+ or inet_pton.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 09:47:02 +01:00
Miss Islington (bot) fc9471a888
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
The 'optimization' is for space in the executable file, not for run time.
(cherry picked from commit 186b606d8a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-24 19:46:16 -08:00
Christian Heimes aab2258403
bpo-31518: Change TLS protocol for Debian (#3660)
Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change
TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to
make them pass on Debian.

Signed-off-by: Christian Heimes <christian@python.org>
2018-02-25 00:45:24 +01:00
Miss Islington (bot) 980790eee0
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
(cherry picked from commit 42c35d9c0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-24 09:43:05 -08:00
Miss Islington (bot) cd2112f0b9
bpo-32916: IDLE: Change `str` to `code` in pyparse (GH-5830)
Adjust tests and user modules to match.
(cherry picked from commit c29c03a34a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-23 19:16:00 -08:00
Miss Islington (bot) cffe0467ab
bpo-32923: Unittest doc: replace `whilst` with `while` (GH-5833)
`whilst` and `while` are both english words, `whilst` is not as commonly used.
This can be confusing to readers whose primary language is not english.
(cherry picked from commit 98f42aac23)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
2018-02-23 10:22:27 -08:00
Anselm Kruis 9c819a6a7d [3.6] bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066) (GH-5826)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup..
(cherry picked from commit 33dddac00b)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
2018-02-23 08:27:54 -08:00
Miss Islington (bot) dd52d5c868
bpo-32087: Doc: Make "deprecated-removed" directive translatable (GH-4473)
(cherry picked from commit 0febc05373)

Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
2018-02-23 04:14:04 -08:00
Steve Dower 1d3c518c5e
bpo-32457: Improves handling of denormalized executable path when launching Python (GH-5756) (#5818) 2018-02-22 12:33:16 -08:00
Miss Islington (bot) 6eab93cfe5 bpo-30449: Improve __slots__ documentation (GH-1819)
(cherry picked from commit 2b44e302ec)


Co-authored-by: Aaron Hall, MBA <aaronchall@yahoo.com>
2018-02-22 09:37:40 -08:00
Miss Islington (bot) d8e7b98b17
bpo-32905: IDLE - remove unused code in pyparse module (GH-5807)
dump is similar to print but less flexible.  lastopenbracketpos is now always initialized in _study2, as was stmt_bracketing, so the class settings are not needed.  get_last_open_bracket_pos is never called.
(cherry picked from commit 451d1edaf4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-21 23:04:05 -08:00
Miss Islington (bot) 52064c3d8a
bpo-32874: IDLE: add tests for pyparse (GH-5755)
There are no code changes other than comments and docstrings.
(cherry picked from commit c84cf6c03f)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-21 20:34:43 -08:00
Miss Islington (bot) 1e8bc25594
bpo-32889: update valgrind suppressions (GH-5779)
Py_ADDRESS_IN_RANGE was renamed address_in_range in 3.6
(commit 3924f93794).
(cherry picked from commit ba518804bf)

Co-authored-by: Paul Price <price@astro.princeton.edu>
2018-02-20 22:31:54 -08:00
Miss Islington (bot) f8a794c04c
bpo-32008: don't use PROTOCOL_TLSv1 in example (GH-5789)
It's bad form to pin to an old version of TLS. ssl.SSLContext has the right
protocol default, so let's not pass anyway.
(cherry picked from commit e9edee0b65)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-02-20 22:07:17 -08:00
Miss Islington (bot) 0150dc5894 bpo-28886: doc: Move deprecated abc decorators to separate section (GH-176)
(cherry picked from commit 52c6b89796)

Co-authored-by: Harshul jain <harshulrobo@gmail.com>
2018-02-21 14:24:37 +09:00
Miss Islington (bot) 16de2a9b86 closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
os.dup2() tests for dup3() system call availability at runtime,
but doesn't remember the result across calls, repeating
the test on each call with inheritable=False.

Since the caller of os.dup2() is expected to hold the GIL,
fix this by making the variable holding the test result static.
(cherry picked from commit b3caf388a0)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-20 21:21:12 -08:00
Miss Islington (bot) 76c3f5eeb0 bpo-32540: Update venv documentation (GH-5736)
If the directory already exists, it will be re-used.
(cherry picked from commit e8eb972514)


Co-authored-by: TROUVERIE Joachim <joachim.trouverie@linoame.fr>
2018-02-20 20:26:21 -08:00
Miss Islington (bot) 2b9726eb64
bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-20 14:17:30 -08:00
Miss Islington (bot) 6ae87cae09
bpo-32500: Correct the documentation for PySequence_Size() and PySequence_Length() (GH-5767)
Dropped the part that says: "For objects that do not provide sequence protocol".
(cherry picked from commit 7a1e1786f9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-20 11:46:06 -08:00
Miss Islington (bot) 8e149ff481 bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5766)
(cherry picked from commit 6240917b77)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-19 18:18:43 -08:00
Miss Islington (bot) ef0bb5c7b7
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
(cherry picked from commit 5537646bfa)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2018-02-19 12:49:46 -08:00