Commit Graph

98008 Commits

Author SHA1 Message Date
Masayuki Yamamoto e3a0ff0d76 [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 0c31163093)
2017-07-05 11:24:46 +02:00
terryjreedy 0884c40603 [3.6] NEWS for 30777 (GH-2576) (#2579)
(cherry picked from commit aaa917f)
2017-07-05 00:55:59 -04:00
terryjreedy 1278d29000 [3.6] bpo-21624: IDLE -- minor htest fixes (GH-2575) (#2578)
(cherry picked from commit 2000150)
2017-07-05 00:55:29 -04:00
terryjreedy e5bb112ba2 [3.6] bpo-30777: IDLE: configdialog - add docstrings and improve comments (GH-2440) (#2577)
Patch by Cheryl Sabella.
(cherry picked from commit 7eb5883)
2017-07-05 00:54:55 -04:00
Segev Finer d02c8416fe [3.6] bpo-30726: Also fix pyexpat.vcxproj (GH-2375) (#2570)
(cherry picked from commit 7526cadd64)
2017-07-04 20:38:47 +02:00
Victor Stinner 580cd5cd36 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 67e1478dba)
2017-07-04 16:46:10 +02:00
Berker Peksag 23e2c3d193 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 d3ed2877a7)
2017-07-04 09:27:35 +03:00
Serhiy Storchaka bebd2cfa5f [3.6] bpo-30441: Fix bug when modifying os.environ while iterating over it (GH-2409). (#2556)
(cherry picked from commit 8a8d28501f)
2017-07-04 07:55:32 +03:00
Victor Stinner 4132adb4b8 bpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539)
--forever now stops if a fail changes the environment.
(cherry picked from commit 5e87592fd1)
2017-07-03 12:50:36 +02:00
Nick Coghlan bfdc6fdc0e [3.6] bpo-30597: Show expected input in custom 'print' error message. (GH-2531)
(cherry picked from commit 3a7f03584a)
2017-07-03 17:49:50 +10:00
Kojo Idrissa 03af428242 [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 5200a7c7f9)
2017-07-01 19:48:07 -07:00
Antoine Pitrou 3024c05290 [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 c08177a1cc)

* 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
2017-07-01 19:12:05 +02:00
Mariatta 48290c1c30 [3.6] Fix trivial typo in json module docstring (GH-2274) (#2430)
(cherry picked from commit 76c567ee27)
2017-06-30 21:15:18 -04:00
Victor Stinner a3ca94d050 [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 84d9d14a1f)

* 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 beeca6e1e5)
2017-06-30 17:31:16 +02:00
Victor Stinner 23caf8cfc6 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 b903067462)
2017-06-30 17:20:33 +02:00
Victor Stinner 22d4e8fb99 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 e4f9a2d2be)
2017-06-30 13:12:20 +02:00
Victor Stinner d0aac5da59 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 7eebeb8fb8)
2017-06-30 13:12:12 +02:00
Antoine Pitrou 6f3cb059fd [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 729780a810)
2017-06-30 10:54:24 +02:00
terryjreedy 6f31717c47 [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)
2017-06-29 19:15:18 -04:00
Victor Stinner 1d56ed5210 _winconsoleio: Fix memory leak (#2485)
Fix memory leak when _winconsoleio tries to open a non-console file:
free the name buffer.
2017-06-29 10:53:34 +02:00
Victor Stinner b78fbaaeab 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 8acb4cf2b3)
2017-06-29 10:53:22 +02:00
Antoine Pitrou 38d6a40898 [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 79d37ae979)
2017-06-28 13:08:20 +02:00
Antoine Pitrou e022aad73a [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 a79f8faccf)
2017-06-28 11:49:38 +02:00
Serhiy Storchaka 0834905d9b [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 f7eae0adfc)
2017-06-28 09:27:35 +03:00
terryjreedy 413c0a92bc [3.6] bpo-24813: IDLE tagline is Integrated Development and Learning Environment (GH-2451) (#2461)
Patch by Mark Roseman
(cherry picked from commit 592eda1)
2017-06-27 23:02:38 -04:00
terryjreedy af68382f68 [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)
2017-06-27 23:02:19 -04:00
regexaurus c4cc5534fd 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 36fc896740)
2017-06-27 19:38:22 -07:00
Victor Stinner 26daad4ee1 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 23e7944eba)
2017-06-28 02:28:51 +02:00
Serhiy Storchaka 0edffa3073 [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 e613e6add5)
2017-06-27 21:08:58 +03:00
Victor Stinner 35d2ca2b94 [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 ace56d5836)

* 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 63f54c6893)

* 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 48b5c422ff)
2017-06-27 16:04:15 +02:00
terryjreedy 39e501a291 [3.6] bpo-30674: IDLE: add docstrings to grep.py (GH-2213) (#2434)
Patch by Cheryl Sabella
(cherry picked from commit 65474b9)
2017-06-27 03:01:58 -04:00
terryjreedy 93b88e9953 [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)
2017-06-27 01:58:18 -04:00
terryjreedy 8bdc3bd3d6 [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)
2017-06-27 01:53:40 -04:00
Emily Morehouse 2d348f7a72 [3.6] bpo-30769: Fix reference leak introduced in 77703942c5 (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 a7874c73c0)
2017-06-27 07:59:25 +03:00
terryjreedy 8047f02a4b [3.6] bpo-24813: IDLE: Add build bitness to About Idle title (GH-2380) (#2426)
Patch by Cheryl Sabella.
(cherry picked from commit 9a02ae3)
2017-06-26 23:09:45 -04:00
terryjreedy 938e73809d [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)
2017-06-26 20:48:39 -04:00
Victor Stinner 9ad50d9459 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 cdee3f14f7)
2017-06-27 00:00:33 +02:00
Antoine Pitrou 55ab604e3f [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 f84ac420c2)
2017-06-26 21:57:28 +02:00
terryjreedy 64a0c266e7 [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)
2017-06-26 01:21:02 -04:00
Serhiy Storchaka 9c2dc0c58a [3.6] bpo-30746: Prohibited the '=' character in environment variable names (GH-2382) (#2391)
in `os.putenv()` and `os.spawn*()`..
(cherry picked from commit 77703942c5)
2017-06-25 09:49:15 +03:00
Brett Cannon 57ee0c8c9e [3.6] Check the whitespace of pull requests on Travis (GH-2367) (GH-2386)
(cherry picked from commit 70cb1875bb)
2017-06-24 17:59:49 -07:00
Dong-hee Na 504b95047a [3.6] bpo-30616: Functional API of enum allows to create empty enums. (#2304) (#2324) 2017-06-24 09:12:20 -07:00
Serhiy Storchaka 0e1f9e8d3e [3.6] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2378)
(cherry picked from commit 0ee32c1)
2017-06-24 16:28:26 +03:00
Mariatta 20f1029584 [3.6] Fix a typo in a comment in coroutines.py (GH-2267) (GH-2370)
defiend -> defined
(cherry picked from commit cab469245d)
2017-06-23 22:44:57 -07:00
terryjreedy bd570f4211 [3.6] bpo-24813: IDLE: Add default title to help_about (GH-2366) (#2369)
Patch by Cheryl Sabella.
(cherry picked from commit 18ede06)
2017-06-23 20:19:46 -04:00
Brett Cannon 9db3ae045d [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 c38e32a100)
2017-06-23 11:23:36 -07:00
Serhiy Storchaka e7135751b8 [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 d174d24a5d)
2017-06-23 20:17:38 +03:00
terryjreedy 1b7474dedc [3.6] bpo-24813: IDLE: Add icon to help_about (GH-2335) (#2359)
Patch by Cheryl Sabella
(cherry picked from commit d352d68)
2017-06-23 12:59:59 -04:00
Victor Stinner cea2174ab7 bpo-30604: Skip CoExtra tests if ctypes is missing (#2356) (#2358)
(cherry picked from commit a4b091e135)
2017-06-23 15:24:28 +02:00
Victor Stinner d32a059531 [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 c8fb58bd79)

* 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 87c6555073)
2017-06-23 15:21:33 +02:00