Commit Graph

20045 Commits

Author SHA1 Message Date
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) 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
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
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) 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
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
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) 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) 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) 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) 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) 2a93fae8b5
Improve error message for "setup.py upload" without dist files (GH-21060)
(cherry picked from commit 08a6926b25)

Co-authored-by: Éric Araujo <merwok@netwok.org>
2018-02-18 20:14:27 -08:00
Miss Islington (bot) 5c81ed4941
bpo-31972: Improve docstrings for pathlib classes (GH-5310)
(cherry picked from commit dfa015cf77)

Co-authored-by: chason <chason@gmail.com>
2018-02-18 16:37:00 -08:00
Miss Islington (bot) dda938683c
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
(cherry picked from commit 9f4223261f)

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2018-02-16 23:14:41 -08:00
Miss Islington (bot) a23eecab9a bpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665) (GH-5683)
(cherry picked from commit 5746510b7a)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2018-02-14 12:10:18 +02:00
INADA Naoki 4731634241
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
(cherry picked from commit d019bc8319)
2018-02-13 22:15:24 +09:00
Serhiy Storchaka c3f9d7e0ea
[3.6] bpo-32370: Use the correct encoding for ipconfig output in the uuid module. (GH-5608). (#5654)
(cherry picked from commit da6c3da6c3)


Co-authored-by: Segev Finer <segev208@gmail.com>
2018-02-13 11:15:21 +02:00
Miss Islington (bot) 9fad857444
bpo-32837: IDLE - require encoding argument for textview.view_file. (GH-5646)
Using the system and place-dependent default encoding for open()
is a bad idea for IDLE's system and location-independent files.
(cherry picked from commit 688722cedd)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-12 15:40:12 -08:00
Miss Islington (bot) 46daf39453
bpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_about. (GH-5639)
GUI test test_file_buttons() only looks at initial ascii-only lines,
but failed on systems where open() defaults to 'ascii' because
readline() internally reads and decodes far enough ahead to encounter
a non-ascii character in CREDITS.txt.
(cherry picked from commit f34e03ec0e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-12 12:53:50 -08:00
Miss Islington (bot) a1d33f7425 bpo-29248: Fix os.readlink() on Windows (GH-5577)
The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.

(cherry picked from commit 3c34aad4e7)

Co-authored-by: SSE4 <tomskside@gmail.com>
2018-02-12 21:14:08 +03:00
Miss Islington (bot) 9d8c24b791 bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609) GH-5612)
The new link is given in a red box on the old page.
(cherry picked from commit 8d1f2f4038)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-02-10 19:42:22 -05:00
Serhiy Storchaka 504f19145c
[3.6] bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5603)
Co-authored-by: Jake Davis <jcdavis@awedge.net>.
(cherry picked from commit 2411292ba8)
2018-02-10 00:01:40 +02:00
Miss Islington (bot) b90c68586e bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (GH-5563)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process.  This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.

This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions).  `ioctl` is not a POSIX async-signal-safe approved function.

ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-05 22:51:10 -08:00
Miss Islington (bot) a8c25d1c7f [3.6] bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-5542)
When `__getattr__` is implemented, attribute lookup will always fall back to that,
even if the initial failure comes from `__getattribute__` or a descriptor's `__get__`
method (including property methods).
(cherry picked from commit d1f318105b)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-05 13:10:00 +10:00
Miss Islington (bot) 1c2b138671 bpo-32765: Update configdialog General tab create page docstring (GH-5529) (GH-5538)
Add new entries to the widget list.
(cherry picked from commit 845d86485e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-04 19:05:23 -05:00
Barry Warsaw a71397fb66
[3.6] bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5504)
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.

https://bugs.python.org/issue32303
https://bugs.python.org/issue32305.
(cherry picked from commit bbbcf8693b)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-02-02 23:21:14 -05:00
Bar Harel 7e4cf8e95d [3.6] bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (#5502)
(cherry picked from commit d41e9e0952)
2018-02-02 18:15:31 -05:00
Terry Jan Reedy fbf8e823c0
[3.6] bpo-32614: Modify re examples to use a raw string to prevent wa… …rning (GH-5265) (GH-5500)
Modify RE examples in documentation to use raw strings to prevent DeprecationWarning.
Add text to REGEX HOWTO to highlight the deprecation.  Approved by Serhiy Storchaka.

(cherry picked from commit 66771422d0)
2018-02-02 17:37:30 -05:00
Miss Islington (bot) 688b6dec4e bpo-32137: The repr of deeply nested dict now raises a RecursionError (GH-4570) (GH-4689)
instead of crashing due to a stack overflow.

This perhaps will fix similar problems in other extension types.
(cherry picked from commit 1fb72d2ad2)
2018-02-01 13:57:28 +02:00
Miss Islington (bot) 85a92d00bd bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs (GH-5451) (#5455)
Do not pass the name field in the 'from' address in the SMTP envelope.
(cherry picked from commit 8d83e4ba78)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-01-31 15:54:09 -05:00
Xiang Zhang ea94fce696
[3.6] bpo-32583: Fix possible crashing in builtin Unicode decoders (GH-5325) (#5459)
When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash..
(cherry picked from commit 2c7fd46e11)
2018-01-31 21:34:17 +08:00
Miss Islington (bot) 6b2bbcc4cc closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441) (GH-5442)
(cherry picked from commit 95441809ef)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-01-29 23:01:32 -08:00
Nick Coghlan 05f91a42cd
[3.6] Revert "bpo-32690: Preserve order of locals() (GH-5379) (#5390)"
This reverts commit 9105879bfd
in order to keep the behaviour of locals() consistent between
3.6.4 and 3.6.5+.
2018-01-30 15:27:41 +10:00
Miss Islington (bot) 6ea75b174d bpo-27931: Fix email address header parsing error (GH-5329) (GH-5431)
Correctly handle addresses whose username is an empty quoted string.
(cherry picked from commit aa218d1649)

Co-authored-by: jayyyin <jayyin11043@hotmail.com>
2018-01-29 14:27:55 -08:00
Miss Islington (bot) 543ec005a4 bpo-32650: Add native coroutine support to bdb when stepping over line (GH-5400) (#5402)
(cherry picked from commit 4687702442)
2018-01-29 07:57:06 +02:00