Commit Graph

19799 Commits

Author SHA1 Message Date
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
Martijn Pieters 680f04a926 bpo-31161: only check for parens error for SyntaxError (#3083)
Subclasses such as IndentError and TabError should not have this message
applied.
2017-08-22 13:11:09 -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
Utkarsh Upadhyay c52cea4954 [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) (#2816)
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783)

Only C implementation was tested.
(cherry picked from commit 287c5594ed)

* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783)

Only C implementation was tested..
(cherry picked from commit 287c5594ed)
2017-07-26 13:49:16 +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
Berker Peksag 64b9a15886 [3.6] bpo-29403: Fix mock's broken autospec behavior on method-bound builtin functions (GH-3)
Cython will, in the right circumstances, offer a MethodType instance
where im_func is a builtin function. Any instance of MethodType is
automatically assumed to be a Python-defined function (more
specifically, a function that has an inspectable signature), but
_set_signature was still conservative in its assumptions. As a result
_set_signature would return early with None instead of a mock since
the im_func had no inspectable signature. This causes problems
deeper inside mock, as _set_signature is assumed to _always_
return a mock, and nothing checked its return value.

In similar corner cases, autospec will simply not check the spec of the
function, so _set_signature is amended to now return early with the
original, not-wrapped mock object.

Patch by Aaron Gallagher.

(cherry picked from commit 856cbcc12f)
2017-07-22 01:31:04 +03:00
Nicholas df5837b5a9 [3.6] bpo-30964: Mention ensurepip in package installation docs (GH-2797)
Adds a new 'Pip not installed' section that covers
running `ensurepip` manually, and also references
the relevant section of the Python Packaging User
Guide.

(cherry picked from commit b3527bfefd)
2017-07-21 16:44:43 +10:00
Terry Jan Reedy ac5c1e2ea3 [3.6] bpo-28523: IDLE: Use 'color' instead of 'colour'. (GH-2787) (#2791)
(cherry picked from commit a54a8f1)
2017-07-21 01:29:09 -04:00
Victor Stinner 96ef06f397 bpo-30822: Exclude tzdata from regrtest --all (#2775) (#2777)
When running the test suite using --use=all / -u all, exclude tzdata
since it makes test_datetime too slow (15-20 min on some buildbots)
which then times out on some buildbots.

-u tzdata must now be enabled explicitly, -u tzdata or -u all,tzdata,
to run all test_datetime tests.

Fix also regrtest command line parser to allow passing -u
extralargefile to run test_zipfile64.

Travis CI: remove -tzdata. Replace -u all,-tzdata,-cpu with -u all,-cpu since tzdata is now excluded from -u all.
(cherry picked from commit 5b392bbaeb)
2017-07-20 17:08:48 +02:00
terryjreedy 65c24c8467 [3.6] bpo-30917: IDLE: Add config.IdleConf unittests (GH-2691) (#2753)
Patch by Louie Lu.
(cherry picked from commit f776eb0)
(includes diffs of  ed014f7 and 9f9192a)
* fix config reset from pr 2754

* Fix test_get_font (from pr 2769)
2017-07-20 01:23:00 -04:00
Xiang Zhang 241c4a28d9 bpo-30961: Fix decrementing a borrowed reference in tracemalloc. (#2747) (#2748)
(cherry picked from commit 4ed5ad79ec)
2017-07-19 00:50:52 +08:00
Ned Deily a61089f573 Bump to v3.6.2+ 2017-07-17 00:54:03 -04:00