Commit Graph

98223 Commits

Author SHA1 Message Date
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
Victor Stinner 33460fa7e0 ttk: fix LabeledScale and OptionMenu destroy() method (#3025) (#3030)
bpo-31135: Call the parent destroy() method even if the used
attribute doesn't exist.

The LabeledScale.destroy() method now also explicitly clears label
and scale attributes to help the garbage collector to destroy all
widgets.
(cherry picked from commit cd7e9c1b67)
2017-08-09 10:48:11 +02:00
Julien Palard e93135dbb2 bpo-31045: Language switch (#2652) (#3023)
* Doc: Indicate the language

* Renaming version_switcher to switchers (to add language_switcher).

* Adding language switch.

* Doc switchers: Enhance readability of regex parsing versions.

* Doc switchers: Desambiguate the need of a replace(/\/+$/g, '') by proper naming.

* Doc switchers: py3k can't reach js, it's redirected server-side by nginx.

* Doc switchers: Examples matching actual regexes.

* Doc switchers: Better fallback on unexisting translated version.

(cherry picked from commit dff9b5f9d6)
2017-08-08 14:13:53 +02:00
Terry Jan Reedy 9d7d928b58 [3.6] bpo-31130: IDLE -- stop leaks in test_configdialog. (GH-3016) (#3018)
Initial patch by Victor Stinner.
(cherry picked from commit 733d0f6)
2017-08-07 15:20:03 -04:00
Terry Jan Reedy b61de2d465 [3.6] bpo-29910: IDLE - revert `break`s that disabled calltip close. (GH-2997) (#3017)
(cherry picked from commit 8922587)
2017-08-07 14:23:07 -04:00
Antoine Pitrou 57e836cb41 [3.6] bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state (GH-2417) (#3007)
* Improve signal delivery

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

* Remove unused function

* Improve comments

* Use _Py_atomic API for concurrency-sensitive signal state

* Add blurb
(cherry picked from commit 2c8a5e4c96)
2017-08-06 19:32:39 +02:00
Rajath Agasthya 9cd0ef8f3b bpo-31029: test_tokenize Add missing import unittest (#2998) 2017-08-05 21:28:17 +03:00
Shane Harvey 4795ba857e [3.6] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989) (#3003)
(cherry picked from commit c4c9866064)
2017-08-05 18:01:10 +03:00
Yuan Chao Chou a0cb7db8e4 Fix a shadow-compatible-local warning (#2181)
Change the shadowing naming, 'value' (Python-ast.c:4686), to 'val'
to prevent the variables from being misused.
2017-08-04 10:53:42 -07:00
Mariatta 9b3abacf87 [3.6] Improve grammar in asyncio documentation (GH-2993) (GH-2994)
"not only is it .." is the correct form, as opposed to:
"not only it is ..."
(cherry picked from commit 87c3c5de73)
2017-08-04 00:33:33 +10:00
Serhiy Storchaka 946a0b69e2 [3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking (GH-2957) (#2991)
when other arguments are passed.
(cherry picked from commit 25e4f77)
2017-08-03 12:14:35 +03:00
Serhiy Storchaka f08b2be441 [3.6] bpo-30978: str.format_map() now passes key lookup exceptions through. (GH-2790) (#2992)
Previously any exception was replaced with a KeyError exception.
(cherry picked from commit 5075416)
2017-08-03 12:14:07 +03:00
INADA Naoki f142e85d22 bpo-31061: fix crash in asyncio speedup module (GH-2984)
(cherry picked from commit de34cbe9cd)
2017-08-02 16:50:39 +09:00
Terry Jan Reedy 48fcc72c83 [3.6] bpo-31083: IDLE: Describe the Page classes in configdialog (GH-2965) (#2973)
Add template as comment. Update existing classes to match outline.
Initial patch by Cheryl Sabella.
(cherry picked from commit 6f446be)
2017-08-01 01:00:33 -04:00
Mariatta f9463b8cc9 Remove .mention-bot (GH-2923) (GH-2970)
(cherry picked from commit e1e60bd95c)
2017-07-31 21:34:36 -07:00
Mariatta 330cdac517 bpo-25910: Update LICENSE (GH-2873) (GH-2967)
Use the copy provided in https://bugs.python.org/issue25910GH-msg295200
(cherry picked from commit 8474d87165)
2017-07-31 19:59:50 -07:00
csabella 2bf1586e60 [3.6] bpo-25684: ttk.OptionMenu radiobuttons weren't unique (GH-2276) (#2959)
between instances of OptionMenu.
(cherry picked from commit a568e52733)

* Update Misc/ACKS
2017-07-31 22:10:13 +03:00
Terry Jan Reedy 8c4e5be1df [3.6] bpo-31050: IDLE: Factor GenPage class from ConfigDialog (GH-2952) (#2955)
The slightly modified tests for the General tab continue to pass.
Patch by Cheryl Sabella.
(cherry picked from commit e8eb17b)
2017-07-30 19:02:51 -04:00
Terry Jan Reedy 7582226a92 [3.6] bpo-31004: IDLE: Factor out FontPage class from configdialog (step 1) (GH-2905) (#2950)
The slightly modified tests continue to pass. The General test
broken by the switch to Notebook is fixed.
Patch mostly by Cheryl Sabella.
(cherry picked from commit 9397e2a)
2017-07-30 15:00:50 -04:00
Terry Jan Reedy c9c85321df [3.6] bpo-30928: Update IDLE News.txt. (GH-2948) (#2949)
(cherry picked from commit c3aa47f655)
2017-07-30 13:35:46 -04:00
Terry Jan Reedy 4c7b368de7 [3.6] bpo-30803: clarify truth value testing documentation (GH-2508) (#2946)
Initial patch by Peter Thomassen.
(cherry picked from commit caa1280)
2017-07-29 18:56:06 -04:00
Terry Jan Reedy b26cc82b22 [3.6] bpo-31027: Fix test_listcomps failure when run directly (GH-2939) (#2945)
Bug appears to be incomplete copy-paste-edit.
(cherry picked from commit ceb93f4)
2017-07-29 14:38:24 -04:00
Terry Jan Reedy 8364feff67 [3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) (#2944)
The notebook looks a bit better.  It will work better with separate page classes. Traversal of widgets by Tab works better.  Switching tabs with keys becomes possible.  The font sample box works better at large font sizes.

One of the two simulated click tests no longer works.  This will be investigated while fixing a bug with the widget itself.
(cherry picked from commit b331f80)
2017-07-29 01:28:05 -04:00
Mariatta e05119ad4e Fix trivial typo in multiprocessing documentation (GH-2930) (GH-2940)
(cherry picked from commit 6fcb69dad5)
2017-07-28 19:55:23 -07:00
Terry Jan Reedy ecc80b3f1b [3.6] bpo-30853: IDLE - touch-up configdialog.VarTrace and tests. (GH-2936) (#2937)
Add clear method for tests.  Adjust tests to use global instance.
Remove unneeded ConfigDialog method.
(cherry picked from commit 5d0f30a)
2017-07-28 18:36:30 -04:00
Terry Jan Reedy 02f88d2a41 [3.6] bpo-30853: IDLE: Convert font and general vars to use VarTrace (GH-2914) (#2935)
Instance tracers manages pairs consisting of a tk variable and a
callback function.  When tracing is turned on, setting the variable
calls the function.  Test coverage for the new class is 100%.
(cherry picked from commit 5b59154)
2017-07-28 15:42:43 -04:00
Terry Jan Reedy 2cbb6733bf [3.6] bpo-31060: IDLE: Finish regrouping ConfigDialog methods (GH-2908) (#2925)
Finish resorting the 72 ConfigDialog methods into 7 groups that represent the dialog, action buttons, and font, highlight, keys, general, and extension pages.  This will help with continuing to add tests and improve the pages. It will enable splitting ConfigDialog into 6 or 7 more comprehensible classes.
(cherry picked from commit b166080)
2017-07-27 20:50:39 -04:00
Victor Stinner 54cb3400e5 bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2917)
There is a bug in FreeBSD CURRENT with 64-bit dev_t. Skip the test if
dev_t is larger than 32-bit, until the bug is fixed in FreeBSD
CURRENT.
(cherry picked from commit 12953ffe12)
2017-07-27 18:42:11 +02:00
Victor Stinner d019c7965d bpo-31028: Fix test_pydoc when run directly (#2864) (#2910)
* bpo-31028: Fix test_pydoc when run directly

Fix get_pydoc_link() of test_pydoc to fix "./python
Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent
relative directories.

* Use realpath() instead of abspath()

(cherry picked from commit fd46561167)
2017-07-27 18:05:46 +02:00
Serhiy Storchaka 95b16a9705 [3.6] bpo-30814, bpo-30876: Add new import test files to projects. (GH-2851). (#2912)
(cherry picked from commit d5ed47dea2)
2017-07-27 13:15:59 +03:00
Terry Jan Reedy 0c4c65104c [3.6] bpo-31003: IDLE - Add more tests for General tab (GH-2859) (#2906)
* In configdialog: Document causal pathways in create_page_general.
Move related functions to follow this. Simplify some attribute names.
* In test_configdialog: Add tests for load and helplist functions.
Coverage for the general tab is now complete, and 63% overall.
(cherry picked from commit 2bc8f0e)
2017-07-26 21:41:26 -04:00
Terry Jan Reedy 0243bea55d [3.6] bpo-30853: IDLE: Factor a VarTrace class from configdialog.ConfigDialog. (GH-2872) (#2903)
The new class manages pairs of tk Variables and trace callbacks.
It is completely covered by new tests.
(cherry picked from commit 45bf723)
2017-07-26 20:53:13 -04:00
Nir Soffer 25de5baf3e bpo-30980: Fix double close in asyncore.file_wrapper (#2789) (#2898)
* bpo-30980: Fix close test to fail

test_close_twice was not considering the fact that file_wrapper is
duping the file descriptor. Closing the original descriptor left the
duped one open, hiding the fact that close protection is not effective.

* bpo-30980: Fix double close protection

Invalidated self.fd before closing, handling correctly the case when
os.close raises.

* bpo-30980: Fix fd leak introduced in the fixed test
2017-07-27 01:27:08 +02:00
Steve Dower bb7fd3f4d0 Fix build batch files (#2750) (#2897)
* Enable building MSI, zip and nuget packages when Py_OutDir is set.

* Restore the --build option, which got reverted at some point.

* Ensure output directory is created.

* Enables BuildForDaily and DailyBuildVersion options for nuget package.
2017-07-26 14:20:41 -07:00
Dong-hee Na 8c2d4cf092 [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214) (#2886) 2017-07-26 14:11:25 +02:00
Utkarsh Upadhyay c52cea4954 [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783) (#2816)
* [3.6] bpo-30822: Fix testing of datetime module. (GH-2530) (GH-2783)

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

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

Only C implementation was tested..
(cherry picked from commit 287c5594ed)
2017-07-26 13:49:16 +02:00
Mariatta 0dbfab2ac7 Add the link to asyncio source code in the docs (GH-2373) (GH-2884)
(cherry picked from commit 627d2c8e8d)
2017-07-25 21:05:17 -07:00
Victor Stinner e42339d3a0 [3.6] bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) (#2881)
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)

multiprocessing.Queue.get() with a timeout now polls its reader in
non-blocking mode if it succeeded to aquire the lock but the acquire
took longer than the timeout.

Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com>
(cherry picked from commit 1b7863c3b6)

* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)

_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.
(cherry picked from commit 8f6eeaf21c)
2017-07-26 05:38:22 +02:00
Victor Stinner a6f045224a bpo-30845: Enhance test_concurrent_futures cleanup (#2564) (#2880)
* 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).

(cherry picked from commit 3df9dec425)
2017-07-26 05:05:09 +02:00
Victor Stinner d0adfb25c5 [3.6] bpo-26762, bpo-31019: Backport multiprocessing fixes from master to 3.6 (#2879)
* bpo-26762: Avoid daemon process in _test_multiprocessing (#2842)

test_level() of _test_multiprocessing._TestLogging now uses regular
processes rather than daemon processes to prevent zombi processes
(to not "leak" processes).
(cherry picked from commit 06634950c5)

* test_multiprocessing: Fix dangling process/thread (#2850)

bpo-26762: Fix more dangling processes and threads in
test_multiprocessing:

* Queue: call close() followed by join_thread()
* Process: call join() or self.addCleanup(p.join)
(cherry picked from commit d7e64d9934)

* test_multiprocessing detects dangling per test case (#2841)

bpo-26762: test_multiprocessing now detects dangling processes and
threads per test case classes:

* setUpClass()/tearDownClass() of mixin classes now check if
  multiprocessing.process._dangling or threading._dangling was
  modified to detect "dangling" processses and threads.
* ManagerMixin.tearDownClass() now also emits a warning if it still
  has more than one active child process after 5 seconds.
* tearDownModule() now checks for dangling processes and threads
  before sleep 500 ms. And it now only sleeps if there is a least one
  dangling process or thread.
(cherry picked from commit ffb49408f0)

* bpo-26762: test_multiprocessing close more queues (#2855)

* Close explicitly queues to make sure that we don't leave dangling
  threads
* test_queue_in_process(): remove unused queue
* test_access() joins also the process to fix a random warning
(cherry picked from commit b4c52966c8)

* bpo-31019: Fix multiprocessing.Process.is_alive() (#2875)

multiprocessing.Process.is_alive() now removes the process from the
_children set if the process completed.

The change prevents leaking "dangling" processes.
(cherry picked from commit 2db64823c2)
2017-07-26 04:48:56 +02:00
Victor Stinner efe9fcbd2c bpo-31034: Reliable signal handler for test_asyncio (#2867) (#2876)
* bpo-31034: Reliable signal handler for test_asyncio

Don't rely on the current SIGHUP signal handler, make sure that it's
set to the "default" signal handler: SIG_DFL.

* Add comments

(cherry picked from commit 830080913c)
2017-07-26 02:33:47 +02:00
Mariatta 59e6ab15e4 bpo-26506: hex() documentation: mention %x % int (GH-2525) (GH-2870)
(cherry picked from commit 67ba4fa467)
2017-07-25 11:04:08 -07:00
Segev Finer d8b5216f99 [3.6] bpo-31018: Switch to GH-pragma pack from __declspec(align) (GH-2848) (#2868)
(cherry picked from commit 39243779f4)
2017-07-25 19:20:38 +02:00
Terry Jan Reedy 548a6889f4 [3.6] Minor typo in curses.rst (GH-2763) (#2853)
I found a tiny typo in the curses how-to: changed 'Thy' to 'The' on line 68.
(cherry picked from commit d439d3e)
2017-07-24 18:54:53 -04:00
Victor Stinner bb33ccfc5a bpo-30908: Fix dangling thread in test_os.TestSendfile (#2680) (#2844)
tearDown() now clears explicitly the self.server variable to make
sure that the thread is completely cleared when tearDownClass()
checks if all threads have been cleaned up.

Fix the following warning:

$ ./python -m test --fail-env-changed -m test.test_os.TestSendfile.test_keywords -R 3:1 test_os
(...)
Warning -- threading_cleanup() failed to cleanup 0 threads after 3 sec (count: 0, dangling: 2)
(...)
Tests result: ENV CHANGED
(cherry picked from commit d1cc037d14)
2017-07-24 17:40:50 +02:00