]> granicus.if.org Git - python/log
python
7 years agoDoc that 'sorted' args are keyword-only, fix 'reverse' default (#2709)
Łukasz Rogalski [Fri, 14 Jul 2017 19:57:19 +0000 (21:57 +0200)]
Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2709)

backport

7 years ago[3.6] Update idlelib/NEWS.txt. (GH-2703) (#2704)
terryjreedy [Fri, 14 Jul 2017 04:29:05 +0000 (00:29 -0400)]
[3.6] Update idlelib/NEWS.txt. (GH-2703) (#2704)

(cherry picked from commit 0d0a32f)

7 years ago[3.6] bpo-30913: IDLE: Document tk vars, attributes, and methods for ConfigDialog...
terryjreedy [Fri, 14 Jul 2017 03:53:30 +0000 (23:53 -0400)]
[3.6] bpo-30913: IDLE: Document tk vars, attributes, and methods for ConfigDialog (GH-2697) (#2702)

The will help writing dialog improvements and splitting the class into multiple classes.
Original patch by Cheryl Sabella.
(cherry picked from commit 36329a4)

7 years ago[3.6] bpo-30870: IDLE: Add configdialog fontlist selection unittest (GH-2666) (#2701)
terryjreedy [Fri, 14 Jul 2017 02:24:55 +0000 (22:24 -0400)]
[3.6] bpo-30870: IDLE: Add configdialog fontlist selection unittest (GH-2666) (#2701)

Initial patch by Louie Lu.
(cherry picked from commit 9b622fb)

7 years agobpo-30731: python.manifest fix (#2328) (#2699)
Steve Dower [Thu, 13 Jul 2017 19:51:50 +0000 (21:51 +0200)]
bpo-30731: python.manifest fix (#2328) (#2699)

bpo-30731: python.manifest fix

7 years ago[3.6] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690...
Serhiy Storchaka [Thu, 13 Jul 2017 08:40:25 +0000 (11:40 +0300)]
[3.6] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690) (#2692)

encoder and decoder.
(cherry picked from commit d3aaa2f)

7 years ago[3.6] bpo-30899: Add unittests, 100% coverage, for IDLE's two ConfigParser subclasses...
terryjreedy [Wed, 12 Jul 2017 18:42:37 +0000 (14:42 -0400)]
[3.6] bpo-30899: Add unittests, 100% coverage, for IDLE's two ConfigParser subclasses. (GH-2662) (#2685)

Patch by Louie Lu.
(cherry picked from commit 50c9435)

7 years ago[3.6] bpo-30779: IDLE: fix changes.delete_section calls in configdialog (GH-2667...
terryjreedy [Tue, 11 Jul 2017 23:50:10 +0000 (19:50 -0400)]
[3.6] bpo-30779: IDLE: fix changes.delete_section calls in configdialog (GH-2667) (#2674)

Also improve test of config.ConfigChanges.delete_section.
Original patch by Cheryl Sabella.
(cherry picked from commit 6d13b22)

7 years ago[3.6] bpo-30881: IDLE: add docstrings to browser.py (GH-2638) (#2663)
terryjreedy [Tue, 11 Jul 2017 06:53:32 +0000 (02:53 -0400)]
[3.6] bpo-30881: IDLE: add docstrings to browser.py (GH-2638) (#2663)

Patch by Cheryl Sabella.
(cherry picked from commit ba35227)

7 years ago[3.6] bpo-30870: IDLE -- fix logic error in eae2537. (GH-2660) (#2661)
terryjreedy [Tue, 11 Jul 2017 06:16:41 +0000 (02:16 -0400)]
[3.6] bpo-30870: IDLE -- fix logic error in eae2537. (GH-2660) (#2661)

(cherry picked from commit 5b62b35)

7 years ago[3.6] bpo-22207: Add checks for possible integer overflows in unicodeobject.c. (GH...
Serhiy Storchaka [Tue, 11 Jul 2017 04:27:56 +0000 (07:27 +0300)]
[3.6] bpo-22207: Add checks for possible integer overflows in unicodeobject.c. (GH-2623) (#2658)

Based on patch by Victor Stinner.
(cherry picked from commit 64e461b)

7 years ago[3.6] bpo-30879: os.listdir() and os.scandir() now emit bytes names when (GH-2634...
Serhiy Storchaka [Tue, 11 Jul 2017 04:16:11 +0000 (07:16 +0300)]
[3.6] bpo-30879: os.listdir() and os.scandir() now emit bytes names when (GH-2634) (#2656)

called with bytes-like argument..
(cherry picked from commit 1180e5a51871fa53ca6892e83fd2e69dc2600447)

7 years agobpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)
Victor Stinner [Mon, 10 Jul 2017 21:16:27 +0000 (23:16 +0200)]
bpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)

* Rewrite importlib _get_module_lock(): it is now responsible to hold
  the imp lock directly.
* _find_and_load() now holds the module lock to check if name is in
  sys.modules to prevent a race condition
(cherry picked from commit 4f9a446f3fb42f800e73cd9414dd1eccb3ca4fa7)

7 years agobpo-30892: Fix _elementtree module initialization (#2647) (#2649)
Victor Stinner [Mon, 10 Jul 2017 21:12:37 +0000 (23:12 +0200)]
bpo-30892: Fix _elementtree module initialization (#2647) (#2649)

Handle getattr(copy, 'deepcopy') error in _elementtree module
initialization.
(cherry picked from commit b136f11f3a51f9282ae992bac68f170ca5563b55)

7 years ago[3.6] bpo-30851: IDLE: Remove unused tk variables in configdialog. (GH-2626) (#2648)
terryjreedy [Mon, 10 Jul 2017 19:11:45 +0000 (15:11 -0400)]
[3.6] bpo-30851: IDLE: Remove unused tk variables in configdialog. (GH-2626) (#2648)

One is a duplicate, one is set but cannot be altered by users.
Patch by Cheryl Sabella.
(cherry picked from commit aa8d0a2)

7 years agobpo-30886: Fix multiprocessing.Queue.join_thread() (#2642) (#2643)
Victor Stinner [Mon, 10 Jul 2017 11:43:20 +0000 (13:43 +0200)]
bpo-30886: Fix multiprocessing.Queue.join_thread() (#2642) (#2643)

multiprocessing.Queue.join_thread() now waits until the thread
completes, even if the thread was started by the same process which
created the queue.

Fix the following warning which occurs randomly when running
test_handle_called_with_mp_queue of test_logging.QueueListenerTest:

Warning -- threading_cleanup() failed to cleanup -1 threads after 4 sec (count: 0, dangling: 1)
(cherry picked from commit 3b69d911c57ef591ac0c0f47a66dbcad8337f33a)

7 years ago[3.6] bpo-30870: IDLE: Change sample font when select by key-up/down (GH-2617) (...
terryjreedy [Sun, 9 Jul 2017 23:26:32 +0000 (19:26 -0400)]
[3.6] bpo-30870: IDLE: Change sample font when select by key-up/down (GH-2617) (#2640)

Patch by Louie Lu.
(cherry picked from commit bb2bae8)

7 years ago[3.6] bpo-29854: Fix segfault in call_readline() (GH-728)
Nir Soffer [Sat, 8 Jul 2017 18:51:21 +0000 (21:51 +0300)]
[3.6] bpo-29854: Fix segfault in call_readline() (GH-728)

If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.

It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.

This issue affects only GNU readline. When using libedit emulation
system history size option does not work.

7 years agoUpdate for post-3.6.2rc2
Ned Deily [Sat, 8 Jul 2017 04:49:40 +0000 (00:49 -0400)]
Update for post-3.6.2rc2

7 years agoMerge tag 'v3.6.2rc2' into 3.6
Ned Deily [Sat, 8 Jul 2017 04:41:30 +0000 (00:41 -0400)]
Merge tag 'v3.6.2rc2' into 3.6

Tag v3.6.2rc2

7 years ago[3.6] bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (GH-2629) (#2631)
terryjreedy [Sat, 8 Jul 2017 02:47:37 +0000 (22:47 -0400)]
[3.6] bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (GH-2629) (#2631)

(cherry picked from commit 223c7e7)

7 years ago[3.6] bpo-30779: News (GH-2627) (#2630)
terryjreedy [Sat, 8 Jul 2017 02:26:53 +0000 (22:26 -0400)]
[3.6] bpo-30779: News (GH-2627) (#2630)

(cherry picked from commit 24f2e19)

7 years ago[3.6] bpo-30779: IDLE -- Factor ConfigChanges class from configdialog, put in config...
terryjreedy [Fri, 7 Jul 2017 20:37:39 +0000 (16:37 -0400)]
[3.6] bpo-30779: IDLE -- Factor ConfigChanges class from configdialog, put in config; test. (GH-2612) (#2625)

* In config, put dump test code in a function; run it and unittest in 'if __name__ == '__main__'.
* Add class config.ConfigChanges based on changes_class_v4.py on bpo issue.
* Add class test_config.ChangesTest, partly based on configdialog_tests_v1.py on bpo issue.
* Revise configdialog to use ConfigChanges, mostly as specified in tracker msg297804.
* Revise test_configdialog to match configdialog changes.  All tests pass in both files.
* Remove configdialog functions unused or moved to ConfigChanges.
Cheryl Sabella contributed parts of the patch.
(cherry picked from commit 349abd9)

7 years agoVersion bump to 3.6.2rc2 v3.6.2rc2
Ned Deily [Fri, 7 Jul 2017 07:16:00 +0000 (03:16 -0400)]
Version bump to 3.6.2rc2

7 years agobpo-30797, bpo-30694: Avoid _GNU_SOURCE redefined warning in xmlparse.c (#2615)
Ned Deily [Fri, 7 Jul 2017 05:31:43 +0000 (01:31 -0400)]
bpo-30797, bpo-30694: Avoid _GNU_SOURCE redefined warning in xmlparse.c (#2615)

(cherry picked from commit 05b72ede95521b2d897cb4c7b034139b5437c592)

7 years agobpo-30797, bpo-30694: Avoid _GNU_SOURCE redefined warning in xmlparse.c (#2615)
Ned Deily [Fri, 7 Jul 2017 05:31:43 +0000 (01:31 -0400)]
bpo-30797, bpo-30694: Avoid _GNU_SOURCE redefined warning in xmlparse.c (#2615)

7 years ago[3.6] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2378)
Serhiy Storchaka [Sat, 24 Jun 2017 13:28:26 +0000 (16:28 +0300)]
[3.6] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2378)

(cherry picked from commit 0ee32c1)
(cherry picked from commit 0e1f9e8d3ea82262cbb9a403b70a884da5e6a6ac)

7 years ago[3.6] bpo-30730: Prevent environment variables injection in subprocess on Windows...
Serhiy Storchaka [Fri, 23 Jun 2017 17:17:38 +0000 (20:17 +0300)]
[3.6] bpo-30730: Prevent environment variables injection in subprocess on Windows. (GH-2325) (#2360)

Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)
(cherry picked from commit e7135751b8e48af80665e40ac8fa6d0073e5affe)

7 years agobpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)
Victor Stinner [Wed, 28 Jun 2017 00:28:51 +0000 (02:28 +0200)]
bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)

Free also co_extra->ce_extras, not only co_extra.
(cherry picked from commit 23e7944eba1968bb8432fdc4cc96d4fdd2c1a230)
(cherry picked from commit 26daad4ee14693381d84a5235709d22aed1c22ed)

7 years ago[3.6] bpo-30726: Also fix pyexpat.vcxproj (GH-2375) (#2570)
Segev Finer [Tue, 4 Jul 2017 18:38:47 +0000 (21:38 +0300)]
[3.6] bpo-30726: Also fix pyexpat.vcxproj (GH-2375) (#2570)

(cherry picked from commit 7526cadd64566725ffc56071a7208828a46ddbd8)
(cherry picked from commit d02c8416fe1b29b3322004b73133bf6c8a2e353a)

7 years ago[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)
Victor Stinner [Fri, 23 Jun 2017 13:21:33 +0000 (15:21 +0200)]
[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)

* bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348)

bpo-30726, bpo-29591: libexpat 2.2.1 of Modules/expat/ now uses
a winconfig.h configuration file which already defines:

* XML_NS
* XML_DTD
* BYTEORDER=1234
* XML_CONTEXT_BYTES=1024
* HAVE_MEMMOVE

Remove these defines from PCbuild/_elementtree.vcxproj to prevent
compiler warnings.

Co-Authored-By: Jeremy Kloth <jeremy.kloth@gmail.com>
(cherry picked from commit c8fb58bd7917151e63398587a7fc2126db7c26de)

* bpo-30726: Fix elementtree warnings on Windows due to expat upgrade (#2319)

* bpo-30726: Fix elementtree warnings on Windows

Caused by usage of `getenv` which should be safe. And a few integer
truncations which should also be ok.

* bpo-30726: Don't ignore libexpat warnings which haypo intends to fix upstream

(cherry picked from commit 87c65550730a8f85ce339ba197bce4fb7e836619)
(cherry picked from commit d32a05953130fb5cc2d3c0c9fcb20ad0859353f3)

7 years agobpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2313)
Victor Stinner [Wed, 21 Jun 2017 14:05:11 +0000 (16:05 +0200)]
bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2313)

New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132313eb651107b179d20218dfe5d4e47f13)
(cherry picked from commit 4a66524006852fc982aebafa277f2c043d9ad149)

7 years agobpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2289)
Victor Stinner [Tue, 20 Jun 2017 13:37:24 +0000 (15:37 +0200)]
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2289)

The current regex based splitting produces a wrong result. For example::

  http://abc#@def

Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
(cherry picked from commit 536c1f1246f4faa302f9f5613fc3444e7ae09b4a)

7 years agobpo-30687: Fixes build scripts to find msbuild.exe and stop relying on vcvarsall...
Steve Dower [Mon, 19 Jun 2017 18:12:56 +0000 (11:12 -0700)]
bpo-30687: Fixes build scripts to find msbuild.exe and stop relying on vcvarsall.bat (#2252) (#2280)

* Fixes build scripts to find msbuild.exe and stop relying on vcvarsall.bat
Also fixes bdist_wininst.vcxproj to use correct version in generated name.

(cherry picked from commit 06d6e3d0bb5b8a3d3105289034953a8014356a0b)

7 years ago[3.6] bpo-30780: Fix error in idlelib.test_idle.test_configdialog (GH-2606) (#2613)
terryjreedy [Fri, 7 Jul 2017 03:16:31 +0000 (23:16 -0400)]
[3.6] bpo-30780: Fix error in idlelib.test_idle.test_configdialog (GH-2606) (#2613)

(cherry picked from commit 25a4206)

7 years agobpo-30532: Fix whitespace folding in certain cases (#2591)
Joel Hillacre [Thu, 6 Jul 2017 21:28:22 +0000 (15:28 -0600)]
bpo-30532: Fix whitespace folding in certain cases (#2591)

Leading whitespace was incorrectly dropped during folding of certain lines in the _header_value_parser's folding algorithm.  This makes the whitespace handling code consistent.

7 years ago[3.6] Fix case in .gitignore (GH-2607) (GH-2608)
Segev Finer [Thu, 6 Jul 2017 21:08:29 +0000 (00:08 +0300)]
[3.6] Fix case in .gitignore (GH-2607) (GH-2608)

(cherry picked from commit be5ebe58776a02d53bcf5e43ab946b555c0e025f)

7 years ago[3.6] Update idlelib/NEWS.txt with merges upto 2017 Jul 5. (GH-2595) (#2596)
terryjreedy [Thu, 6 Jul 2017 19:29:35 +0000 (15:29 -0400)]
[3.6] Update idlelib/NEWS.txt with merges upto 2017 Jul 5. (GH-2595) (#2596)

(cherry picked from commit 1ccbad9c95cf5782a1329eeaecba6e3eb0c37cb8)

7 years ago[3.6] bpo-30814: Fixed a race condition when import a submodule from a package. ...
Serhiy Storchaka [Thu, 6 Jul 2017 05:38:24 +0000 (08:38 +0300)]
[3.6] bpo-30814: Fixed a race condition when import a submodule from a package. (GH-2580). (#2598)

(cherry picked from commit b4baacee1adc06edbe30ac7574d17a8cd168e2e0)

7 years ago[3.6] bpo-30828: Fix out of bounds write in `asyncio.CFuture.remove_done_callback...
Yury Selivanov [Wed, 5 Jul 2017 18:03:10 +0000 (14:03 -0400)]
[3.6] bpo-30828: Fix out of bounds write in `asyncio.CFuture.remove_done_callback() (GH-2569) (#2590)

(cherry picked from commit 833a3b0d3707200daeaccdd218e8f18a190284aa)

7 years ago[3.6] bpo-30854: Fix compile error when --without-threads (GH-2581) (#2583)
Masayuki Yamamoto [Wed, 5 Jul 2017 09:24:46 +0000 (18:24 +0900)]
[3.6] bpo-30854: Fix compile error when --without-threads (GH-2581) (#2583)

* bpo-30854: Fix compile error when --without-threads

* bpo-30854: fix news
(cherry picked from commit 0c3116309307ad2c7f8e2d2096612f4ab33cbb62)

7 years ago[3.6] NEWS for 30777 (GH-2576) (#2579)
terryjreedy [Wed, 5 Jul 2017 04:55:59 +0000 (00:55 -0400)]
[3.6] NEWS for 30777 (GH-2576) (#2579)

(cherry picked from commit aaa917f)

7 years ago[3.6] bpo-21624: IDLE -- minor htest fixes (GH-2575) (#2578)
terryjreedy [Wed, 5 Jul 2017 04:55:29 +0000 (00:55 -0400)]
[3.6] bpo-21624: IDLE -- minor htest fixes (GH-2575) (#2578)

(cherry picked from commit 2000150)

7 years ago[3.6] bpo-30777: IDLE: configdialog - add docstrings and improve comments (GH-2440...
terryjreedy [Wed, 5 Jul 2017 04:54:55 +0000 (00:54 -0400)]
[3.6] bpo-30777: IDLE: configdialog - add docstrings and improve comments (GH-2440) (#2577)

Patch by Cheryl Sabella.
(cherry picked from commit 7eb5883)

7 years ago[3.6] bpo-30726: Also fix pyexpat.vcxproj (GH-2375) (#2570)
Segev Finer [Tue, 4 Jul 2017 18:38:47 +0000 (21:38 +0300)]
[3.6] bpo-30726: Also fix pyexpat.vcxproj (GH-2375) (#2570)

(cherry picked from commit 7526cadd64566725ffc56071a7208828a46ddbd8)

7 years agobpo-30319: socket.close() now ignores ECONNRESET (#2565) (#2566)
Victor Stinner [Tue, 4 Jul 2017 14:46:10 +0000 (16:46 +0200)]
bpo-30319: socket.close() now ignores ECONNRESET (#2565) (#2566)

socket.close() was modified in Python 3.6 to raise OSError on
failure: see bpo-26685.
(cherry picked from commit 67e1478dba6efe60b8e1890192014b8b06dd6bd9)

7 years agoRemove outdated FOX from GUI FAQ (GH-2538)
Berker Peksag [Tue, 4 Jul 2017 06:27:35 +0000 (09:27 +0300)]
Remove outdated FOX from GUI FAQ (GH-2538)

FXpy doesn't have a Python 3 port and it only
supports Python 2.2 and older versions.

Reported by Alex Walters on docs@p.o.

(cherry picked from commit d3ed2877a798d07df75422afe136b4727e500c99)

7 years ago[3.6] bpo-30441: Fix bug when modifying os.environ while iterating over it (GH-2409...
Serhiy Storchaka [Tue, 4 Jul 2017 04:55:32 +0000 (07:55 +0300)]
[3.6] bpo-30441: Fix bug when modifying os.environ while iterating over it (GH-2409). (#2556)

(cherry picked from commit 8a8d28501fc8ce25926d168f1c657656c809fd4c)

7 years agobpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539)
Victor Stinner [Mon, 3 Jul 2017 10:50:36 +0000 (12:50 +0200)]
bpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539)

--forever now stops if a fail changes the environment.
(cherry picked from commit 5e87592fd12e0b7c41edc11d4885ed7298d5063b)

7 years ago[3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)
Nick Coghlan [Mon, 3 Jul 2017 07:49:50 +0000 (17:49 +1000)]
[3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)

(cherry picked from commit 3a7f03584ab75afbf5507970711c87042e423bb4)

7 years ago[3.6] bpo-29933: Improve set_write_buffer_limits description (GH-2262) (GH-2532)
Kojo Idrissa [Sun, 2 Jul 2017 02:48:07 +0000 (11:48 +0900)]
[3.6] bpo-29933: Improve set_write_buffer_limits description (GH-2262) (GH-2532)

Improve the description of the high and low parameters for set_write_buffer_limits.
Also fixed a small grammatical issue.
(cherry picked from commit 5200a7c7f9ea65a96330c5f276f4acc6ec70854e)

7 years ago[3.6] bpo-30703: Improve signal delivery (GH-2415) (#2527)
Antoine Pitrou [Sat, 1 Jul 2017 17:12:05 +0000 (19:12 +0200)]
[3.6] bpo-30703: Improve signal delivery (GH-2415) (#2527)

* [3.6] bpo-30703: Improve signal delivery (GH-2415)

* Improve signal delivery

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

* Remove unused function

* Improve comments

* Add stress test

* Adapt for --without-threads

* Add second stress test

* Add NEWS blurb

* Address comments @haypo.
(cherry picked from commit c08177a1ccad2ed0d50898c2731b518c631aed14)

* bpo-30796: Fix failures in signal delivery stress test (#2488)

* bpo-30796: Fix failures in signal delivery stress test

setitimer() can have a poor minimum resolution on some machines,
this would make the test reach its deadline (and a stray signal
could then kill a subsequent test).

* Make sure to clear the itimer after the test

7 years ago[3.6] Fix trivial typo in json module docstring (GH-2274) (#2430)
Mariatta [Sat, 1 Jul 2017 01:15:18 +0000 (18:15 -0700)]
[3.6] Fix trivial typo in json module docstring (GH-2274) (#2430)

(cherry picked from commit 76c567ee27342d76f631a35c8291b715b2a61f3e)

7 years ago[3.6] bpo-29512, bpo-30776: Backport regrtest enhancements from master to 3.6 (#2513)
Victor Stinner [Fri, 30 Jun 2017 15:31:16 +0000 (17:31 +0200)]
[3.6] bpo-29512, bpo-30776: Backport regrtest enhancements from master to 3.6 (#2513)

* bpo-29512: Add test.bisect, bisect failing tests (#2452)

Add a new "python3 -m test.bisect" tool to bisect failing tests.

It can be used to find which test method(s) leak references, leak
files, etc.
(cherry picked from commit 84d9d14a1fa395fbd21262ba195490be25a7b3bc)

* bpo-30776: regrtest: reduce memleak false positive (#2484)

Only report a leak if each run leaks at least one memory block.
(cherry picked from commit beeca6e1e5fd01531b1db7059498b13d07dca525)

7 years agobpo-30280: Cleanup threads in ayncio tests (#2501) (#2511)
Victor Stinner [Fri, 30 Jun 2017 15:20:33 +0000 (17:20 +0200)]
bpo-30280: Cleanup threads in ayncio tests (#2501) (#2511)

* bpo-30280: asyncio now cleans up threads

asyncio base TestCase now uses threading_setup() and
threading_cleanup() of test.support to cleanup threads.

* asyncio: Fix TestBaseSelectorEventLoop cleanup

bpo-30280: TestBaseSelectorEventLoop of
test.test_asyncio.test_selector_events now correctly closes the event
loop: cleanup its executor to not leak threads.

Don't override the close() method of the event loop, only override
the_close_self_pipe() method.

(cherry picked from commit b9030674624c181d6e9047cdb14ad65bb6c84c66)

7 years agobpo-30813: Fix unittest when hunting refleaks (#2502) (#2505)
Victor Stinner [Fri, 30 Jun 2017 11:12:20 +0000 (13:12 +0200)]
bpo-30813: Fix unittest when hunting refleaks (#2502) (#2505)

bpo-11798, bpo-16662, bpo-16935, bpo-30813: Skip
test_discover_with_module_that_raises_SkipTest_on_import() and
test_discover_with_init_module_that_raises_SkipTest_on_import() of
test_unittest when hunting reference leaks using regrtest.
(cherry picked from commit e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3)

7 years agobpo-30812: Fix test_warnings, restore _showwarnmsg (#2504) (#2507)
Victor Stinner [Fri, 30 Jun 2017 11:12:12 +0000 (13:12 +0200)]
bpo-30812: Fix test_warnings, restore _showwarnmsg (#2504) (#2507)

bpo-26568, bpo-30812: Fix test_showwarnmsg_missing(): restore the
attribute after removing it.
(cherry picked from commit 7eebeb8fb84e2a9cb73903a08c59cf1d3b32cee0)

7 years ago[3.6] bpo-30807: signal.setitimer() may disable the timer by mistake (GH-2493) (...
Antoine Pitrou [Fri, 30 Jun 2017 08:54:24 +0000 (10:54 +0200)]
[3.6] bpo-30807: signal.setitimer() may disable the timer by mistake (GH-2493) (#2497)

* bpo-30807: signal.setitimer() may disable the timer by mistake

* Add NEWS blurb
(cherry picked from commit 729780a810bbcb12b245a1b652302a601fc9f6fd)

7 years ago[3.6] bpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests....
terryjreedy [Thu, 29 Jun 2017 23:15:18 +0000 (19:15 -0400)]
[3.6] bpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests. (GH-2283) (#2496)

Split TextViewer class into ViewWindow, ViewFrame, and TextFrame classes so that instances
of the latter two can be placed with other widgets within a multiframe window.
Patch by Cheryl Sabella.
(cherry picked from commit 42bc8be)

7 years ago_winconsoleio: Fix memory leak (#2485)
Victor Stinner [Thu, 29 Jun 2017 08:53:34 +0000 (10:53 +0200)]
_winconsoleio: Fix memory leak (#2485)

Fix memory leak when _winconsoleio tries to open a non-console file:
free the name buffer.

7 years agobpo-30602: Fix refleak in os.spawnv() (#2212) (#2486)
Victor Stinner [Thu, 29 Jun 2017 08:53:22 +0000 (10:53 +0200)]
bpo-30602: Fix refleak in os.spawnv() (#2212) (#2486)

When os.spawnv() fails while handling arguments, free correctly
argvlist: pass lastarg+1 rather than lastarg to free_string_array()
to also free the first item.
(cherry picked from commit 8acb4cf2b3436652568d7a70228b166316181466)

7 years ago[3.6] Clear potential ref cycle between Process and Process target (GH-2470) (#2471)
Antoine Pitrou [Wed, 28 Jun 2017 11:08:20 +0000 (13:08 +0200)]
[3.6] Clear potential ref cycle between Process and Process target (GH-2470) (#2471)

* Clear potential ref cycle between Process and Process target

Besides Process.join() not being called, this was an indirect cause of bpo-30775.
The threading module already does this.

* Add issue reference.
(cherry picked from commit 79d37ae979a65ada0b2ac820279ccc3b1cd41ba6)

7 years ago[3.6] bpo-30775: Fix refleaks in test_multiprocessing (GH-2467) (#2468)
Antoine Pitrou [Wed, 28 Jun 2017 09:49:38 +0000 (11:49 +0200)]
[3.6] bpo-30775: Fix refleaks in test_multiprocessing (GH-2467) (#2468)

Forgetting to call Process.join() can keep some resources alive.
(cherry picked from commit a79f8faccf5e26f55e8b9496ad49d2071b5e299c)

7 years ago[3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462)
Serhiy Storchaka [Wed, 28 Jun 2017 06:27:35 +0000 (09:27 +0300)]
[3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462)

Based on patch by Victor Stinner.

Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)

7 years ago[3.6] bpo-24813: IDLE tagline is Integrated Development and Learning Environment...
terryjreedy [Wed, 28 Jun 2017 03:02:38 +0000 (23:02 -0400)]
[3.6] bpo-24813: IDLE  tagline is Integrated Development and Learning Environment (GH-2451) (#2461)

Patch by Mark Roseman
(cherry picked from commit 592eda1)

7 years ago[3.6] bpo-30723: IDLE -- Enhance parenmatch; add style, flash, and help (GH-2306...
terryjreedy [Wed, 28 Jun 2017 03:02:19 +0000 (23:02 -0400)]
[3.6] bpo-30723: IDLE -- Enhance parenmatch; add style, flash, and help (GH-2306) (#2460)

* Add 'parens' style to highlight both opener and closer.
* Make 'default' style, which is not default, a synonym for 'opener'.
* Make time-delay work the same with all styles.
* Add help for config dialog extensions tab, including parenmatch.
* Add new tests.
Original patch by Charles Wohlganger.
(cherry picked from commit fae2c35)

7 years agoClarification to the `break` statement (GH-2453) (#GH-2457)
regexaurus [Wed, 28 Jun 2017 02:38:22 +0000 (22:38 -0400)]
Clarification to the `break` statement (GH-2453) (#GH-2457)

Clarify that the break statement breaks out of the innermost enclosing for or while loop.
(cherry picked from commit 36fc896740319d2c03aa2054a90a999c162517ef)

7 years agobpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)
Victor Stinner [Wed, 28 Jun 2017 00:28:51 +0000 (02:28 +0200)]
bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455) (#2456)

Free also co_extra->ce_extras, not only co_extra.
(cherry picked from commit 23e7944eba1968bb8432fdc4cc96d4fdd2c1a230)

7 years ago[3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285...
Serhiy Storchaka [Tue, 27 Jun 2017 18:08:58 +0000 (21:08 +0300)]
[3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285) (#2443)

Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5f07ff6aad5802924596b631b707d2a)

7 years ago[3.6] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2441)
Victor Stinner [Tue, 27 Jun 2017 14:04:15 +0000 (16:04 +0200)]
[3.6] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2441)

* bpo-30523: regrtest --list-cases --match (#2401)

* regrtest --list-cases now supports --match and --match-file options.
  Example: ./python -m test --list-cases -m FileTests test_os
* --list-cases now also sets support.verbose to False to prevent
  messages to stdout when loading test modules.
* Add support._match_test() private function.
(cherry picked from commit ace56d583664f855d89d1219ece7c21c2fddcf30)

* bpo-30764: regrtest: add --fail-env-changed option (#2402)

* bpo-30764: regrtest: change exit code on failure

* Exit code 2 if failed tests ("bad")
* Exit code 3 if interrupted

* bpo-30764: regrtest: add --fail-env-changed option

If the option is set, mark a test as failed if it alters the
environment, for example if it creates a file without removing it.

(cherry picked from commit 63f54c68936d648c70ca411661e4208329edcf26)

* bpo-30776: reduce regrtest -R false positives (#2422)

* Change the regrtest --huntrleaks checker to decide if a test file
  leaks or not. Require that each run leaks at least 1 reference.
* Warmup runs are now completely ignored: ignored in the checker test
  and not used anymore to compute the sum.
* Add an unit test for a reference leak.

Example of reference differences previously considered a failure
(leak) and now considered as success (success, no leak):

    [3, 0, 0]
    [0, 1, 0]
    [8, -8, 1]
(cherry picked from commit 48b5c422ffb03affb00c184b9a99e5537be92732)

7 years ago[3.6] bpo-30674: IDLE: add docstrings to grep.py (GH-2213) (#2434)
terryjreedy [Tue, 27 Jun 2017 07:01:58 +0000 (03:01 -0400)]
[3.6] bpo-30674: IDLE: add docstrings to grep.py (GH-2213) (#2434)

Patch by Cheryl Sabella
(cherry picked from commit 65474b9)

7 years ago[3.6] bpo-21519: IDLE basic custom key entry better detects duplicates. (GH-2428...
terryjreedy [Tue, 27 Jun 2017 05:58:18 +0000 (01:58 -0400)]
[3.6] bpo-21519: IDLE basic custom key entry better detects duplicates. (GH-2428) (#2433)

Original patch by Saimadhav Heblikar.
(cherry picked from commit 44913e5)

7 years ago[3.6] bpo-29910: IDLE no longer deletes a character after commenting out a region...
terryjreedy [Tue, 27 Jun 2017 05:53:40 +0000 (01:53 -0400)]
[3.6] bpo-29910: IDLE no longer deletes a character after commenting out a region (GH-825) (#2429)

This happened because shortcut has a class binding and 'break' was not returned.
Fix other potential conflicts between IDLE and default key bindings.

* Add news item

* Update NEWS
(cherry picked from commit 213ce12)

7 years ago[3.6] bpo-30769: Fix reference leak introduced in 77703942c59 (GH-2416) (#2425)
Emily Morehouse [Tue, 27 Jun 2017 04:59:25 +0000 (22:59 -0600)]
[3.6] bpo-30769: Fix reference leak introduced in 77703942c59 (GH-2416) (#2425)

New error condition paths were introduced, which did not decrement
`key2` and `val2` objects.  Therefore, decrement references before
jumping to the error label.

Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
(cherry picked from commit a7874c73c0c729bbec2fd4b077bd0eec276cfff4)

7 years ago[3.6] bpo-24813: IDLE: Add build bitness to About Idle title (GH-2380) (#2426)
terryjreedy [Tue, 27 Jun 2017 03:09:45 +0000 (23:09 -0400)]
[3.6] bpo-24813: IDLE: Add build bitness to About Idle title (GH-2380) (#2426)

Patch by Cheryl Sabella.
(cherry picked from commit 9a02ae3)

7 years ago[3.6] bpo-30728: IDLE: Refactor configdialog to PEP8 names (GH-2307) (#2421)
terryjreedy [Tue, 27 Jun 2017 00:48:39 +0000 (20:48 -0400)]
[3.6] bpo-30728: IDLE: Refactor configdialog to PEP8 names (GH-2307) (#2421)

Also, change '*' in the tkinter import to an explicit list of names.
Patch by Cheryl Sabella.
(cherry picked from commit bac7d33)

7 years agobpo-30764: test_subprocess uses SuppressCrashReport (#2405) (#2410)
Victor Stinner [Mon, 26 Jun 2017 22:00:33 +0000 (00:00 +0200)]
bpo-30764: test_subprocess uses SuppressCrashReport (#2405) (#2410)

bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of
test_subprocess now uses support.SuppressCrashReport() to prevent the
creation of a core dump on FreeBSD.
(cherry picked from commit cdee3f14f7f4c995e7eedb0bf6a67e260c739f7d)

7 years ago[3.6] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (GH...
Antoine Pitrou [Mon, 26 Jun 2017 19:57:28 +0000 (21:57 +0200)]
[3.6] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (GH-2403) (#2418)

* bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to lock

This is especially important if PyThread_acquire_lock() is called reentrantly
(for example from a signal handler).

* Update 2017-06-26-14-29-50.bpo-30765.Q5iBmf.rst

* Avoid core logic when taking the mutex failed
(cherry picked from commit f84ac420c2af98339678744953869cad3c253281)

7 years ago[3.6] bpo-6739: IDLE: Check for valid keybinding in config_keys (GH-2377) (#2397)
terryjreedy [Mon, 26 Jun 2017 05:21:02 +0000 (01:21 -0400)]
[3.6] bpo-6739: IDLE: Check for valid keybinding in config_keys (GH-2377) (#2397)

Verify user-entered key sequences by trying to bind them with tk.
Add tests for all 3 validation functions.
Original patch by G Polo.  Tests added by Cheryl Sabella.
(cherry picked from commit 8c78aa7)

7 years ago[3.6] bpo-30746: Prohibited the '=' character in environment variable names (GH-2382...
Serhiy Storchaka [Sun, 25 Jun 2017 06:49:15 +0000 (09:49 +0300)]
[3.6] bpo-30746: Prohibited the '=' character in environment variable names (GH-2382) (#2391)

in `os.putenv()` and `os.spawn*()`..
(cherry picked from commit 77703942c5997dff00c48f10df1b29b11645624c)

7 years ago[3.6] Check the whitespace of pull requests on Travis (GH-2367) (GH-2386)
Brett Cannon [Sun, 25 Jun 2017 00:59:49 +0000 (17:59 -0700)]
[3.6] Check the whitespace of pull requests on Travis (GH-2367) (GH-2386)

(cherry picked from commit 70cb1875bb5343e31d7268f4b2d231a5fecdf989)

7 years ago[3.6] bpo-30616: Functional API of enum allows to create empty enums. (#2304) (#2324)
Dong-hee Na [Sat, 24 Jun 2017 16:12:20 +0000 (01:12 +0900)]
[3.6] bpo-30616: Functional API of enum allows to create empty enums. (#2304) (#2324)

7 years ago[3.6] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2378)
Serhiy Storchaka [Sat, 24 Jun 2017 13:28:26 +0000 (16:28 +0300)]
[3.6] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2378)

(cherry picked from commit 0ee32c1)

7 years ago[3.6] Fix a typo in a comment in coroutines.py (GH-2267) (GH-2370)
Mariatta [Sat, 24 Jun 2017 05:44:57 +0000 (22:44 -0700)]
[3.6] Fix a typo in a comment in coroutines.py (GH-2267) (GH-2370)

defiend -> defined
(cherry picked from commit cab469245d7635447c5e04fa6ed860b067dfc26b)

7 years ago[3.6] bpo-24813: IDLE: Add default title to help_about (GH-2366) (#2369)
terryjreedy [Sat, 24 Jun 2017 00:19:46 +0000 (20:19 -0400)]
[3.6] bpo-24813: IDLE: Add default title to help_about (GH-2366) (#2369)

Patch by Cheryl Sabella.
(cherry picked from commit 18ede06)

7 years ago[3.6] bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268...
Brett Cannon [Fri, 23 Jun 2017 18:23:36 +0000 (11:23 -0700)]
[3.6] bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268) (#2364)

Bug didn't manifest itself when importing a module with source as .py files are always the first on the search path. The issue only showed up in bytecode-only packages where the calculated file path would be ``__init__.py/__init__.pyc``.

Patch by Alexandru Ardelean.

(cherry picked from commit c38e32a10061a7c6d54e7e53ffabf7af7998f045)

7 years ago[3.6] bpo-30730: Prevent environment variables injection in subprocess on Windows...
Serhiy Storchaka [Fri, 23 Jun 2017 17:17:38 +0000 (20:17 +0300)]
[3.6] bpo-30730: Prevent environment variables injection in subprocess on Windows. (GH-2325) (#2360)

Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)

7 years ago[3.6] bpo-24813: IDLE: Add icon to help_about (GH-2335) (#2359)
terryjreedy [Fri, 23 Jun 2017 16:59:59 +0000 (12:59 -0400)]
[3.6] bpo-24813: IDLE: Add icon to help_about (GH-2335) (#2359)

Patch by Cheryl Sabella
(cherry picked from commit d352d68)

7 years agobpo-30604: Skip CoExtra tests if ctypes is missing (#2356) (#2358)
Victor Stinner [Fri, 23 Jun 2017 13:24:28 +0000 (15:24 +0200)]
bpo-30604: Skip CoExtra tests if ctypes is missing (#2356) (#2358)

(cherry picked from commit a4b091e135ccf345cfafdd8477aef897c5214f82)

7 years ago[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)
Victor Stinner [Fri, 23 Jun 2017 13:21:33 +0000 (15:21 +0200)]
[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)

* bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348)

bpo-30726, bpo-29591: libexpat 2.2.1 of Modules/expat/ now uses
a winconfig.h configuration file which already defines:

* XML_NS
* XML_DTD
* BYTEORDER=1234
* XML_CONTEXT_BYTES=1024
* HAVE_MEMMOVE

Remove these defines from PCbuild/_elementtree.vcxproj to prevent
compiler warnings.

Co-Authored-By: Jeremy Kloth <jeremy.kloth@gmail.com>
(cherry picked from commit c8fb58bd7917151e63398587a7fc2126db7c26de)

* bpo-30726: Fix elementtree warnings on Windows due to expat upgrade (#2319)

* bpo-30726: Fix elementtree warnings on Windows

Caused by usage of `getenv` which should be safe. And a few integer
truncations which should also be ok.

* bpo-30726: Don't ignore libexpat warnings which haypo intends to fix upstream

(cherry picked from commit 87c65550730a8f85ce339ba197bce4fb7e836619)

7 years agobpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357)
Victor Stinner [Fri, 23 Jun 2017 13:21:24 +0000 (15:21 +0200)]
bpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357)

Fix a regression introduced by myself in the commit
526b22657cb18fe79118c2ea68511aca09430c2c.
(cherry picked from commit c8d6ab2e25ff212702d387e516e258b1d8c52910)

7 years ago[3.6] bpo-30727: Fix a race condition in test_threading. (GH-2334) (#2351)
Serhiy Storchaka [Fri, 23 Jun 2017 10:52:06 +0000 (13:52 +0300)]
[3.6] bpo-30727: Fix a race condition in test_threading. (GH-2334) (#2351)

(cherry picked from commit 32cb968)

7 years agofix some reference to Unicode 8 that should be to Unicode 9 (#2346)
Benjamin Peterson [Fri, 23 Jun 2017 06:11:52 +0000 (23:11 -0700)]
fix some reference to Unicode 8 that should be to Unicode 9 (#2346)

7 years ago[3.6] bpo-30709: Improve code example in Descriptor HowTo doc (GH-2339) (GH-2342)
Mariatta [Fri, 23 Jun 2017 04:24:43 +0000 (21:24 -0700)]
[3.6] bpo-30709: Improve code example in Descriptor HowTo doc (GH-2339) (GH-2342)

(cherry picked from commit b066edfb1b268e90ea11f45dd1827f46d7ceec88)

7 years ago[3.6] bpo-30619: Clarify typing.Union documentation (GH-2326) (GH-2337)
Mariatta [Fri, 23 Jun 2017 01:52:57 +0000 (18:52 -0700)]
[3.6] bpo-30619: Clarify typing.Union documentation (GH-2326) (GH-2337)

When a class and its subclass are present, the latter is skipped.
(cherry picked from commit 6580c19bbbe7bc9bc0884699afd69184f523b32e)

7 years agoAdd "Misc/NEWS.d" directory tree for "blurb". GH-2329
larryhastings [Fri, 23 Jun 2017 00:38:47 +0000 (17:38 -0700)]
Add "Misc/NEWS.d" directory tree for "blurb". GH-2329

CPython workflow is changing!  We're going to start using "blurb"
to manage Misc/NEWS entries:
    https://github.com/python/core-workflow
(This will be a big win for release managers, honest.)

This checkin simply populates the "Misc/NEWS.d" subdirectory tree
so that people can start putting their news entries in there.
No other changes (yet).

7 years ago[3.6] Fix typo in idlelib.config_key.py (GH-2322) (#2323)
terryjreedy [Thu, 22 Jun 2017 02:46:07 +0000 (22:46 -0400)]
[3.6] Fix typo in idlelib.config_key.py (GH-2322) (#2323)

(cherry picked from commit a0e911b)

7 years ago[3.6] Fix trivial typo in idlelib/config.py (GH-2309) (#2321)
terryjreedy [Thu, 22 Jun 2017 01:43:47 +0000 (21:43 -0400)]
[3.6] Fix trivial typo in idlelib/config.py (GH-2309) (#2321)

Comceptually -> Conceptually
(cherry picked from commit f3e8209)

7 years agobpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2313)
Victor Stinner [Wed, 21 Jun 2017 14:05:11 +0000 (16:05 +0200)]
bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2313)

New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132313eb651107b179d20218dfe5d4e47f13)

7 years ago[3.6] bpo-29755: Fixed the lgettext() family of functions in the gettext module....
Serhiy Storchaka [Tue, 20 Jun 2017 15:06:35 +0000 (18:06 +0300)]
[3.6] bpo-29755: Fixed the lgettext() family of functions in the gettext module. (GH-2266) (#2297)

They now always return bytes.

Updated the gettext documentation..
(cherry picked from commit 26cb4657bcc9a7adffa95798ececb588dddfeadb)