Commit Graph

98417 Commits

Author SHA1 Message Date
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 98c849a2f3 bpo-31217: Fix regrtest -R for small integer (#3260) (#3261)
Use a pool of integer objects toprevent false alarm when checking for
memory block leaks. Fill the pool with values in -1000..1000 which
are the most common (reference, memory block, file descriptor)
differences.

Co-Authored-By: Antoine Pitrou <pitrou@free.fr>
(cherry picked from commit 6c2feabc5d)
2017-09-01 15:04:47 +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
Mariatta b5db7bb9da [3.6] Fix the indentation in Extending Python code example (GH-3244) (GH-3250)
Code was indented with three spaces.
Fixed using four spaces.
(cherry picked from commit d9a2b99ac4)
2017-08-30 23:11:02 -07: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
Mariatta 83e5c888ff [3.6] bpo-26656: Improve re.compile documentation (GH-3211) (GH-3225)
- Link to the regular expressions object documentation
- Clarify that it can be used with more than the two methods currently stated.
(cherry picked from commit ed94a8b285)
2017-08-27 22:50:08 -07: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
Mariatta 2dfafa3c56 bpo-31191: Improve grammar in threading.Barrier docs (GH-3080) (GH-3224)
(cherry picked from commit 143be36629)
2017-08-27 15:19:08 -07: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
Oren Milman 8e67981fc8 [3.6] bpo-28261: Prevent raising SystemError where PyArg_ParseTuple is used to parse non-args. (#3210) 2017-08-26 15:27:50 +03:00
Victor Stinner cb7fdf69ec bpo-28667: Fix a compile warning on FreeBSD when compare with FD_SETSIZE. (#501) (#3190)
FreeBSD is the only platforms with unsigned FD_SETSIZE.

(cherry picked from commit 783d0c1a1c)
2017-08-23 00:58:43 +02: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 468534d92f bpo-31259: test_urllib2_localnet uses addCleanup(server.stop) (#3186)
Use self.addCleanup(self.server.stop) to stop the HTTP server. Some
tests didn't stop the server like test_https().

Fix also the usage of support.threading_cleanup().
2017-08-22 18:03:38 +02:00
Victor Stinner 5f20539ee5 bpo-31234: fork_wait tests now join threads (#3139) (#3187)
fork_wait.py tests now joins threads, to not leak running threads in
the background.

(cherry picked from commit c99d41f9c0)
2017-08-22 18:03:03 +02:00
Victor Stinner 29d007bb67 [3.6] bpo-30871: Add test.pythoninfo (#3174)
* bpo-30871: Add test.pythoninfo (#3075)

* Add Lib/test/pythoninfo.py: script collecting various informations
  about Python to help debugging test failures.
* regrtest: remove sys.hash_info and sys.flags from header.
* Travis CI, Appveyor: run pythoninfo before tests
(cherry picked from commit b907abc885)

* bpo-30871: pythoninfo: add expat and _decimal (#3121)

* bpo-30871: pythoninfo: add expat and _decimal

* Remove _decimal.__version__

The string is hardcoded, not really interesting.

(cherry picked from commit f6ebd838f0)

* bpo-30871: Add "make pythoninfo" (#3120)

(cherry picked from commit a3a01a2fce)

* bpo-30871: pythoninfo: more sys, os, time data (#3130)

* bpo-30871: pythoninfo: more sys, os, time data

PythonInfo now converts types other than intger to string by default.

* fix typo

(cherry picked from commit ad7eaed543)

* bpo-31231: Fix pythoninfo in Travis config (#3134)

bpo-31231, bpo-30871: Replace "./python -m test.pythoninfo" with
"make pythoninfo", since macOS uses ./python.exe.
(cherry picked from commit 92b1f90143)
2017-08-22 00:17:15 +02:00
Victor Stinner e76cb43556 [3.6] bpo-30121: Fix debug assert in subprocess on Windows (#1224) (#3173)
* bpo-30121: Fix debug assert in subprocess on Windows (#1224)

* bpo-30121: Fix debug assert in subprocess on Windows

This is caused by closing HANDLEs using os.close which is for CRT file
descriptors and not for HANDLEs.

* bpo-30121: Suppress debug assertion in test_subprocess when ran directly

(cherry picked from commit 4d3851727f)

* Add test_subprocess.test_nonexisting_with_pipes() (#3133)

bpo-30121: Test the Popen failure when Popen was created with pipes.
Create also NONEXISTING_CMD variable in test_subprocess.py.
(cherry picked from commit 9a83f651f3)
2017-08-22 00:15:23 +02: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 24c0c5b48c [3.6] bpo-31206: IDLE: Factor HighPage class from ConfigDialog (GH-3160) (#3162)
Part 3 of 3.  Remove old highlight functions and load_config as this functionality is now contained within classes. Patch by Cheryl Sabella.
(cherry picked from commit 4bfebc6301)
2017-08-20 19:21:51 -04:00
Cheryl Sabella 3d9c0d498d [3.6] bpo-31206: IDLE: Factor HighPage class from ConfigDialog (GH-3156) (#3159)
Patch 2 of 3, to avoid horrendous diff.  Create highlights page from new HighPage class instead of old ConfigDialog methods and change tests to match. Patch by Cheryl Sabella.
(cherry picked from commit 8f7a798edb)
2017-08-20 08:03:05 -04: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 b50e7683ac bpo-31234: test_threading: fix ref cycle (#3150) (#3152)
test_bare_raise_in_brand_new_thread() now explicitly breaks a
reference cycle to not leak a dangling thread.
(cherry picked from commit 3d284c081f)
2017-08-19 02:32:54 +02:00
Victor Stinner 3e866dfaec bpo-31235: Fix ResourceWarning in test_logging (#3147) (#3149)
(cherry picked from commit a7719e27b3)
2017-08-19 01:11:44 +02: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
Mariatta ff64a24c67 Fix broken `Show Source` links on documentation pages (GH-3113) (GH-3125)
The `Show Source` was broken because of a change made in sphinx 1.5.1
In Sphinx 1.4.9, the sourcename was "index.txt".
In Sphinx 1.5.1+, it is now "index.rst.txt".
(cherry picked from commit b9ff498793)
2017-08-18 06:21:33 -07: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 d23b1c4fd8 [3.6] bpo-31221: patchcheck ignores external libraries (#3109) (#3116)
* bpo-31221: patchcheck ignores external libraries (#3109)

Tools/scripts/patchcheck.py now ignores changes in directories which
are copies of external libraries:

* Modules/_ctypes/libffi_msvc/
* Modules/_ctypes/libffi_osx/
* Modules/_decimal/libmpdec/
* Modules/expat/
* Modules/zlib/

Drop also support for Mercurial, since CPython migrated to Git.

Exclude also libmpdec

patchcheck: exclude also libffi_osx and libffi_msvc
(cherry picked from commit 4a347ce426)

* Exclude also Modules/_ctypes/libffi on Python 3.6
2017-08-17 16:53:27 +02:00
Julien Palard fcecb0e365 Update the language selection in the docs language switch. (GH-3114) (#3115)
Change the option for `Français` into `French` to be consistent with the other language selections that are already in English.
(cherry picked from commit b616b97299)
2017-08-17 16:37:00 +02:00
Victor Stinner ffbb6f7334 bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666) (#3102)
Use only the LongLong form for the conversions

(cherry picked from commit 50e86033de)
2017-08-17 14:33:06 +02:00
Victor Stinner 78c66a641a bpo-31069, test_multiprocessing: Fix dangling process (#3103) (#3104)
Fix a warning about dangling processes in test_rapid_restart() of
_test_multiprocessing: join the process.
(cherry picked from commit 17657bb945)
2017-08-16 13:14:38 +02: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 de36ba065e [3.6] bpo-30928: Update idlelib/NEWS.txt to 2017-08-15. (GH-3098) (#3099)
(cherry picked from commit 7f06684)
2017-08-15 19:41:03 -04: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
Victor Stinner f2d769d539 bpo-31067: test_subprocess calls reap_children() (#2931) (#3074)
test_subprocess now also calls reap_children() in tearDown(), not
only on setUp().
(cherry picked from commit cc42c121eb)
2017-08-11 17:14:37 +02:00
Victor Stinner bc69d00288 bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3070)
The current test_child_terminated_in_stopped_state() function test
creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and
then crash (SIGSEGV). The problem is that calling os.waitpid() in the
parent process is not enough to close the process: the child process
remains alive and so the unit test leaks a child process in a
strange state. Closing the child process requires non-trivial code,
maybe platform specific.

Remove the functional test and replaces it with an unit test which
mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to
test the WIFSTOPPED() path.
(cherry picked from commit 7b7c6dcfff)
2017-08-11 02:36:30 +02:00
Victor Stinner 270c3c62ed bpo-31008: Fix asyncio test_wait_for_handle on Windows (#3065) (#3068)
(cherry picked from commit 5659a72f48)
2017-08-11 01:52:13 +02:00
Julien Palard e8e7fba0b2 bpo-31159: fix language switch regex on unknown yet built languages. … (#3051)
* bpo-31159: fix language switch regex on unknown yet built languages. (#3039)

This fix a regex issue (a missing non-matching group around an 'or'
list) and the specific possible case where a translation is built but
not yet in known by the picker, but not explicitly listing possible
languages in the regex.
(cherry picked from commit 122081deef)

* bpo-31149: Doc: Add Japanese to the language switcher. (#3028)

(cherry picked from commit c82b7f332a)
2017-08-10 16:54:26 +02:00
Victor Stinner 719a15b325 [3.6] bpo-31160: Backport reap_children() fixes from master to 3.6 (#3060)
* bpo-31160: Fix test_builtin for zombie process (#3043)

PtyTests.run_child() now calls os.waitpid() to read the exit status
of the child process to avoid creating zombie process and leaking
processes in the background.
(cherry picked from commit 4baca1b0f7)

* bpo-31160: regrtest now reaps child processes (#3044)

Add a post_test_cleanup() function which currently only calls
support.reap_children().
(cherry picked from commit e3510d74aa)

* bpo-31160: test_builtin: don't check waitpid() status (#3050)

(cherry picked from commit 3ca9f50f96)

* bpo-31160: test_tempfile: Fix reap_children() warning (#3056)

TestRandomNameSequence.test_process_awareness() now calls
os.waitpid() to avoid leaking a zombie process.
(cherry picked from commit 6c8c2943d9)
2017-08-10 16:02:00 +02: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
Ammar Askar 4388b4257a [3.6] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3041) 2017-08-09 16:59:21 +02: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