Commit graph

99522 commits

Author SHA1 Message Date
Victor Stinner b01c574ad6 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
2017-06-28 18:34:42 +02:00
INADA Naoki a8f8d5b4bd 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
2017-06-29 00:31:53 +09:00
Antoine Pitrou 79d37ae979 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
2017-06-28 12:29:08 +02:00
Antoine Pitrou a79f8faccf bpo-30775: Fix refleaks in test_multiprocessing (#2467)
Forgetting to call Process.join() can keep some resources alive.
2017-06-28 11:21:52 +02:00
Serhiy Storchaka ccdc09ed1e Fix compiler warnings on Windows introduced in bpo-13617. (#2464) 2017-06-28 09:55:22 +03:00
Serhiy Storchaka f7eae0adfc [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.
2017-06-28 08:30:06 +03:00
Mark Roseman 592eda1233 bpo-24813: IDLE tagline is Integrated Development and Learning Environment (#2451)
Patch by Mark Roseman
2017-06-27 22:42:10 -04:00
wohlganger fae2c3538e 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.
2017-06-27 22:36:23 -04:00
Victor Stinner 84d9d14a1f 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.
2017-06-28 02:24:41 +02:00
Victor Stinner 23e7944eba bpo-30704, bpo-30604: Fix memleak in code_dealloc() (#2455)
Free also co_extra->ce_extras, not only co_extra.
2017-06-28 02:12:00 +02:00
regexaurus 36fc896740 Clarification to the break statement (GH-2453)
Clarify that the break statement breaks out of the innermost enclosing for or while loop.
2017-06-27 15:40:41 -07:00
Serhiy Storchaka e613e6add5 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.
2017-06-27 16:03:14 +03:00
csabella 65474b9d7a bpo-30674: IDLE: add docstrings to grep.py (#2213)
Patch by Cheryl Sabella
2017-06-27 02:41:08 -04:00
terryjreedy 44913e584b bpo-21519: IDLE basic custom key entry better detects duplicates. (#2428) 2017-06-27 01:23:55 -04:00
Serhiy Storchaka 213ce12adf 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
2017-06-27 00:02:32 -04:00
csabella 9a02ae3d3d bpo-24813: IDLE: Add build bitness to About Idle title (#2380)
Patch by Cheryl Sabella.
2017-06-26 22:28:58 -04:00
Eric N. Vander Weele a7874c73c0 bpo-30769: Fix reference leak introduced in 77703942c5 (#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>
2017-06-27 03:35:20 +02:00
Victor Stinner 48b5c422ff 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]
2017-06-27 02:02:04 +02:00
csabella bac7d3363b 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.
2017-06-26 17:46:26 -04:00
Joel Hillacre b350c22ebc 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.
2017-06-26 17:41:35 -04:00
Antoine Pitrou f84ac420c2 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
2017-06-26 20:41:07 +02:00
Victor Stinner 63f54c6893 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.
2017-06-26 18:33:19 +02:00
Walter Dörwald f5c58c781a bpo-30733: Fix typos in "What's New" entry (GH-2414) 2017-06-26 18:31:52 +02:00
Victor Stinner cdee3f14f7 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.
2017-06-26 17:23:03 +02:00
Victor Stinner ace56d5836 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.
2017-06-26 14:18:51 +02:00
csabella 8c78aa70c8 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.
2017-06-26 00:55:48 -04:00
Serhiy Storchaka af5392f5c6 bpo-30746: Port more tests for os.spawnvpe() and os.execve() from 2.7. (#2394) 2017-06-25 09:48:54 +03:00
Serhiy Storchaka 77703942c5 bpo-30746: Prohibited the '=' character in environment variable names (#2382)
in `os.putenv()` and `os.spawn*()`.
2017-06-25 07:33:01 +03:00
Antoine Pitrou 1ba9469e9f Update make patchcheck for blurb and NEWS.d (#2381) 2017-06-25 11:21:49 +10:00
Brett Cannon 70cb1875bb Check the whitespace of pull requests on Travis (GH-2367) 2017-06-24 16:51:23 -07:00
Antoine Pitrou 13e96cc596 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
2017-06-24 19:22:23 +02:00
Serhiy Storchaka 0ee32c1481 bpo-30745: Fix compiler warnings introduced in bpo-30730. (#2376) 2017-06-24 16:14:08 +03:00
Johan de Jager cab469245d Fix a typo in a comment in coroutines.py (GH-2267)
defiend -> defined
2017-06-23 22:18:54 -07:00
INADA Naoki 870c286e27 bp-29304: Simplify dictobject.c (GH-2347)
replace `(i << 2) + 1` with `i*5`
2017-06-24 09:03:19 +09:00
csabella 18ede06258 bpo-24813: IDLE: Add default title to help_about (#2366)
Patch by Cheryl Sabella.
2017-06-23 20:00:58 -04:00
Victor Stinner 8f525882fa 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)
2017-06-24 01:08:56 +02:00
Adrian Wielgosik 50c2850fc8 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.
2017-06-23 22:35:41 +02:00
Serhiy Storchaka 48fbe52ac7 bpo-30664: The description of a unittest subtest now preserves the (#2265)
order of keyword arguments of TestCase.subTest().
2017-06-23 21:47:39 +03:00
Alexandru Ardelean c38e32a100 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.
2017-06-23 10:35:03 -07:00
Serhiy Storchaka d174d24a5d bpo-30730: Prevent environment variables injection in subprocess on Windows. (#2325)
Prevent passing other invalid environment variables and command arguments.
2017-06-23 19:39:27 +03:00
csabella d352d68977 bpo-24813: IDLE: Add icon to help_about (#2335)
Patch by Cheryl Sabella
2017-06-23 12:00:29 -04:00
Victor Stinner f87b85f808 bpo-21071: struct.Struct.format type is now str (#845) 2017-06-23 15:11:12 +02:00
Victor Stinner a4b091e135 bpo-30604: Skip CoExtra tests if ctypes is missing (#2356) 2017-06-23 15:08:55 +02:00
Victor Stinner c8d6ab2e25 bpo-30602: Fix lastarg in os.spawnve() (#2287)
Fix a regression introduced by myself in the commit
526b22657c.
2017-06-23 15:04:46 +02:00
Segev Finer 87c6555073 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
2017-06-23 12:45:01 +02:00
Serhiy Storchaka 32cb968a2e bpo-30727: Fix a race condition in test_threading. (#2334) 2017-06-23 13:36:36 +03:00
Victor Stinner c8fb58bd79 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>
2017-06-23 10:09:34 +02:00
INADA Naoki 073ae487b3 bpo-29304: simplify lookdict_index() function. (GH-2273) 2017-06-23 15:22:50 +09:00
Benjamin Peterson 279a96206f bpo-30736: upgrade to Unicode 10.0 (#2344)
Straightforward. While we're at it, though, strip trailing whitespace from generated tables.
2017-06-22 22:31:08 -07:00
_ = NaN b066edfb1b bpo-30709: Improve code example in Descriptor HowTo doc (GH-2339) 2017-06-22 20:54:35 -07:00