]> granicus.if.org Git - python/log
python
7 years agobpo-30886: Fix multiprocessing.Queue.join_thread() (#2642)
Victor Stinner [Mon, 10 Jul 2017 10:45:21 +0000 (12:45 +0200)]
bpo-30886: Fix multiprocessing.Queue.join_thread() (#2642)

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)

7 years agoRemove _PyArg_NoStackKeywords(). (#2641)
Serhiy Storchaka [Mon, 10 Jul 2017 08:25:34 +0000 (11:25 +0300)]
Remove _PyArg_NoStackKeywords(). (#2641)

7 years agobpo-30870: IDLE: Change sample font when select by key-up/down (#2617)
Louie Lu [Sun, 9 Jul 2017 22:57:18 +0000 (06:57 +0800)]
bpo-30870: IDLE: Change sample font when select by key-up/down (#2617)

Patch by Louie Lu.

7 years agobpo-30878: Fix error message when keyword arguments are passed (#2635)
Sylvain [Sun, 9 Jul 2017 03:45:06 +0000 (05:45 +0200)]
bpo-30878: Fix error message when keyword arguments are passed (#2635)

to staticmethod() and classmethod().

7 years agobpo-29854: Skip history-size test on older readline (GH-2621)
Nir Soffer [Sat, 8 Jul 2017 14:34:27 +0000 (17:34 +0300)]
bpo-29854: Skip history-size test on older readline (GH-2621)

Turns out that history-size was added in readline 6.0. This explain why
this tests fail on FreeBSD when using readline 5.2. We skip now the
history size if readline does not support it.

See https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES for
details.

7 years agobpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (#2629)
terryjreedy [Sat, 8 Jul 2017 02:28:06 +0000 (22:28 -0400)]
bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (#2629)

7 years agobpo-30779: News (#2627)
terryjreedy [Sat, 8 Jul 2017 00:49:37 +0000 (20:49 -0400)]
bpo-30779: News (#2627)

7 years agobpo-30779: IDLE -- Factor ConfigChanges class from configdialog, put in config; test...
terryjreedy [Fri, 7 Jul 2017 20:00:57 +0000 (16:00 -0400)]
bpo-30779: IDLE -- Factor ConfigChanges class from configdialog, put in config; test. (#2612)

* 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.

7 years agobpo-29854: test_readline logs versions (#2619)
Victor Stinner [Fri, 7 Jul 2017 14:06:58 +0000 (16:06 +0200)]
bpo-29854: test_readline logs versions (#2619)

* test_readline logs the versions of libreadline when run in verbose
  mode
* Add also readline._READLINE_LIBRARY_VERSION

7 years agobpo-29854: Fix segfault in call_readline() (GH-728)
Nir Soffer [Fri, 7 Jul 2017 06:10:46 +0000 (09:10 +0300)]
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 agobpo-30780: Fix error in idlelib.test_idle.test_configdialog (#2606)
terryjreedy [Fri, 7 Jul 2017 02:19:13 +0000 (22:19 -0400)]
bpo-30780: Fix error in idlelib.test_idle.test_configdialog (#2606)

7 years agoMake test_shutil test_disk_usage not depend on the cwd fs (#2597)
Gregory P. Smith [Fri, 7 Jul 2017 00:11:27 +0000 (17:11 -0700)]
Make test_shutil test_disk_usage not depend on the cwd fs (#2597)

Make test_shutil test_disk_usage not depend on the current working directory's filesystem.

7 years agoFix case in .gitignore (GH-2607)
Segev Finer [Thu, 6 Jul 2017 20:43:37 +0000 (23:43 +0300)]
Fix case in .gitignore (GH-2607)

7 years agobpo-26506: hex() documentation: mention %x % int (GH-2525)
Manvisha Kodali [Thu, 6 Jul 2017 19:30:58 +0000 (22:30 +0300)]
bpo-26506: hex() documentation: mention %x % int (GH-2525)

7 years agobpo-30862: Updated Logger.setLevel documentation. (GH-2604)
Vinay Sajip [Thu, 6 Jul 2017 16:51:28 +0000 (17:51 +0100)]
bpo-30862: Updated Logger.setLevel documentation. (GH-2604)

7 years agobpo-30814: Fixed a race condition when import a submodule from a package. (#2580)
Serhiy Storchaka [Thu, 6 Jul 2017 05:09:03 +0000 (08:09 +0300)]
bpo-30814: Fixed a race condition when import a submodule from a package. (#2580)

7 years agoUpdate idlelib/NEWS.txt with merges upto 2017 Jul 5. (#2595)
terryjreedy [Wed, 5 Jul 2017 23:36:48 +0000 (19:36 -0400)]
Update idlelib/NEWS.txt with merges upto 2017 Jul 5. (#2595)

7 years agobpo-30828: Fix out of bounds write in `asyncio.CFuture.remove_done_callback() (#2569)
Yury Selivanov [Wed, 5 Jul 2017 17:32:03 +0000 (13:32 -0400)]
bpo-30828: Fix out of bounds write in `asyncio.CFuture.remove_done_callback() (#2569)

7 years agoRevert "bpo-30822: Fix testing of datetime module." (#2588)
Victor Stinner [Wed, 5 Jul 2017 13:44:52 +0000 (15:44 +0200)]
Revert "bpo-30822: Fix testing of datetime module." (#2588)

* Revert "bpo-30854: Fix compile error when --without-threads (#2581)"

This reverts commit 0c3116309307ad2c7f8e2d2096612f4ab33cbb62.

* Revert "NEWS for 30777 (#2576)"

This reverts commit aaa917ff38f9869eeebe3bc9469bfee64089d826.

* Revert "bpo-21624: IDLE -- minor htest fixes (#2575)"

This reverts commit 2000150c569941584994ec4ec59171961209bec3.

* Revert "bpo-30777: IDLE: configdialog - add docstrings and improve comments (#2440)"

This reverts commit 7eb5883ac59833bf63f0e1f7fb95671a1ac1ee08.

* Revert "bpo-30319: socket.close() now ignores ECONNRESET (#2565)"

This reverts commit 67e1478dba6efe60b8e1890192014b8b06dd6bd9.

* Revert "bpo-30789: Use a single memory block for co_extra. (#2555)"

This reverts commit 378ebb6578b9d709f38b888d23874c0b18125249.

* Revert "bpo-30845: Enhance test_concurrent_futures cleanup (#2564)"

This reverts commit 3df9dec425b0254df1cdf41922fd8d6b08bf47e4.

* Revert "bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` (#2480)"

This reverts commit 48350412b70c76fa51f488cfc736c80d59b5e8eb.

* Revert "Remove outdated FOX from GUI FAQ (GH-2538)"

This reverts commit d3ed2877a798d07df75422afe136b4727e500c99.

* Revert "bpo-6691: Pyclbr now reports nested classes and functions. (#2503)"

This reverts commit 246ff3bd00f97658e567a7087645a6b76e056491.

* Revert "bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)"

This reverts commit 6969eaf4682beb01bc95eeb14f5ce6c01312e297.

* Revert "bpo-30832: Remove own implementation for thread-local storage (#2537)"

This reverts commit aa0aa0492c5fffe750a26d2ab13737a1a6d7d63c.

* Revert "bpo-30764: Fix regrtest --fail-env-changed --forever (#2536)"

This reverts commit 5e87592fd12e0b7c41edc11d4885ed7298d5063b.

* Revert "bpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. (#2534)"

This reverts commit 34b54873b51a1ebee2a3c57b7205537b4f33128d.

* Revert "bpo-30822: Fix testing of datetime module. (#2530)"

This reverts commit 98b6bc3bf72532b784a1c1fa76eaa6026a663e44.

7 years agobpo-30854: Fix compile error when --without-threads (#2581)
Masayuki Yamamoto [Wed, 5 Jul 2017 08:39:17 +0000 (17:39 +0900)]
bpo-30854: Fix compile error when --without-threads (#2581)

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

* bpo-30854: fix news

7 years agoNEWS for 30777 (#2576)
terryjreedy [Wed, 5 Jul 2017 03:00:09 +0000 (23:00 -0400)]
NEWS for 30777 (#2576)

7 years agobpo-21624: IDLE -- minor htest fixes (#2575)
terryjreedy [Wed, 5 Jul 2017 02:41:12 +0000 (22:41 -0400)]
bpo-21624: IDLE -- minor htest fixes (#2575)

7 years agobpo-30777: IDLE: configdialog - add docstrings and improve comments (#2440)
csabella [Wed, 5 Jul 2017 01:30:58 +0000 (21:30 -0400)]
bpo-30777: IDLE: configdialog - add docstrings and improve comments (#2440)

Patch by Cheryl Sabella.

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

socket.close() was modified in Python 3.6 to raise OSError on
failure: see bpo-26685.

7 years agobpo-30789: Use a single memory block for co_extra. (#2555)
Serhiy Storchaka [Tue, 4 Jul 2017 12:06:16 +0000 (15:06 +0300)]
bpo-30789: Use a single memory block for co_extra. (#2555)

* bpo-30789: Use a single memory block for co_extra.

* Address review comments.

7 years agobpo-30845: Enhance test_concurrent_futures cleanup (#2564)
Victor Stinner [Tue, 4 Jul 2017 11:14:04 +0000 (13:14 +0200)]
bpo-30845: Enhance test_concurrent_futures cleanup (#2564)

* bpo-30845: reap_children() now logs warnings

* bpo-30845: Enhance test_concurrent_futures cleanup

In setUp() and tearDown() methods of test_concurrent_futures tests,
make sure that tests don't leak threads nor processes. Clear
explicitly the reference to the executor to make it that it's
destroyed (to prevent "dangling threads" warning).

7 years agobpo-29293: multiprocessing.Condition.notify() lacks parameter `n` (#2480)
Antoine Pitrou [Tue, 4 Jul 2017 06:59:22 +0000 (08:59 +0200)]
bpo-29293: multiprocessing.Condition.notify() lacks parameter `n` (#2480)

* bpo-29293: multiprocessing.Condition.notify() lacks parameter `n`

* Add NEWS blurb

7 years agoRemove outdated FOX from GUI FAQ (GH-2538)
Berker Peksag [Tue, 4 Jul 2017 06:13:10 +0000 (09:13 +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.

7 years agobpo-6691: Pyclbr now reports nested classes and functions. (#2503)
csabella [Tue, 4 Jul 2017 01:31:25 +0000 (21:31 -0400)]
bpo-6691: Pyclbr now reports nested classes and functions. (#2503)

 Original patch by Guilherme Polo.  Revisions by Cheryl Sabella.

7 years agobpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)
Serhiy Storchaka [Mon, 3 Jul 2017 18:20:15 +0000 (21:20 +0300)]
bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)

the bare METH_FASTCALL be used for functions with positional-only
parameters.

7 years agobpo-30832: Remove own implementation for thread-local storage (#2537)
Masayuki Yamamoto [Mon, 3 Jul 2017 11:34:38 +0000 (20:34 +0900)]
bpo-30832: Remove own implementation for thread-local storage (#2537)

* bpo-30832: Remove own implementation for thread-local storage

CPython has provided the own implementation for thread-local storage
(TLS) on Python/thread.c, it's used in the case which a platform has
not supplied native TLS.  However, currently all supported platforms
(NT and pthreads) have provided native TLS and defined the
Py_HAVE_NATIVE_TLS macro with unconditional in any case.

* bpo-30832: replace NT with Windows

* bpo-30832: change to directive chain

* bpo-30832: remove comemnt which making no sense

7 years agobpo-30764: Fix regrtest --fail-env-changed --forever (#2536)
Victor Stinner [Mon, 3 Jul 2017 09:15:58 +0000 (11:15 +0200)]
bpo-30764: Fix regrtest --fail-env-changed --forever (#2536)

--forever now stops if a fail changes the environment.

7 years agobpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. (#2534)
Serhiy Storchaka [Sun, 2 Jul 2017 19:36:12 +0000 (22:36 +0300)]
bpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. (#2534)

7 years agobpo-30822: Fix testing of datetime module. (#2530)
Utkarsh Upadhyay [Sun, 2 Jul 2017 12:46:04 +0000 (14:46 +0200)]
bpo-30822: Fix testing of datetime module. (#2530)

Only C implementation was tested.

7 years agobpo-30441: Fix bug when modifying os.environ while iterating over it (#2409)
Osvaldo Santana Neto [Sat, 1 Jul 2017 17:34:45 +0000 (14:34 -0300)]
bpo-30441: Fix bug when modifying os.environ while iterating over it (#2409)

7 years agobpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406)
xdegaye [Sat, 1 Jul 2017 12:14:45 +0000 (14:14 +0200)]
bpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406)

7 years agoAppVeyor: run tests with --fail-env-changed (#2522)
Victor Stinner [Fri, 30 Jun 2017 22:25:03 +0000 (00:25 +0200)]
AppVeyor: run tests with --fail-env-changed (#2522)

7 years agobpo-30804: fix macOS build with framework enabled. (#2516)
INADA Naoki [Fri, 30 Jun 2017 17:38:02 +0000 (02:38 +0900)]
bpo-30804: fix macOS build with framework enabled. (#2516)

7 years agobpo-30818: test_ftplib calls asyncore.close_all() (#2514)
Victor Stinner [Fri, 30 Jun 2017 15:36:57 +0000 (17:36 +0200)]
bpo-30818: test_ftplib calls asyncore.close_all() (#2514)

Always clear asyncore socket map using
asyncore.close_all(ignore_all=True) in tearDown() method.

This change should fix this warning:

Warning -- asyncore.socket_map was modified by test_ftplib
  Before: {}
  After:  {4: <test.test_ftplib.DummyTLS_FTPServer 127.0.0.1:0 at 0x805feccf0>}

7 years agotest_urllib2_localnet: clear server variable (#2510)
Victor Stinner [Fri, 30 Jun 2017 15:04:48 +0000 (17:04 +0200)]
test_urllib2_localnet: clear server variable (#2510)

Set the server attribute to None in cleanup to avoid dangling
threads.

7 years agobuildbot: pass --fail-env-changed to regrtest (#2509)
Victor Stinner [Fri, 30 Jun 2017 14:44:08 +0000 (16:44 +0200)]
buildbot: pass --fail-env-changed to regrtest (#2509)

Make tests fail if a test altered the environment.

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

bpo-26568, bpo-30812: Fix test_showwarnmsg_missing(): restore the
attribute after removing it.

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

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.

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

* 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.

7 years agothreading_cleanup() failure marks test as ENV_CHANGED (#2500)
Victor Stinner [Fri, 30 Jun 2017 08:59:52 +0000 (10:59 +0200)]
threading_cleanup() failure marks test as ENV_CHANGED (#2500)

If threading_cleanup() fails to cleanup threads, set a a new
support.environment_altered flag to true, flag uses by save_env which
is used by regrtest to check if a test altered the environment. At
the end, the test file fails with ENV_CHANGED instead of SUCCESS, to
report that it altered the environment.

7 years agobpo-30807: signal.setitimer() may disable the timer by mistake (#2493)
Antoine Pitrou [Fri, 30 Jun 2017 08:01:05 +0000 (10:01 +0200)]
bpo-30807: signal.setitimer() may disable the timer by mistake (#2493)

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

* Add NEWS blurb

7 years agobpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests. (#2283)
csabella [Thu, 29 Jun 2017 22:42:17 +0000 (18:42 -0400)]
bpo-30495: IDLE: improve textview with docstrings, PEP8 names, more tests. (#2283)

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.

7 years agobpo-30647: Check nl_langinfo(CODESET) in locale coercion (GH-2374)
Nick Coghlan [Thu, 29 Jun 2017 14:48:14 +0000 (00:48 +1000)]
bpo-30647: Check nl_langinfo(CODESET) in locale coercion (GH-2374)

- On some versions of FreeBSD, setting the "UTF-8" locale
  succeeds, but a subsequent "nl_langinfo(CODESET)" fails
- adding a check for this in the coercion logic means that
  coercion will happen on systems where this check succeeds,
  and will be skipped otherwise
- that way CPython should automatically adapt to changes in
  platform behaviour, rather than needing a new release to
  enable coercion at build time
- this also allows UTF-8 to be re-enabled as a coercion
  target, restoring the locale coercion behaviour on Mac OS X

7 years agobpo-30796: Fix failures in signal delivery stress test (#2488)
Antoine Pitrou [Thu, 29 Jun 2017 14:40:14 +0000 (16:40 +0200)]
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 agobpo-30776: regrtest: reduce memleak false positive (#2484)
Victor Stinner [Thu, 29 Jun 2017 08:32:49 +0000 (10:32 +0200)]
bpo-30776: regrtest: reduce memleak false positive (#2484)

Only report a leak if each run leaks at least one memory block.

7 years agobpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483)
INADA Naoki [Thu, 29 Jun 2017 06:31:38 +0000 (15:31 +0900)]
bpo-29585: Fix sysconfig.get_config_var("PYTHONFRAMEWORK") (GH-2483)

`PYTHONFRAMEWORK` is defined in `Makefile` and it shoulnd't be used
in `pyconfig.h`.

`sysconfig.py --generate-posix-vars` reads config vars from Makefile
and `pyconfig.h`.  Conflicting variables should be avoided.

Especially, string config variables in Makefile are unquoted, but
in `pyconfig.h` are keep quoted.  So it should be private (starts with
underscore).

7 years agobpo-30726: Also fix pyexpat.vcxproj (#2375)
Segev Finer [Wed, 28 Jun 2017 22:18:28 +0000 (01:18 +0300)]
bpo-30726: Also fix pyexpat.vcxproj (#2375)

7 years agobpo-30703: Improve signal delivery (#2415)
Antoine Pitrou [Wed, 28 Jun 2017 21:29:29 +0000 (23:29 +0200)]
bpo-30703: Improve signal delivery (#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

7 years agobpo-23451: Fix socket deprecation warnings in socketmodule.c (#2318)
Segev Finer [Wed, 28 Jun 2017 20:51:00 +0000 (23:51 +0300)]
bpo-23451: Fix socket deprecation warnings in socketmodule.c (#2318)

* bpo-23451: Fix WSASocket and WSADuplicateSocket deprecation warnings

* bpo-23451: Add backwards compatibility note about socket share/fromshare

* bpo-23451: Fixed `WSAAddressToString`/`WSAStringToAddress` deprecation warnings

* bpo-23451: Use `inet_pton`/`inet_ntop` instead of `WSAAddressToString`/`WSAStringToAddress`

* bpo-23451: Move `HAVE_INET_PTON` from _socket.vcxproj to pyconfig.h

* bpo-23451: Add SUPPRESS_DEPRECATED_CALL to socketmodule.c

* bpo-23451: Add a NEWS.d entry

* bpo-23451: Corrected NEWS.d entry

7 years agobpo-30362 : Add list options to launcher. (#1578)
Steve (Gadget) Barnes [Wed, 28 Jun 2017 19:14:52 +0000 (20:14 +0100)]
bpo-30362 : Add list options to launcher. (#1578)

* bpo-30362 Add list options to launcher.

* bpo-30362 Add list options to help message.

* To avoid possible later conflict with python replaced flags with --launcher-list and --launcher-list-paths

* bpo-30362 Changed flag to -0 as suggested on review.

* bpo-30362: Modified to default to not path for -0, -0p to dispaly path and append * to default

* bpo-30362: Modified to display list on required version not found.

* bpo-30362 add --list and --list-paths added back in following review by paul.moore

* bpo-30362 Cleaner handing of -0 & -0p by not calling exit directly per review by @zooba

* bpo-30362: Tidy up and add news & what's new

Removed commented out line of code in PC/launcher.c.
Added the results of using blurb to add details of bpo-30362 & bpo-30291.
Updated Doc/whatsnew/3.7.rst to add a Windows only section covering both tickets.

* bpo-30362 Resolve conflict in Doc/whatsnew/3.7.rst

* bpo-30362:Address Whitespace Issue in Doc\whatsnew\3.7.rst

* Shorten NEWS message for bpo-30362

* Shorten NEWS item for bpo-30291

7 years agobpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h (#2477)
Victor Stinner [Wed, 28 Jun 2017 16:34:42 +0000 (18:34 +0200)]
bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h (#2477)

* bpo-29585: Fix PC/pyconfig.h whitespaces

Run "make patchcheck".

* bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h

* site: Fix path separator in _get_path() on Windows

7 years agobpo-29585: optimize site.py startup time (GH-136)
INADA Naoki [Wed, 28 Jun 2017 15:31:53 +0000 (00:31 +0900)]
bpo-29585: optimize site.py startup time (GH-136)

Avoid importing `sysconfig` from `site` by copying minimum code.
Python startup is 5% faster on Linux and 30% faster on macOS

7 years agoClear potential ref cycle between Process and Process target (#2470)
Antoine Pitrou [Wed, 28 Jun 2017 10:29:08 +0000 (12:29 +0200)]
Clear potential ref cycle between Process and Process target (#2470)

* 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

7 years agobpo-30775: Fix refleaks in test_multiprocessing (#2467)
Antoine Pitrou [Wed, 28 Jun 2017 09:21:52 +0000 (11:21 +0200)]
bpo-30775: Fix refleaks in test_multiprocessing (#2467)

Forgetting to call Process.join() can keep some resources alive.

7 years agoFix compiler warnings on Windows introduced in bpo-13617. (#2464)
Serhiy Storchaka [Wed, 28 Jun 2017 06:55:22 +0000 (09:55 +0300)]
Fix compiler warnings on Windows introduced in bpo-13617. (#2464)

7 years ago[security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)
Serhiy Storchaka [Wed, 28 Jun 2017 05:30:06 +0000 (08:30 +0300)]
[security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)

Based on patch by Victor Stinner.

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

7 years agobpo-24813: IDLE tagline is Integrated Development and Learning Environment (#2451)
Mark Roseman [Wed, 28 Jun 2017 02:42:10 +0000 (19:42 -0700)]
bpo-24813: IDLE  tagline is Integrated Development and Learning Environment (#2451)

Patch by Mark Roseman

7 years agobpo-30723: IDLE -- Enhance parenmatch; add style, flash, and help (#2306)
wohlganger [Wed, 28 Jun 2017 02:36:23 +0000 (21:36 -0500)]
bpo-30723: IDLE -- Enhance parenmatch; add style, flash, and help (#2306)

* 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.

7 years agobpo-29512: Add test.bisect, bisect failing tests (#2452)
Victor Stinner [Wed, 28 Jun 2017 00:24:41 +0000 (02:24 +0200)]
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.

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

Free also co_extra->ce_extras, not only co_extra.

7 years agoClarification to the `break` statement (GH-2453)
regexaurus [Tue, 27 Jun 2017 22:40:41 +0000 (18:40 -0400)]
Clarification to the `break` statement (GH-2453)

Clarify that the break statement breaks out of the innermost enclosing for or while loop.

7 years agobpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (#2285)
Serhiy Storchaka [Tue, 27 Jun 2017 13:03:14 +0000 (16:03 +0300)]
bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (#2285)

Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters.

7 years agobpo-30674: IDLE: add docstrings to grep.py (#2213)
csabella [Tue, 27 Jun 2017 06:41:08 +0000 (02:41 -0400)]
bpo-30674: IDLE: add docstrings to grep.py (#2213)

Patch by Cheryl Sabella

7 years agobpo-21519: IDLE basic custom key entry better detects duplicates. (#2428)
terryjreedy [Tue, 27 Jun 2017 05:23:55 +0000 (01:23 -0400)]
bpo-21519: IDLE basic custom key entry better detects duplicates. (#2428)

7 years agobpo-29910: IDLE no longer deletes a character after commenting out a region (#825)
Serhiy Storchaka [Tue, 27 Jun 2017 04:02:32 +0000 (07:02 +0300)]
bpo-29910: IDLE no longer deletes a character after commenting out a region (#825)

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

7 years agobpo-24813: IDLE: Add build bitness to About Idle title (#2380)
csabella [Tue, 27 Jun 2017 02:28:58 +0000 (22:28 -0400)]
bpo-24813: IDLE: Add build bitness to About Idle title (#2380)

Patch by Cheryl Sabella.

7 years agobpo-30769: Fix reference leak introduced in 77703942c59 (#2416)
Eric N. Vander Weele [Tue, 27 Jun 2017 01:35:20 +0000 (21:35 -0400)]
bpo-30769: Fix reference leak introduced in 77703942c59 (#2416)

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>
7 years agobpo-30776: reduce regrtest -R false positives (#2422)
Victor Stinner [Tue, 27 Jun 2017 00:02:04 +0000 (02:02 +0200)]
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]

7 years agobpo-30728: IDLE: Refactor configdialog to PEP8 names (#2307)
csabella [Mon, 26 Jun 2017 21:46:26 +0000 (17:46 -0400)]
bpo-30728: IDLE: Refactor configdialog to PEP8 names (#2307)

Also, change '*' in the tkinter import to an explicit list of names.
Patch by Cheryl Sabella.

7 years agobpo-30532: Fix whitespace folding in certain cases
Joel Hillacre [Mon, 26 Jun 2017 21:41:35 +0000 (15:41 -0600)]
bpo-30532: Fix whitespace folding in certain cases

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 agobpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (#2403)
Antoine Pitrou [Mon, 26 Jun 2017 18:41:07 +0000 (20:41 +0200)]
bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (#2403)

* 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

7 years agobpo-30764: regrtest: add --fail-env-changed option (#2402)
Victor Stinner [Mon, 26 Jun 2017 16:33:19 +0000 (18:33 +0200)]
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.

7 years agobpo-30733: Fix typos in "What's New" entry (GH-2414)
Walter Dörwald [Mon, 26 Jun 2017 16:31:52 +0000 (18:31 +0200)]
bpo-30733: Fix typos in "What's New" entry (GH-2414)

7 years agobpo-30764: test_subprocess uses SuppressCrashReport (#2405)
Victor Stinner [Mon, 26 Jun 2017 15:23:03 +0000 (17:23 +0200)]
bpo-30764: test_subprocess uses SuppressCrashReport (#2405)

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.

7 years agobpo-30523: regrtest --list-cases --match (#2401)
Victor Stinner [Mon, 26 Jun 2017 12:18:51 +0000 (14:18 +0200)]
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.

7 years agobpo-6739: IDLE: Check for valid keybinding in config_keys (#2377)
csabella [Mon, 26 Jun 2017 04:55:48 +0000 (00:55 -0400)]
bpo-6739: IDLE: Check for valid keybinding in config_keys (#2377)

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.

7 years agobpo-30746: Port more tests for os.spawnvpe() and os.execve() from 2.7. (#2394)
Serhiy Storchaka [Sun, 25 Jun 2017 06:48:54 +0000 (09:48 +0300)]
bpo-30746: Port more tests for os.spawnvpe() and os.execve() from 2.7. (#2394)

7 years agobpo-30746: Prohibited the '=' character in environment variable names (#2382)
Serhiy Storchaka [Sun, 25 Jun 2017 04:33:01 +0000 (07:33 +0300)]
bpo-30746: Prohibited the '=' character in environment variable names (#2382)

in `os.putenv()` and `os.spawn*()`.

7 years agoUpdate `make patchcheck` for blurb and NEWS.d (#2381)
Antoine Pitrou [Sun, 25 Jun 2017 01:21:49 +0000 (03:21 +0200)]
Update `make patchcheck` for blurb and NEWS.d (#2381)

7 years agoCheck the whitespace of pull requests on Travis (GH-2367)
Brett Cannon [Sat, 24 Jun 2017 23:51:23 +0000 (16:51 -0700)]
Check the whitespace of pull requests on Travis (GH-2367)

7 years agoFix bpo-30596: Add close() method to multiprocessing.Process (#2010)
Antoine Pitrou [Sat, 24 Jun 2017 17:22:23 +0000 (19:22 +0200)]
Fix bpo-30596: Add close() method to multiprocessing.Process (#2010)

* Fix bpo-30596: Add close() method to multiprocessing.Process

* Raise ValueError if close() is called before the Process is finished running

* Add docs

* Add NEWS blurb

7 years agobpo-30745: Fix compiler warnings introduced in bpo-30730. (#2376)
Serhiy Storchaka [Sat, 24 Jun 2017 13:14:08 +0000 (16:14 +0300)]
bpo-30745: Fix compiler warnings introduced in bpo-30730. (#2376)

7 years agoFix a typo in a comment in coroutines.py (GH-2267)
Johan de Jager [Sat, 24 Jun 2017 05:18:54 +0000 (07:18 +0200)]
Fix a typo in a comment in coroutines.py (GH-2267)

defiend -> defined

7 years agobp-29304: Simplify dictobject.c (GH-2347)
INADA Naoki [Sat, 24 Jun 2017 00:03:19 +0000 (09:03 +0900)]
bp-29304:  Simplify dictobject.c (GH-2347)

replace `(i << 2) + 1` with `i*5`

7 years agobpo-24813: IDLE: Add default title to help_about (#2366)
csabella [Sat, 24 Jun 2017 00:00:58 +0000 (20:00 -0400)]
bpo-24813: IDLE: Add default title to help_about (#2366)

Patch by Cheryl Sabella.

7 years agobpo-30726: expat: Fix compiler warnings on Windows 64-bit (#2368)
Victor Stinner [Fri, 23 Jun 2017 23:08:56 +0000 (01:08 +0200)]
bpo-30726: expat: Fix compiler warnings on Windows 64-bit (#2368)

Explicitly cast on integer downcasting to fix compiler warnings.

(cherry picked from libexpat commit 788bff7a3baad1983b15b17c29e19e1a1a795c48)

7 years agoTrivial cleanup: remove redundant variable stores in ceval.c (#2012)
Adrian Wielgosik [Fri, 23 Jun 2017 20:35:41 +0000 (13:35 -0700)]
Trivial cleanup: remove redundant variable stores in ceval.c (#2012)

Redundant code leftover from cleanup in #16191: the variable `err` is being written to, even though it wasn't used after that point.

7 years agobpo-30664: The description of a unittest subtest now preserves the (#2265)
Serhiy Storchaka [Fri, 23 Jun 2017 18:47:39 +0000 (21:47 +0300)]
bpo-30664: The description of a unittest subtest now preserves the (#2265)

order of keyword arguments of TestCase.subTest().

7 years agobpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268)
Alexandru Ardelean [Fri, 23 Jun 2017 17:35:03 +0000 (20:35 +0300)]
bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268)

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.

7 years agobpo-30730: Prevent environment variables injection in subprocess on Windows. (#2325)
Serhiy Storchaka [Fri, 23 Jun 2017 16:39:27 +0000 (19:39 +0300)]
bpo-30730: Prevent environment variables injection in subprocess on Windows. (#2325)

Prevent passing other invalid environment variables and command arguments.

7 years agobpo-24813: IDLE: Add icon to help_about (#2335)
csabella [Fri, 23 Jun 2017 16:00:29 +0000 (12:00 -0400)]
bpo-24813: IDLE: Add icon to help_about (#2335)

Patch by Cheryl Sabella

7 years agobpo-21071: struct.Struct.format type is now str (#845)
Victor Stinner [Fri, 23 Jun 2017 13:11:12 +0000 (15:11 +0200)]
bpo-21071: struct.Struct.format type is now str (#845)

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

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

Fix a regression introduced by myself in the commit
526b22657cb18fe79118c2ea68511aca09430c2c.

7 years agobpo-30726: Fix elementtree warnings on Windows due to expat upgrade (#2319)
Segev Finer [Fri, 23 Jun 2017 10:45:01 +0000 (13:45 +0300)]
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