Commit Graph

184 Commits

Author SHA1 Message Date
Miss Islington (bot) 415cc1fa57 [3.6] bpo-31566: Fix an assertion failure in _warnings.warn() in case of a bad __name__ global. (GH-3717) (#3730)
(cherry picked from commit 5d3e80021a)
2017-09-24 23:14:41 +03:00
Miss Islington (bot) b650194652 [3.6] bpo-31459: Rename IDLE's module browser from Class Browser to Module Browser. (GH-3704) (#3710)
The original module-level class and method browser became a module
browser, with the addition of module-level functions, years ago.
Nested classes and functions were added yesterday.  For back-
compatibility, the virtual event <<open-class-browser>>, which
appears on the Keys tab of the Settings dialog, is not changed.
Patch by Cheryl Sabella.
(cherry picked from commit cd99e79dc7)
2017-09-23 17:16:47 -04:00
Miss Islington (bot) 429b3b1188 [3.6] bpo-31559: Remove test order dependence in idle_test.test_browser. (GH-3708) (#3709)
Order dependence caused leak-test buildbots to fail when running test_idle repeatedly.
(cherry picked from commit 99167f85b7)
2017-09-23 15:24:18 -04:00
Terry Jan Reedy fa1cae5832 [3.6] bpo-1612262: IDLE: Class Browser shows nested functions, classes (GH-2573) (#3702)
Original patches for code and tests by Guilherme Polo and
Cheryl Sabella, respectively.

(cherry picked from commit 058de11360)
2017-09-22 17:28:01 -04:00
Miss Islington (bot) eef49f5dd0 bpo-31351: Set return code in ensurepip when pip fails (GH-3626) (GH-3683)
Previously ensurepip would always report success, even if the
pip installation failed.
(cherry picked from commit 9adda0cdf8)

* Update version changed notice for backport
2017-09-22 06:45:37 -07:00
Terry Jan Reedy 0c4997f191 [3.6] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (#3686)
(cherry picked from commit a96c96f)
2017-09-21 11:15:45 -04:00
Miss Islington (bot) 88d0663005 [3.6] closes bpo-31532: Fix memory corruption due to allocator mix (GH-3679) (#3681)
Fix a memory corruption in getpath.c due to mixed memory allocators
between Py_GetPath() and Py_SetPath().

The fix use the Raw allocator to mimic the windows version.

This patch should be used from python3.6 to the current version

for more details, see the bug report and
  https://github.com/pyinstaller/pyinstaller/issues/2812
(cherry picked from commit 3d1e2ab584)
2017-09-20 23:47:12 -07:00
Miss Islington (bot) c6ce8fba07 [3.6] bpo-31482: Missing bytes support for random.seed() version 1 (GH-3614) (GH-3659)
(cherry picked from commit 132a7d7cdb)
2017-09-19 10:56:33 -07:00
Miss Islington (bot) f37dd11f0d [3.6] bpo-31293: Fix crashes in truediv and mul of a timedelta by a float with a bad as_integer_ratio() method. (GH-3227) (#3654)
(cherry picked from commit 865e4b4f63)
2017-09-19 17:00:44 +03:00
Miss Islington (bot) 99a51d4e5b [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string. (GH-3257) (#3653)
(cherry picked from commit 9974e1bcf3)
2017-09-19 15:51:19 +03:00
Ned Deily 2f61f6417a Update pydoc topics and NEWS blurbs for 3.6.3rc1 2017-09-18 23:04:41 -04:00
Miss Islington (bot) 8afd7ab12d [3.6] bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (GH-3641) (#3645)
* bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash

xml.etree: xmlparser_gc_clear() now sets self.parser to NULL to prevent a
crash in xmlparser_dealloc() if xmlparser_gc_clear() was called previously
by the garbage collector, because the parser was part of a reference cycle.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit e727d41ffc)
2017-09-18 05:48:23 -07:00
Miss Islington (bot) b417332bf4 [3.6] bpo-31493: Fix code context update and font update timers. (GH-3622) (#3623)
Canceling timers prevents a warning message when test_idle completes.
(This is the minimum fix needed before upcoming releases.)
(cherry picked from commit a6bb313c70)
2017-09-17 02:01:53 -04:00
Miss Islington (bot) 77b52e463a [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) (#3613)
When apply ConfigDialog changes, call .reload on each class with non-key options.
Change ParenMatch so that updates affect current instances.
(cherry picked from commit 5777ecc438)
2017-09-16 02:14:34 -04:00
Terry Jan Reedy 4d72945a28 [3.6] bpo-314777: IDLE - improve rstrip entry in doc (GH-3602) (#3605)
'Strip trailing whitespace' is not limited to spaces.  Wording caters to beginners who
do know know the meaning of 'whitespace'.  Multiline string literals are not skipped.
(cherry picked from commit ff70289)
2017-09-15 15:09:17 -04:00
Miss Islington (bot) 7b62416d86 [3.6] bpo-31480: IDLE - fix tests to pass with zzdummy extension disabled. (GH-3590) (#3591)
Enabled by default was a temporary expedient.  The fix is to add a user override to enable.
(cherry picked from commit d384a81f55)
2017-09-14 20:34:42 -04:00
Miss Islington (bot) 49caab46f6 [3.6] bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). (GH-3545) (#3585)
* Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set.

* Ignore only AttributeError on attribute lookups in ElementTree.XMLParser() and propagate all other exceptions.
(cherry picked from commit c8d8e15bfc)
2017-09-15 02:13:21 +03:00
Miss Islington (bot) 1658ec0757 [3.6] bpo-28556: typing.get_type_hints: better globalns for classes and modules (GH-3582) (#3583)
This makes the default behavior (without specifying `globalns` manually) more
predictable for users, finds the right globalns automatically.

Implementation for classes assumes has a `__module__` attribute and that module
is present in `sys.modules`.  It does this recursively for all bases in the
MRO.  For modules, the implementation just uses their `__dict__` directly.

This is backwards compatible, will just raise fewer exceptions in naive user
code.

Originally implemented and reviewed at https://github.com/python/typing/pull/470.
(cherry picked from commit f350a268a7)
2017-09-14 16:52:05 -04:00
Miss Islington (bot) f135f62cfd [3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (GH-3580) (#3584)
(cherry picked from commit 0b3a87ef54)
2017-09-14 22:56:31 +03:00
Miss Islington (bot) 20fa05d022 [3.6] bpo-31457: Allow for nested LoggerAdapter objects (GH-3551) (#3576)
Some of the proxied methods use internal Logger state which isn't proxied,
causing failures if an adapter is applied to another adapter.

This commit fixes the issue, adds a new test for the use case.
(cherry picked from commit 1bbd482bcf)
2017-09-14 13:10:25 -04:00
Miss Islington (bot) 5dbb28ecec [3.6] bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__ attribute. (GH-3539) (#3556)
(cherry picked from commit f6e61df015)
2017-09-14 09:41:39 +03:00
Miss Islington (bot) 9e3cd78ec1 [3.6] bpo-28556: Minor updates to typing module (GH-3550) (#3558)
* Copy changes to typing from upstream repo
* Add NEWS entry
(cherry picked from commit 65bc62052f)
2017-09-13 20:10:53 -04:00
Miss Islington (bot) d99e85b9f6 [3.6] bpo-31234, socket.create_connection(): Fix ref cycle (GH-3546) (#3552)
(cherry picked from commit acb9fa79fa)
2017-09-13 15:54:34 -07:00
Miss Islington (bot) 4d7807ab9a [3.6] bpo-31421: Document how IDLE runs tkinter programs. (GH-3513) (#3514)
IDLE calls tcl/tk update in the background in order to make live
interaction and experimentatin with tkinter applications much easier.
(cherry picked from commit 98758bc67f)
2017-09-12 09:44:59 -04:00
Serhiy Storchaka 9adc87b0f8 [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (GH-3496) (#3509)
Patch by Oren Milman..
(cherry picked from commit 9d984fd2b0)
2017-09-12 09:48:27 +03:00
Miss Islington (bot) 31b242459c [3.6] bpo-31414: IDLE -- fix tk entry box tests by deleting first. (GH-3501) (#3502)
Adding to an int entry is not the same as deleting and inserting
because int('') will fail.
(cherry picked from commit 667522efa8)
2017-09-11 16:34:11 -04:00
Serhiy Storchaka 7972ed2111 [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (GH-3485). (#3494)
(cherry picked from commit 252033d50e)
2017-09-11 10:01:47 +03:00
Terry Jan Reedy d6c397bf77 [3.6] bpo-27099: IDLE - Convert built-in extensions to regular features (GH-2494) (#3487)
About 10 IDLE features were implemented as supposedly optional
extensions.  Their different behavior could be confusing or worse for
users and not good for maintenance.  Hence the conversion.

The main difference for users is that user configurable key bindings
for builtin features are now handled uniformly.  Now, editing a binding
in a keyset only affects its value in the keyset.  All bindings are
defined together in the system-specific default keysets in config-
extensions.def.  All custom keysets are saved as a whole in config-
extension.cfg.  All take effect as soon as one clicks Apply or Ok.

The affected events are '<<force-open-completions>>', '<<expand-word>>',
'<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>',
'<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any
(global) customizations made before 3.6.3 will not affect their keyset-
specific customization after 3.6.3. and vice versa.

Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
(cherry picked from commit 58fc71c)
2017-09-10 20:30:46 -04:00
Christian Heimes 16f16dbd0e [3.6] bpo-31400: Improve SSL error handling on Windows (GH-3463) (#3466)
* bpo-31392: Improve SSL error handling on Windows

* Remove unnecessary Windows mention in NEWS.
(cherry picked from commit e6eb48c10d)
2017-09-09 08:22:11 -07:00
Christian Heimes 9f2b3d4c28 [3.6] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (GH-1363) (#3444)
* bpo-29136: Add TLS 1.3 support

TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.

Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit cb5b68abde)
2017-09-07 20:23:52 -07:00
Christian Heimes 9423f5d688 [3.6] bpo-27340: Use memoryview in SSLSocket.sendall() (GH-3384) (#3434)
* bpo-27340: Use memoryview in SSLSocket.sendall()

SSLSocket.sendall() now uses memoryview to create slices of data. This fix
support for all bytes-like object. It is also more efficient and avoids
costly copies.

Signed-off-by: Christian Heimes <christian@python.org>

* Cast view to bytes, fix typo

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 888bbdc192)
2017-09-07 16:59:17 -07:00
Christian Heimes 6c99b652f7 [3.6] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3432)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 17c9ac9)
2017-09-07 16:45:39 -07:00
Miss Islington (bot) 27ce5a1b19 [3.6] bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples (GH-3229) (#3430)
* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry
(cherry picked from commit 586c0502b5)
2017-09-07 14:27:44 -07:00
Steve Dower 76006f285a [3.6] bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler GH-1632 (#3425) 2017-09-07 13:58:07 -07:00
Miss Islington (bot) b03623227e [3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)
(cherry picked from commit a853a8ba78)
2017-09-07 11:35:03 -07:00
Miss Islington (bot) aa1afc72c1 bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)
For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
(cherry picked from commit e7c566caf1)
2017-09-06 19:43:04 -07:00
Miss Islington (bot) 1fc47b40af [3.6] bpo-21649: Add RFC 7525 and Mozilla server side TLS (GH-3387) (GH-3399)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit ad0ffa033e)
2017-09-06 17:31:30 -07:00
Steve Dower fd645ec6f5 [3.6] bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (GH-3311) (#3386) 2017-09-06 15:55:25 -07:00
Gregory P. Smith 3bad1650a0 [3.6] bpo-31178: Avoid concatenating bytes with str in subprocess error (GH-3066) (#3388)
Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath.
(cherry picked from commit 3fc499bca1)
2017-09-06 13:34:17 -07:00
Christian Heimes 6da379bde3 [3.6] bpo-29781: Fix SSLObject.version before handshake (GH-3364) (#3381)
SSLObject.version() now correctly returns None when handshake over BIO has
not been performed yet.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 6877111)
2017-09-06 06:42:30 -07:00
Miss Islington (bot) ff125e1aa9 bpo-31350: Optimize get_event_loop and _get_running_loop (GH-3347) (GH-3373)
* call remove_done_callback in finally section

* Optimize get_event_loop and _get_running_loop

* rename _loop_pid as loop_pid and add blurb news

* rename _loop_pid as loop_pid and add blurb news

* add back _RunningLoop

* Update 2017-09-05-10-30-48.bpo-31350.dXJ-7N.rst

* Update 2017-09-05-10-30-48.bpo-31350.dXJ-7N.rst
(cherry picked from commit 80bbe6a7b6)
2017-09-05 20:05:35 -07:00
Miss Islington (bot) c506403faf [3.6] bpo-31320: No traceback to sys.stderr in test_ssl (GH-3360) (GH-3369)
In case PROTOCOL_TLS_SERVER is used for both client context and server
context, the test thread dies with OSError. Catch OSError to avoid
traceback on sys.stderr

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 305e56c27a)
2017-09-05 18:11:31 -07:00
Victor Stinner e5f2f80385 bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315) (#3350)
* bpo-31170: Update libexpat from 2.2.3 to 2.2.4

Fix copying of partial characters for UTF-8 input (libexpat bug 115):
https://github.com/libexpat/libexpat/issues/115

* Add NEWS entry.

(cherry picked from commit 759e30ec47)
2017-09-06 01:30:22 +02:00
Christian Heimes f201e886fc [3.6] bpo-30502: Fix handling of long oids in ssl. (GH-2909) (#3321)
(cherry picked from commit e503ca5288)
2017-09-05 19:13:03 +02:00
Christian Heimes 2ddea0f098 [3.6] bpo-30102: Call OPENSSL_add_all_algorithms_noconf (GH-3112) (#3342)
The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on
OpenSSL < 1.1.0. The function detects CPU features and enables optimizations
on some CPU architectures such as POWER8. Patch is based on research from
Gustavo Serra Scalet.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit c941e62)
2017-09-05 17:12:03 +02:00
Christian Heimes 02854dab62 [3.6] bpo-31343: Include sys/sysmacros.h (GH-3318) (#3344)
Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray
plans to remove the functions from sys/types.h.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 75b9618)
2017-09-05 17:09:12 +02:00
Ned Deily 114c457408 Simplify NEWS entry to prevent suspicious warnings. (#3339) 2017-09-04 23:23:04 -07:00
Gregory P. Smith 16a3a7b6a0 Rename my manually mis-named NEWS.d file. #sorry (#3326) 2017-09-04 16:38:23 -07:00
Gregory P. Smith 1dba3789e3 bpo-22536 [3.6] Set filename in FileNotFoundError (#3305)
* [3.6] bpo-22536: Set the filename in FileNotFoundError. (GH-3194)

Have the subprocess module set the filename in the FileNotFoundError
exception raised on POSIX systems when the executable or cwd are missing.
(cherry picked from commit 8621bb5d93)

* bpo-22536 [3.6] (GH-3202) skip non-windows tests.
2017-09-04 14:23:23 -07:00
Christian Heimes 4bc8ef0eee [3.6] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3300)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 002d64039b)
2017-09-04 22:54:47 +02:00
larryhastings 6a116c2aa4 Blurbify 3.6. (#3287)
Blurbify 3.6.
2017-09-04 12:03:25 -07:00
INADA Naoki 2eea952b1b bpo-31095: fix potential crash during GC (GH-3195)
(cherry picked from commit a6296d34a4)
2017-09-04 12:31:09 +09:00
Gregory P. Smith 7d8282d25d [3.6] bpo-29212: Fix the ugly repr() ThreadPoolExecutor thread name. (GH-2315) (#3276)
bpo-29212: Fix the ugly ThreadPoolExecutor thread name.

Fixes the newly introduced ugly default thread name for concurrent.futures
thread.ThreadPoolExecutor threads.  They'll now resemble the old <=3.5
threading default Thread-x names by being named ThreadPoolExecutor-y_n..
(cherry picked from commit a3d91b43c2)
2017-09-03 14:52:20 -07:00
Gregory P. Smith 31b8efeaa8 [3.6] bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func (#3274)
* [3.6] bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func. (GH-1777)

This helps people in weird FIPS mode environments where common things
like MD5 are not available in the binary as a matter of policy.
(cherry picked from commit 07244a8301)

* Include a NEWS entry.
2017-09-03 14:35:19 -07:00
Serhiy Storchaka 98bbeb78e0 bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076) (#3269)
(cherry picked from commit bca4939d80)
2017-09-03 09:24:32 +03:00
Christopher Wilcox 58521fdba1 bpo-30581: Windows: os.cpu_count() returns wrong number of processors (#2934) (#3267)
* Fixes #30581 by adding a path to use newer GetMaximumProcessorCount API on Windows calls to os.cpu_count()

* Add NEWS.d entry for bpo-30581, os.cpu_count on Windows.

* Tweak NEWS entry
2017-09-01 21:28:47 +02:00
Antoine Pitrou ea767915f7 [3.6] bpo-27144: concurrent.futures as_complete and map iterators do not keep reference to returned object (GH-1560) (#3266)
bpo-27144: concurrent.futures as_complie and map iterators do not keep
reference to returned object

(cherry picked from commit 97e1b1c814)
2017-09-01 19:16:46 +02:00
Victor Stinner 60f3f1fb5c bpo-31249: Fix ref cycle in ThreadPoolExecutor (#3253)
[3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor
2017-09-01 14:46:44 +02:00
Oren Milman 095a421b16 [3.6] bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (GH-3226) (#3243)
if pathname.replace('/', '\\') returns non-string.
(cherry picked from commit 631fdee6e6)
2017-08-30 14:08:39 +03:00
Pauli Virtanen 2d1653aa43 [3.6] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3241)
Ctypes currently produces wrong pep3118 type codes for several types.
E.g. memoryview(ctypes.c_long()).format gives "<l" on 64-bit platforms,
but it should be "<q" instead for sizeof(c_long) == 8

The problem is that the '<>' endian specification in the struct syntax
also turns on the "standard size" mode, which makes type characters have
a platform-independent meaning, which does not match with the codes used
internally in ctypes.  The struct module format syntax also does not
allow specifying native-size non-native-endian items.

This commit adds a converter function that maps the internal ctypes
codes to appropriate struct module standard-size codes in the pep3118
format strings. The tests are modified to check for this.
(cherry picked from commit 07f1658aa0)
2017-08-30 11:40:05 +02:00
Terry Jan Reedy 87c50245b1 [3.6] bpo-31051: Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. (GH-3239) (#3240)
(cherry picked from commit 390ead)
2017-08-30 02:47:24 -04:00
Oren Milman c7750c2a3a [3.6] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3233)
(cherry picked from commit ba7d736521)
2017-08-29 15:43:32 +03:00
Terry Jan Reedy 5c89c2fd8a [3.6] bpo-30617: IDLE: docstrings and unittest for outwin.py (GH-2046) (#3223)
Move some data and functions from the class to module level. Patch by Cheryl Sabella.
(cherry picked from commit 998f496)
2017-08-27 18:29:24 -04:00
Terry Jan Reedy 7e248904cd [3.6] bpo-31287: IDLE - do not alter tkinter.messagebox in configdialog tests. (GH-3220) (#3221)
(cherry picked from commit 3457f42)
2017-08-27 17:14:19 -04:00
Terry Jan Reedy 7b556025ff [3.6] bpo-30781: IDLE - use ttk widgets in configdialog (GH-2654) (#3214)
Patch by Cheryl Sabella.
(cherry picked from commit 7028e59)
2017-08-26 16:12:14 -04:00
Oren Milman 9bcbc6cba3 [3.6] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (GH-3201) (#3209)
(cherry picked from commit a5b4ea15b6)
2017-08-26 20:29:40 +03:00
Łukasz Langa 8e572491b5 [3.6] bpo-30983: [gdb] Fix py-bt, etc. for non-debug shared builds (GH-3153) (#3192)
PEP 523 introduced _PyEval_EvalFrameDefault which inlines PyEval_EvalFrameEx on
non-debug shared builds.  This breaks the ability to use py-bt, py-up, and
a few other Python-specific gdb integrations.

This patch fixes the problem by only looking for _PyEval_EvalFrameDefault
frames.

test_gdb passes on both a debug and a non-debug build.

Original patch by Bruno "Polaco" Penteado.
(cherry picked from commit 5fe59f8e3a)
2017-08-22 13:20:40 -07:00
Victor Stinner 12a3e343e1 bpo-31247: xmlrpc.server: break reference cycle (#3166) (#3168)
xmlrpc.server now explicitly breaks reference cycles when using
sys.exc_info() in code handling exceptions.
(cherry picked from commit 84524454d0)
2017-08-21 18:35:04 +02:00
Cheryl Sabella 764e282158 [3.6] bpo-31206: IDLE: Factor HighPage class from ConfigDialog (GH-3141) (#3154)
This is the first half of a patch similar to the one for for bpo-31205.  It is being split into 2 PRs to avoid what happened with PR-3096 -- an incomprehensible diff that could not be cleanly backported to 3.6.  This half copies several methods of ConfigDialog and turns them into a new class.  Patch by Cheryl Sabella.
(cherry picked from commit a32e40561a)
2017-08-19 09:22:54 -04:00
Nick Coghlan 1a05e87ec7 [3.6] bpo-31232: Backport custom print rshift message (GH-3155)
bpo-30721 added a "Did you mean ...?" suggestion to rshift
TypeError messages that triggers when the LHS is a Python
C function called "print".

Since this custom error message is expected to be triggered
primarily by attempts to use Python 2 print redirection syntax
in Python 3, and is incredibly unlikely to be encountered
otherwise, it is also being backported to the next 3.6
maintenance release.

Initial patch by Sanyam Khurana.
2017-08-19 16:59:38 +10:00
Victor Stinner 83e37e16f3 bpo-30947: Update libexpat from 2.2.1 to 2.2.3 (#3106) (#3143)
* bpo-30947: Update libexpat from 2.2.1 to 2.2.3

* Add NEWS entry

* Add new loadlibrary.c

* expat_external.h: restore include "pyexpatns.h"

* PCbuild: add expat/loadlibrary.c

* Define XML_POOR_ENTROPY to compile expat

(cherry picked from commit 93d0cb58b4)
2017-08-19 01:06:27 +02:00
Terry Jan Reedy 6db2edbe05 [3.6] bpo-31001: IDLE: Add tests for configdialog highlight tab (GH-3123) (#3124)
(cherry picked from commit 82aff62)
2017-08-17 21:02:20 -04:00
Victor Stinner 98e26979aa Revert "[3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python extension (GH-2803) (#3090)" (#3101)
This reverts commit 09b77165e3.
2017-08-16 11:02:08 +02:00
Terry Jan Reedy ff4b222b02 [3.6] bpo-31205: IDLE: Factor KeysPage class from ConfigDialog (GH-3096) (#3097)
* bpo-31205: IDLE: Factor KeysPage class from ConfigDialog (#3096)

  The slightly modified tests continue to pass.  Patch by Cheryl Sabella.

(cherry picked from commit e36d9f5568)

* [3.6] bpo-31205: IDLE: Factor KeysPage class from ConfigDialog (GH-3096)

  The slightly modified tests continue to pass.  Patch by Cheryl Sabella..
(cherry picked from commit e36d9f5568)
2017-08-15 19:13:11 -04:00
Christian Heimes 7f6a13bd56 [3.6] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3093)
OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
callback can pretend to not been set.

See https://github.com/openssl/openssl/pull/3158 for more details

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit a5c1bab352)
2017-08-15 10:45:40 +02:00
Terry Jan Reedy a31459008c [3.6] bpo-31002: IDLE: Add tests for configdialog keys tab (GH-2996) (#3092)
Patch by Cheryl Sabella.
(cherry picked from commit 2f89646)
2017-08-14 21:45:02 -04:00
Łukasz Langa 09b77165e3 [3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python extension (GH-2803) (#3090)
pep 0523 renames PyEval_EvalFrameEx to _PyEval_EvalFrameDefault while the gdb python extension only looks for PyEval_EvalFrameEx to understand if it is dealing with a frame.

Final effect is that attaching gdb to a python3.6 process doesnt resolve python objects. Eg. py-list and py-bt dont work properly.

This patch fixes that. Tested locally on python3.6
(cherry picked from commit 2e0f4db114)
2017-08-14 16:06:28 -07:00
Terry Jan Reedy 646f6c3096 [3.6] bpo-19903: IDLE: Calltips changed to use inspect.signature (GH-2822) (#3053)
Idlelib.calltips.get_argspec now uses inspect.signature instead of inspect.getfullargspec, like help() does.  This improves the signature in the call tip in a few different cases, including builtins converted to provide a signature.  A message is added if the object is not callable, has an invalid signature, or if it has positional-only parameters.
Patch by Louie Lu..
(cherry picked from commit 3b0f620c1a)
2017-08-10 00:46:29 -04:00
Serhiy Storchaka f3b891718e [3.6] bpo-31070: Fix a race condition in importlib _get_module_lock(). (GH-3033). (#3038)
(cherry picked from commit 9b0d1d647e)
2017-08-09 14:56:13 +03:00
Victor Stinner 33460fa7e0 ttk: fix LabeledScale and OptionMenu destroy() method (#3025) (#3030)
bpo-31135: Call the parent destroy() method even if the used
attribute doesn't exist.

The LabeledScale.destroy() method now also explicitly clears label
and scale attributes to help the garbage collector to destroy all
widgets.
(cherry picked from commit cd7e9c1b67)
2017-08-09 10:48:11 +02:00
Terry Jan Reedy 9d7d928b58 [3.6] bpo-31130: IDLE -- stop leaks in test_configdialog. (GH-3016) (#3018)
Initial patch by Victor Stinner.
(cherry picked from commit 733d0f6)
2017-08-07 15:20:03 -04:00
Antoine Pitrou 57e836cb41 [3.6] bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (GH-2417) (#3007)
* Improve signal delivery

Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions.

* Remove unused function

* Improve comments

* Use _Py_atomic API for concurrency-sensitive signal state

* Add blurb
(cherry picked from commit 2c8a5e4c96)
2017-08-06 19:32:39 +02:00
Shane Harvey 4795ba857e [3.6] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989) (#3003)
(cherry picked from commit c4c9866064)
2017-08-05 18:01:10 +03:00
Serhiy Storchaka 946a0b69e2 [3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking (GH-2957) (#2991)
when other arguments are passed.
(cherry picked from commit 25e4f77)
2017-08-03 12:14:35 +03:00
Serhiy Storchaka f08b2be441 [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. (GH-2790) (#2992)
Previously any exception was replaced with a KeyError exception.
(cherry picked from commit 5075416)
2017-08-03 12:14:07 +03:00
INADA Naoki f142e85d22 bpo-31061: fix crash in asyncio speedup module (GH-2984)
(cherry picked from commit de34cbe9cd)
2017-08-02 16:50:39 +09:00
Terry Jan Reedy 48fcc72c83 [3.6] bpo-31083: IDLE: Describe the Page classes in configdialog (GH-2965) (#2973)
Add template as comment. Update existing classes to match outline.
Initial patch by Cheryl Sabella.
(cherry picked from commit 6f446be)
2017-08-01 01:00:33 -04:00
csabella 2bf1586e60 [3.6] bpo-25684: ttk.OptionMenu radiobuttons weren't unique (GH-2276) (#2959)
between instances of OptionMenu.
(cherry picked from commit a568e52733)

* Update Misc/ACKS
2017-07-31 22:10:13 +03:00
Terry Jan Reedy 8c4e5be1df [3.6] bpo-31050: IDLE: Factor GenPage class from ConfigDialog (GH-2952) (#2955)
The slightly modified tests for the General tab continue to pass.
Patch by Cheryl Sabella.
(cherry picked from commit e8eb17b)
2017-07-30 19:02:51 -04:00
Terry Jan Reedy 7582226a92 [3.6] bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) (GH-2905) (#2950)
The slightly modified tests continue to pass. The General test
broken by the switch to Notebook is fixed.
Patch mostly by Cheryl Sabella.
(cherry picked from commit 9397e2a)
2017-07-30 15:00:50 -04:00
Terry Jan Reedy 4c7b368de7 [3.6] bpo-30803: clarify truth value testing documentation (GH-2508) (#2946)
Initial patch by Peter Thomassen.
(cherry picked from commit caa1280)
2017-07-29 18:56:06 -04:00
Terry Jan Reedy 8364feff67 [3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) (#2944)
The notebook looks a bit better.  It will work better with separate page classes. Traversal of widgets by Tab works better.  Switching tabs with keys becomes possible.  The font sample box works better at large font sizes.

One of the two simulated click tests no longer works.  This will be investigated while fixing a bug with the widget itself.
(cherry picked from commit b331f80)
2017-07-29 01:28:05 -04:00
Terry Jan Reedy 02f88d2a41 [3.6] bpo-30853: IDLE: Convert font and general vars to use VarTrace (GH-2914) (#2935)
Instance tracers manages pairs consisting of a tk variable and a
callback function.  When tracing is turned on, setting the variable
calls the function.  Test coverage for the new class is 100%.
(cherry picked from commit 5b59154)
2017-07-28 15:42:43 -04:00
Terry Jan Reedy 2cbb6733bf [3.6] bpo-31060: IDLE: Finish regrouping ConfigDialog methods (GH-2908) (#2925)
Finish resorting the 72 ConfigDialog methods into 7 groups that represent the dialog, action buttons, and font, highlight, keys, general, and extension pages.  This will help with continuing to add tests and improve the pages. It will enable splitting ConfigDialog into 6 or 7 more comprehensible classes.
(cherry picked from commit b166080)
2017-07-27 20:50:39 -04:00
Terry Jan Reedy 0c4c65104c [3.6] bpo-31003: IDLE - Add more tests for General tab (GH-2859) (#2906)
* In configdialog: Document causal pathways in create_page_general.
Move related functions to follow this. Simplify some attribute names.
* In test_configdialog: Add tests for load and helplist functions.
Coverage for the general tab is now complete, and 63% overall.
(cherry picked from commit 2bc8f0e)
2017-07-26 21:41:26 -04:00
Dong-hee Na 8c2d4cf092 [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214) (#2886) 2017-07-26 14:11:25 +02:00
Victor Stinner e42339d3a0 [3.6] bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) (#2881)
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)

multiprocessing.Queue.get() with a timeout now polls its reader in
non-blocking mode if it succeeded to aquire the lock but the acquire
took longer than the timeout.

Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com>
(cherry picked from commit 1b7863c3b6)

* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)

_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.
(cherry picked from commit 8f6eeaf21c)
2017-07-26 05:38:22 +02:00
Terry Jan Reedy 1daeb25979 [3.6] bpo-30993: IDLE - Improve configdialog font page and tests. (GH-2831) (#2834)
In configdialog: Document causal pathways in create_font_tab docstring.  Simplify some attribute names. Move set_samples calls to var_changed_font (idea from Cheryl Sabella).  Move related functions to positions after the create widgets function.

In test_configdialog: Fix test_font_set so not order dependent.  Fix renamed test_indent_scale so it tests the widget.  Adjust tests for movement of set_samples call.  Add tests for load functions.  Put all font tests in one class and tab indent tests in another.  Except for two lines, these tests completely cover the related functions.
(cherry picked from commit 77e97ca)
2017-07-24 02:50:28 -04:00
Terry Jan Reedy 5aa3bf041d [3.6] bpo-30993: IDLE - Improve configdialog font page and tests. (GH-2818) (#2826)
* Document causal event pathways in docstring.
* Simplify some attribute names.
* Rename test_bold_toggle_set_samples to make test_font_set fail.
* Fix test_font_set so not order dependent.
* Fix renamed test_indent_scale so it tests the widget.
(cherry picked from commit 07ba305)
2017-07-23 14:18:27 -04:00
Terry Jan Reedy 04864b491e [3.6] bpo-30981: IDLE -- Add more configdialog font page tests. (GH-… (#2796)
Verify that clicking the bold checkbutton and calling its command, set_samples, changes the bold setting of both samples. Simplify some names in configdialog.
(cherry picked from commit d0969d6)
(Incorporates changes and fixes from PRs 2798,  7c5798e, and 2810, 616ecf1)

* Fix broken test with PR2798 and PR2810 changes.
2017-07-22 00:56:18 -04:00