]> granicus.if.org Git - python/log
python
6 years agobpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)
Zackery Spytz [Sun, 24 Mar 2019 02:23:29 +0000 (20:23 -0600)]
bpo-36412: fix a possible crash in dictobject.c's new_dict() (GH-12519)

6 years agobpo-32217: Correct usage of ABI tags in freeze. (GH-4719)
AraHaan [Sat, 23 Mar 2019 16:29:49 +0000 (12:29 -0400)]
bpo-32217: Correct usage of ABI tags in freeze. (GH-4719)

Check for sys.abiflags before using since not all platforms have it defined.

6 years agobpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473)
Inada Naoki [Sat, 23 Mar 2019 12:04:40 +0000 (21:04 +0900)]
bpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473)

We will remove int support from 3.10 or 4.0.

6 years agobpo-23205: IDLE: Add tests and refactor grep's findfiles (GH-12203)
Cheryl Sabella [Sat, 23 Mar 2019 11:33:42 +0000 (07:33 -0400)]
bpo-23205: IDLE: Add tests and refactor grep's findfiles (GH-12203)

* Add tests for grep findfiles.
* Move findfiles to module function.
* Change findfiles to use os.walk.

Based on a patch by Al Sweigart.

6 years agobpo-36301: Add _PyRuntimeState.preconfig (GH-12506)
Victor Stinner [Sat, 23 Mar 2019 11:05:43 +0000 (12:05 +0100)]
bpo-36301: Add _PyRuntimeState.preconfig (GH-12506)

_PyPreConfig_Write() now writes the applied pre-configuration into
_PyRuntimeState.preconfig.

6 years agobpo-36405: Use dict unpacking in idlelib (#12507)
Terry Jan Reedy [Sat, 23 Mar 2019 07:50:15 +0000 (03:50 -0400)]
bpo-36405: Use dict unpacking in idlelib (#12507)

Remove now unneeded imports.

6 years agobpo-33319: Clarify subprocess call docs. (GH-12508)
Gregory P. Smith [Sat, 23 Mar 2019 07:40:28 +0000 (00:40 -0700)]
bpo-33319: Clarify subprocess call docs. (GH-12508)

Clarify capturing or suppressing stdout and stderr on the old call APIs.

Do not state that they are equivalent to run() calls when they are not implemented using run as that was misleading. Unlike run they cannot handle stdout or stderr being set to PIPE without a risk of deadlock.

6 years agoFix typo in doc for pprint.pp (GH-12500)
Xavier GUIHOT [Sat, 23 Mar 2019 01:17:29 +0000 (01:17 +0000)]
Fix typo in doc for pprint.pp (GH-12500)

6 years agobpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)
Terry Jan Reedy [Fri, 22 Mar 2019 22:23:41 +0000 (18:23 -0400)]
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)

This param was only used once and changed the return type.

6 years agobpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be found (GH-12358)
Brett Cannon [Fri, 22 Mar 2019 22:16:50 +0000 (15:16 -0700)]
bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be found (GH-12358)

Before, an `AttributeError` was raised due to trying to access an attribute that exists on specs but having received `None` instead for a non-existent module.

https://bugs.python.org/issue36298

6 years agobpo-35155: clarify protocol handler method naming (GH-10313)
Denton Liu [Fri, 22 Mar 2019 21:49:55 +0000 (14:49 -0700)]
bpo-35155: clarify protocol handler method naming (GH-10313)

Clarify that the naming of protocol handler methods shouldn't be literally called "protocol" but should be named after the actual protocol.

https://bugs.python.org/issue35155

6 years agobpo-30670: Add pp function to the pprint module (GH-11769)
Rémi Lapeyre [Fri, 22 Mar 2019 17:22:20 +0000 (18:22 +0100)]
bpo-30670: Add pp function to the pprint module (GH-11769)

6 years agoasyncio: PendingDeprecationWarning -> DeprecationWarning (GH-12494)
Inada Naoki [Fri, 22 Mar 2019 11:07:32 +0000 (20:07 +0900)]
asyncio: PendingDeprecationWarning -> DeprecationWarning (GH-12494)

`Task.current_task()` and `Task.all_tasks()` will be removed in 3.9.

6 years agobpo-21269: Provide args and kwargs attributes on mock call objects GH11807
Kumar Akshay [Fri, 22 Mar 2019 08:10:40 +0000 (13:40 +0530)]
bpo-21269: Provide args and kwargs attributes on mock call objects GH11807

6 years agoRaise the timeout in test_multiprocessing_* for slow buildbots (GH-12489)
Pablo Galindo [Fri, 22 Mar 2019 07:36:56 +0000 (07:36 +0000)]
Raise the timeout in test_multiprocessing_* for slow buildbots (GH-12489)

6 years agobpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625)
Zackery Spytz [Fri, 22 Mar 2019 07:30:32 +0000 (01:30 -0600)]
bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625)

compiler_call() needs to check if an error occurred during the
maybe_optimize_method_call() call.

6 years agobpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)
Zackery Spytz [Fri, 22 Mar 2019 07:24:34 +0000 (01:24 -0600)]
bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)

If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(),
_PyUnicodeWriter_Dealloc() will be called on an uninitialized
_PyUnicodeWriter.

6 years agobpo-36256: Fix bug in parsermodule when parsing if statements (GH-12477)
Pablo Galindo [Thu, 21 Mar 2019 23:33:02 +0000 (23:33 +0000)]
bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12477)

bpo-36256: Fix bug in parsermodule when parsing if statements

In the parser module, when validating nodes before starting the parsing with to create a ST in "parser_newstobject" there is a problem that appears when two arcs in the same DFA state has transitions with labels with the same type. For example, the DFA for if_stmt has a state with
two labels with the same type: "elif" and "else" (type NAME). The algorithm tries one by one the arcs until the label that starts the arc transition has a label with the same type of the current child label we are trying to accept. In this case, the arc for "elif" comes before the arc for "else"and passes this test (because the current child label is "else" and has the same type as "elif"). This lead to expecting a namedexpr_test (305) instead of a colon (11). The solution is to compare also the string representation (in case there is one) of the labels to see if the transition that we have is the correct one.

6 years agoFix registry key for Windows SDK detection (GH-12445)
Isuru Fernando [Thu, 21 Mar 2019 17:52:57 +0000 (12:52 -0500)]
Fix registry key for Windows SDK detection (GH-12445)

6 years agobpo-35978: Correctly skips venv tests in venvs (GH-12220)
Steve Dower [Thu, 21 Mar 2019 17:04:21 +0000 (10:04 -0700)]
bpo-35978: Correctly skips venv tests in venvs (GH-12220)

Also fixes venvs from the build directory on Windows.

6 years agobpo-36245: Avoid problems when building in a directory containing spaces. (GH-12241)
Jess [Thu, 21 Mar 2019 16:02:59 +0000 (09:02 -0700)]
bpo-36245: Avoid problems when building in a directory containing spaces. (GH-12241)

6 years agoFix table formatting in itertools doc (GH-12228)
Benedikt Werner [Thu, 21 Mar 2019 15:28:49 +0000 (16:28 +0100)]
Fix table formatting in itertools doc (GH-12228)

6 years agobpo-36268: Change default tar format to pax from GNU. (GH-12355)
CAM Gerlach [Thu, 21 Mar 2019 14:44:51 +0000 (09:44 -0500)]
bpo-36268: Change default tar format to pax from GNU. (GH-12355)

6 years agobpo-36385: Add ``elif`` sentence on to avoid multiple ``if`` (GH-12478)
Emmanuel Arias [Thu, 21 Mar 2019 04:39:17 +0000 (01:39 -0300)]
bpo-36385: Add ``elif`` sentence on to avoid multiple ``if`` (GH-12478)

Currently, when arguments on Parser/asdl_c.py are parsed
``ìf`` sentence is used. This PR Propose to use ``elif``
to avoid multiple evaluting of the ifs.

https://bugs.python.org/issue36385

6 years agobpo-36324: NormalDist() add more tests and update comments (GH-12476)
Raymond Hettinger [Wed, 20 Mar 2019 20:28:59 +0000 (13:28 -0700)]
bpo-36324: NormalDist() add more tests and update comments (GH-12476)

* Improve coverage.
* Note inherent limitations of the accuracy tests

https://bugs.python.org/issue36324

6 years agobpo-36285: Fix integer overflow in the array module. (GH-12317)
sth [Wed, 20 Mar 2019 19:49:39 +0000 (20:49 +0100)]
bpo-36285: Fix integer overflow in the array module. (GH-12317)

6 years agobpo-36312: Fix decoders for some code pages. (GH-12369)
Serhiy Storchaka [Wed, 20 Mar 2019 19:45:18 +0000 (21:45 +0200)]
bpo-36312: Fix decoders for some code pages. (GH-12369)

6 years agobpo-8677: use PY_DWORD_MAX instead of INT_MAX (GH-12469)
Inada Naoki [Wed, 20 Mar 2019 11:53:08 +0000 (20:53 +0900)]
bpo-8677: use PY_DWORD_MAX instead of INT_MAX (GH-12469)

6 years agobpo-8677: use PY_SSIZE_T_CLEAN in PC/winreg.c (GH-12466)
Inada Naoki [Wed, 20 Mar 2019 10:10:17 +0000 (19:10 +0900)]
bpo-8677: use PY_SSIZE_T_CLEAN in PC/winreg.c (GH-12466)

6 years agobpo-8677: use PY_SSIZE_T_CLEAN in socketmodule.c (GH-12467)
Inada Naoki [Wed, 20 Mar 2019 10:02:46 +0000 (19:02 +0900)]
bpo-8677: use PY_SSIZE_T_CLEAN in socketmodule.c (GH-12467)

6 years agobpo-8677: use PY_SSIZE_T_CLEAN in Modules/_gdbmodule.c (GH-12464)
Inada Naoki [Wed, 20 Mar 2019 10:01:55 +0000 (19:01 +0900)]
bpo-8677: use PY_SSIZE_T_CLEAN in Modules/_gdbmodule.c (GH-12464)

6 years agobpo-36374: Fix a possible null pointer dereference (GH-12449)
Zackery Spytz [Wed, 20 Mar 2019 09:16:25 +0000 (03:16 -0600)]
bpo-36374: Fix a possible null pointer dereference (GH-12449)

https://bugs.python.org/issue36374

6 years agobpo-36301: Add _PyPreCmdline internal API (GH-12458)
Victor Stinner [Wed, 20 Mar 2019 03:25:38 +0000 (04:25 +0100)]
bpo-36301: Add _PyPreCmdline internal API (GH-12458)

_PyCoreConfig_ReadFromArgv() now reuses the code parsing command line
options from preconfig.c.

6 years agobpo-23984: Improve descriptor documentation (GH-1034)
Shubham Aggarwal [Wed, 20 Mar 2019 02:55:55 +0000 (08:25 +0530)]
bpo-23984: Improve descriptor documentation (GH-1034)

https://bugs.python.org/issue23984

6 years agobpo-36356: Fix _PyCoreConfig_Read() (GH-12454)
Victor Stinner [Wed, 20 Mar 2019 02:11:38 +0000 (03:11 +0100)]
bpo-36356: Fix _PyCoreConfig_Read() (GH-12454)

Don't override parameters which are already set by the user.

6 years agobpo-36301: Add _PyRuntime.pre_initialized (GH-12457)
Victor Stinner [Wed, 20 Mar 2019 01:20:13 +0000 (02:20 +0100)]
bpo-36301: Add _PyRuntime.pre_initialized (GH-12457)

* Add _PyRuntime.pre_initialized: set to 1 when Python
  is pre-initialized
* Add _Py_PreInitialize() and _Py_PreInitializeFromPreConfig().
* _PyCoreConfig_Read() now calls  _Py_PreInitialize().
* Move _PyPreConfig_GetGlobalConfig() and
  _PyCoreConfig_GetGlobalConfig() calls from main.c to preconfig.c
  and coreconfig.c.

6 years agobpo-36362: Avoid unused variables when HAVE_DYNAMIC_LOADING is not defined (GH-12430)
Stéphane Wirtel [Tue, 19 Mar 2019 23:37:20 +0000 (00:37 +0100)]
bpo-36362: Avoid unused variables when HAVE_DYNAMIC_LOADING is not defined (GH-12430)

https://bugs.python.org/issue36362

6 years agobpo-36365: Rewrite structseq_repr() using _PyUnicodeWriter (GH-12440)
Victor Stinner [Tue, 19 Mar 2019 23:05:51 +0000 (00:05 +0100)]
bpo-36365: Rewrite structseq_repr() using _PyUnicodeWriter (GH-12440)

No longer limit repr(structseq) to 512 bytes. Use _PyUnicodeWriter
for better performance and to write directly Unicode rather than
encoding repr() value to UTF-8 and then decoding from UTF-8.

6 years agobpo-35388: Fix _PyRuntime_Finalize() (GH-12443)
Victor Stinner [Tue, 19 Mar 2019 23:03:01 +0000 (00:03 +0100)]
bpo-35388: Fix _PyRuntime_Finalize() (GH-12443)

Calling _PyRuntime_Initialize() after _PyRuntime_Finalize() now re-initializes
_PyRuntime structure. Previously, _PyRuntime_Initialize() did
nothing in that case.

6 years agobpo-36324: Improved code formatting for the NormalDist.inv_cdf rational approximation...
Raymond Hettinger [Tue, 19 Mar 2019 21:29:13 +0000 (14:29 -0700)]
bpo-36324: Improved code formatting for the NormalDist.inv_cdf rational approximation (GH-12448)

https://bugs.python.org/issue36324

6 years agoNormalDist.inv_cdf(): In-line constants because the variable names were not informati...
Raymond Hettinger [Tue, 19 Mar 2019 19:48:04 +0000 (12:48 -0700)]
NormalDist.inv_cdf(): In-line constants because the variable names were not informative (GH-12446)

6 years agobpo-36236: Fix _PyPathConfig_ComputeSysPath0() for empty argv (GH-12441)
Victor Stinner [Tue, 19 Mar 2019 17:22:55 +0000 (18:22 +0100)]
bpo-36236: Fix _PyPathConfig_ComputeSysPath0() for empty argv (GH-12441)

* _PyPathConfig_ComputeSysPath0() now returns 0 if argv is empty.
* Cleanup also _PyPathConfig_ComputeSysPath0() code: move variables
  definitions closer to where they are used.

6 years agobpo-36367: Free buffer if realloc fails in tokenize.c (GH-12442)
Pablo Galindo [Tue, 19 Mar 2019 17:17:58 +0000 (17:17 +0000)]
bpo-36367: Free buffer if realloc fails in tokenize.c (GH-12442)

6 years agobpo-36236: Handle removed cwd at Python init (GH-12424)
Victor Stinner [Tue, 19 Mar 2019 15:09:27 +0000 (16:09 +0100)]
bpo-36236: Handle removed cwd at Python init (GH-12424)

At Python initialization, the current directory is no longer
prepended to sys.path if it has been removed.

Rename _PyPathConfig_ComputeArgv0() to
_PyPathConfig_ComputeSysPath0() to avoid confusion between argv[0]
and sys.path[0].

6 years agobpo-36356: pymain_free() calls _PyRuntime_Finalize() (GH-12435)
Victor Stinner [Tue, 19 Mar 2019 13:53:58 +0000 (14:53 +0100)]
bpo-36356: pymain_free() calls _PyRuntime_Finalize() (GH-12435)

Ensure that _PyRuntime_Finalize() is always call. This change fix a
few memory leaks when running "python3 -V".

6 years agobpo-36356: Release Unicode interned strings on Valgrind (#12431)
Victor Stinner [Tue, 19 Mar 2019 13:20:29 +0000 (14:20 +0100)]
bpo-36356: Release Unicode interned strings on Valgrind (#12431)

When Python is compiled with Valgrind support, release Unicode
interned strings at exit in _PyUnicode_Fini().

* Rename _Py_ReleaseInternedUnicodeStrings() to
  unicode_release_interned() and make it private.
* unicode_release_interned() is now called from _PyUnicode_Fini():
  it must be called with a running Python thread state for TRASHCAN,
  it cannot be called from pymain_free().
* Don't display statistics on interned strings at exit anymore

6 years agobpo-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)
Victor Stinner [Tue, 19 Mar 2019 13:19:38 +0000 (14:19 +0100)]
bpo-36333, bpo-36356: Fix _PyEval_FiniThreads() (GH-12432)

_PyEval_FiniThreads() now free the pending lock.

6 years agobpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434)
Inada Naoki [Tue, 19 Mar 2019 13:10:18 +0000 (22:10 +0900)]
bpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434)

Modules/_sqlite/cursor.c uses "y#" format.
It didn't declare PY_SSIZE_T_CLEAN, but the argument is Py_ssize_t already.

6 years agobpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)
Stéphane Wirtel [Tue, 19 Mar 2019 10:51:32 +0000 (11:51 +0100)]
bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)

6 years agobpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)
btharper [Tue, 19 Mar 2019 10:50:25 +0000 (06:50 -0400)]
bpo-36356: Fix memory leak in _PyPreConfig_Read() (GH-12425)

_PyPreConfig_Read() now free 'old_old' at exit.

6 years agoAdd docstrings to the arithmetic methods in NormalDist() (GH-12426)
Raymond Hettinger [Tue, 19 Mar 2019 05:24:15 +0000 (22:24 -0700)]
Add docstrings to the arithmetic methods in NormalDist() (GH-12426)

6 years agobpo-36324: Add inv_cdf() to statistics.NormalDist() (GH-12377)
Raymond Hettinger [Tue, 19 Mar 2019 03:17:14 +0000 (20:17 -0700)]
bpo-36324: Add inv_cdf() to statistics.NormalDist() (GH-12377)

6 years agobpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)
Victor Stinner [Tue, 19 Mar 2019 01:58:14 +0000 (02:58 +0100)]
bpo-36352: Avoid hardcoded MAXPATHLEN size in getpath.c (GH-12423)

* Use Py_ARRAY_LENGTH() rather than hardcoded MAXPATHLEN in getpath.c.
* Pass string length to functions modifying strings.

6 years agobpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)
Victor Stinner [Tue, 19 Mar 2019 00:46:25 +0000 (01:46 +0100)]
bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)

Python initialization now fails if decoding pybuilddir.txt
configuration file fails at startup.

_PyPathConfig_Calculate() now reports memory allocation failure and
decoding error on decoding pybuilddir.txt content from
UTF-8/surrogateescape.

6 years agobpo-36352: Add error handling to getpath.c (GH-12421)
Victor Stinner [Mon, 18 Mar 2019 22:54:59 +0000 (23:54 +0100)]
bpo-36352: Add error handling to getpath.c (GH-12421)

Replace Py_FatalError() with _PyInitError to let the caller handle
the fatal error.

6 years agobpo-36301: Fix Py_Main() memory leaks (GH-12420)
Victor Stinner [Mon, 18 Mar 2019 21:24:28 +0000 (22:24 +0100)]
bpo-36301: Fix Py_Main() memory leaks (GH-12420)

bpo-36301, bpo-36333:

* Fix memory allocator used by _PyPathConfig_ClearGlobal():
  force the default allocator.
* _PyPreConfig_ReadFromArgv(): free init_ctype_locale memory.
* pymain_main(): call pymain_free() on init error

Co-Authored-By: Stéphane Wirtel <stephane@wirtel.be>
6 years agobpo-36292: Mark unreachable code as such in long bitwise ops (GH-12333)
stratakis [Mon, 18 Mar 2019 17:59:20 +0000 (18:59 +0100)]
bpo-36292:  Mark unreachable code as such in long bitwise ops (GH-12333)

6 years agobpo-36320: Switch typing.NamedTuple from OrderedDict to regular dict (GH-12396)
Raymond Hettinger [Mon, 18 Mar 2019 16:53:56 +0000 (09:53 -0700)]
bpo-36320: Switch typing.NamedTuple from OrderedDict to regular dict (GH-12396)

Also,  deprecate the *_field_types* attributes which duplicated the information in *\__annotations__*.

https://bugs.python.org/issue36320

6 years agobpo-36352: Clarify fileutils.h documentation (GH-12406)
Victor Stinner [Mon, 18 Mar 2019 16:47:26 +0000 (17:47 +0100)]
bpo-36352: Clarify fileutils.h documentation (GH-12406)

The last parameter of _Py_wreadlink(), _Py_wrealpath() and
_Py_wgetcwd() is a length, not a size: number of characters including
the trailing NUL character.

Enhance also documentation of error conditions.

6 years agobpo-36235: Enhance distutils test_customize_compiler() (GH-12403)
Victor Stinner [Mon, 18 Mar 2019 16:19:02 +0000 (17:19 +0100)]
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403)

The test test_customize_compiler() now mocks all sysconfig variables
and all environment variables used by customize_compiler().

6 years agobpo-36328: Fix compiler warning in Py_NewInterpreter() (GH-12381)
Stéphane Wirtel [Mon, 18 Mar 2019 16:10:29 +0000 (17:10 +0100)]
bpo-36328: Fix compiler warning in Py_NewInterpreter() (GH-12381)

6 years agobpo-36332: Allow compile() to handle AST objects with assignment expressions (GH...
Pablo Galindo [Mon, 18 Mar 2019 13:51:53 +0000 (13:51 +0000)]
bpo-36332: Allow compile() to handle AST objects with assignment expressions (GH-12398)

6 years agobpo-30040: optimize inserting into empty dict (GH-12307)
Inada Naoki [Mon, 18 Mar 2019 11:38:33 +0000 (20:38 +0900)]
bpo-30040: optimize inserting into empty dict (GH-12307)

6 years agobpo-36329: Declare the version of Python to use for Tools/scripts/serve.py (#12385)
Stéphane Wirtel [Mon, 18 Mar 2019 10:47:55 +0000 (11:47 +0100)]
bpo-36329: Declare the version of Python to use for Tools/scripts/serve.py (#12385)

* bpo-36329: Declare the version of Python to use for Tools/scripts/serve.py

* Add the blurb entry

6 years agobpo-36307: Travis: upgrade to Xenial environment (GH-12356)
CAM Gerlach [Mon, 18 Mar 2019 10:44:58 +0000 (05:44 -0500)]
bpo-36307: Travis: upgrade to Xenial environment (GH-12356)

6 years agoFix typo in _PyObject_FastCallDict documentation (GH-12383)
Rémi Lapeyre [Mon, 18 Mar 2019 10:07:53 +0000 (11:07 +0100)]
Fix typo in _PyObject_FastCallDict documentation (GH-12383)

6 years agobpo-36321: Fix misspelled attribute in namedtuple() (GH-12375)
Raymond Hettinger [Mon, 18 Mar 2019 07:27:39 +0000 (00:27 -0700)]
bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375)

6 years agobpo-36297: remove "unicode_internal" codec (GH-12342)
Inada Naoki [Mon, 18 Mar 2019 06:44:11 +0000 (15:44 +0900)]
bpo-36297: remove "unicode_internal" codec (GH-12342)

6 years agoFix "catchs" typos in NEWS entries (GH-12364)
Harmon [Sun, 17 Mar 2019 23:48:21 +0000 (18:48 -0500)]
Fix "catchs" typos in NEWS entries (GH-12364)

6 years agoFix typo in unittest.mock documentation: manger -> manager (GH-12352)
Joan Massich [Sun, 17 Mar 2019 23:34:22 +0000 (00:34 +0100)]
Fix typo in unittest.mock documentation: manger -> manager (GH-12352)

6 years agobpo-34745: Fix asyncio sslproto memory issues (GH-12386)
Fantix King [Sun, 17 Mar 2019 22:51:10 +0000 (17:51 -0500)]
bpo-34745: Fix asyncio sslproto memory issues (GH-12386)

* Fix handshake timeout leak in asyncio/sslproto

Refs MagicStack/uvloop#222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry

6 years agobpo-34160: Update news entry for XML order attributes (#12335)
Diego Rojas [Sat, 16 Mar 2019 23:44:56 +0000 (18:44 -0500)]
bpo-34160: Update news entry for XML order attributes (#12335)

6 years agobpo-23216: IDLE: Add docstrings to search modules (GH-12141)
Cheryl Sabella [Sat, 16 Mar 2019 23:29:33 +0000 (19:29 -0400)]
bpo-23216: IDLE: Add docstrings to search modules (GH-12141)

6 years agobpo-35493: Use Process.sentinel instead of sleeping for polling worker status in...
Pablo Galindo [Sat, 16 Mar 2019 22:34:24 +0000 (22:34 +0000)]
bpo-35493: Use Process.sentinel instead of sleeping for polling worker status in multiprocessing.Pool (#11488)

* bpo-35493: Use Process.sentinel instead of sleeping for polling worker status in multiprocessing.Pool

* Use self-pipe pattern to avoid polling for changes

* Refactor some variable names and add comments

* Restore timeout and poll

* Use reader object only on wait()

* Recompute worker sentinels every time

* Remove timeout and use change notifier

* Refactor some methods to be overloaded by the ThreadPool, document the cache class and fix typos

6 years agobpo-35715: Liberate return value of _process_worker (GH-11514)
Dave Chevell [Sat, 16 Mar 2019 22:28:51 +0000 (09:28 +1100)]
bpo-35715: Liberate return value of _process_worker (GH-11514)

ProcessPoolExecutor workers will hold the return value of their last task in memory until the next task is received. Since the return value has already been propagated to the parent process's Future (or has been discarded by this point), the object can be safely released.

6 years agoUpdate the seealso entries for namedtuple() (GH-12373)
Raymond Hettinger [Sat, 16 Mar 2019 19:53:23 +0000 (12:53 -0700)]
Update the seealso entries for namedtuple() (GH-12373)

* Replace external recipe link with a link to the dataclasses module.

* Highlight the class definition syntax for typing.NamedTuple
  and add an example for clarity.

6 years agoMinor grammar fix in docs (GH-12371)
Raymond Hettinger [Sat, 16 Mar 2019 18:16:29 +0000 (11:16 -0700)]
Minor grammar fix in docs (GH-12371)

6 years agobpo-36127: Fix compiler warning in _PyArg_UnpackKeywords(). (GH-12353)
Serhiy Storchaka [Sat, 16 Mar 2019 17:45:00 +0000 (19:45 +0200)]
bpo-36127: Fix compiler warning in _PyArg_UnpackKeywords(). (GH-12353)

6 years agobpo-36138: Clarify docs about converting datetime.timedelta to scalars. (GH-12137)
Yasser A [Sat, 16 Mar 2019 03:56:58 +0000 (23:56 -0400)]
bpo-36138: Clarify docs about converting datetime.timedelta to scalars. (GH-12137)

Be explicit that timedelta division converts an overall duration to the interval
units given by the denominator.

6 years agobpo-36124: Add PyInterpreterState.dict. (gh-12132)
Eric Snow [Fri, 15 Mar 2019 23:47:43 +0000 (17:47 -0600)]
bpo-36124: Add PyInterpreterState.dict. (gh-12132)

6 years agobpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary...
Eric Snow [Fri, 15 Mar 2019 22:35:46 +0000 (16:35 -0600)]
bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (gh-12359)

6 years agobpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)
Eric Snow [Fri, 15 Mar 2019 21:47:51 +0000 (15:47 -0600)]
bpo-33608: Deal with pending calls relative to runtime shutdown. (gh-12246)

6 years agoAdd the meaning of the returned value of PyTypeObject.tp_init (GH-12325)
Stéphane Wirtel [Fri, 15 Mar 2019 16:18:36 +0000 (16:18 +0000)]
Add the meaning of the returned value of PyTypeObject.tp_init (GH-12325)

6 years agobpo-33608: Fix PyEval_InitThreads() warning (GH-12346)
Victor Stinner [Fri, 15 Mar 2019 15:04:20 +0000 (16:04 +0100)]
bpo-33608: Fix PyEval_InitThreads() warning (GH-12346)

The function has no return value.

Fix the following warning on Windows:

    python\ceval.c(180): warning C4098: 'PyEval_InitThreads':
    'void' function returning a value

6 years agobpo-36301: _PyCoreConfig_Read() ensures that argv is not empty (GH-12347)
Victor Stinner [Fri, 15 Mar 2019 15:03:23 +0000 (16:03 +0100)]
bpo-36301: _PyCoreConfig_Read() ensures that argv is not empty (GH-12347)

If argv is empty, add an empty string.

6 years agobpo-36301: Add _PyWstrList structure (GH-12343)
Victor Stinner [Fri, 15 Mar 2019 14:08:05 +0000 (15:08 +0100)]
bpo-36301: Add _PyWstrList structure (GH-12343)

Replace messy _Py_wstrlist_xxx() functions with a new clean
_PyWstrList structure and new _PyWstrList_xxx() functions.

Changes:

* Add _PyCoreConfig.use_module_search_paths to decide if
  _PyCoreConfig.module_search_paths should be computed or not, to
  support empty search path list.
* _PyWstrList_Clear() sets length to 0 and items to NULL, whereas
  _Py_wstrlist_clear() only freed memory.
* _PyWstrList_Append() returns an int, whereas _Py_wstrlist_append()
  returned _PyInitError.
* _PyWstrList uses Py_ssize_t for the length, instead of int.
* Replace (int, wchar_t**) with _PyWstrList in:

  * _PyPreConfig
  * _PyCoreConfig
  * _PyPreCmdline
  * _PyCmdline

* Replace "int orig_argv; wchar_t **orig_argv;"
  with "_PyWstrList orig_argv".
* _PyCmdline and _PyPreCmdline now also copy wchar_argv.
* Rename _PyArgv_Decode() to _PyArgv_AsWstrList().
* PySys_SetArgvEx() now pass the fixed (argc, argv) to
  _PyPathConfig_ComputeArgv0() (don't pass negative argc or NULL
  argv).
* _PyOS_GetOpt() uses Py_ssize_t

6 years agobpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236)
Victor Stinner [Fri, 15 Mar 2019 13:57:52 +0000 (14:57 +0100)]
bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236)

Fix CFLAGS in customize_compiler() of distutils.sysconfig: when the
CFLAGS environment variable is defined, don't override CFLAGS variable with
the OPT variable anymore.

Initial patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
6 years agobpo-36272: Logging now propagates RecursionError (GH-12312)
Rémi Lapeyre [Fri, 15 Mar 2019 06:53:34 +0000 (07:53 +0100)]
bpo-36272: Logging now propagates RecursionError (GH-12312)

6 years agoCorrect the heading levels (GH-12338)
Raymond Hettinger [Fri, 15 Mar 2019 04:46:31 +0000 (21:46 -0700)]
Correct the heading levels (GH-12338)

6 years agoDocument actual string.punctuation value. (GH-12270)
Andre Delfino [Thu, 14 Mar 2019 19:28:31 +0000 (16:28 -0300)]
Document actual string.punctuation value. (GH-12270)

6 years agoFix typo duplicate period in a docstring in the zipfile module. (GH-12326)
nick sung [Thu, 14 Mar 2019 19:26:25 +0000 (03:26 +0800)]
Fix typo duplicate period in a docstring in the zipfile module. (GH-12326)

6 years agobpo-30040: update news entry (GH-12324)
Inada Naoki [Thu, 14 Mar 2019 09:54:09 +0000 (18:54 +0900)]
bpo-30040: update news entry (GH-12324)

This optimization is not only for space, but also for speed.

6 years agoSimplify overlap() formula for case where variances are equal (GH-12323)
Raymond Hettinger [Thu, 14 Mar 2019 09:25:26 +0000 (02:25 -0700)]
Simplify overlap() formula for case where variances are equal (GH-12323)

6 years agobpo-36127: Argument Clinic: inline parsing code for keyword parameters. (GH-12058)
Serhiy Storchaka [Thu, 14 Mar 2019 08:32:22 +0000 (10:32 +0200)]
bpo-36127: Argument Clinic: inline parsing code for keyword parameters. (GH-12058)

6 years agobpo-36254: Fix yet one invalid use of %d in format string in C. (GH-12318)
Serhiy Storchaka [Thu, 14 Mar 2019 08:06:05 +0000 (10:06 +0200)]
bpo-36254: Fix yet one invalid use of %d in format string in C. (GH-12318)

6 years agobpo-36282: Improved error message for too much positional arguments. (GH-12310)
Serhiy Storchaka [Wed, 13 Mar 2019 21:03:22 +0000 (23:03 +0200)]
bpo-36282: Improved error message for too much positional arguments. (GH-12310)

6 years agobpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)
Serhiy Storchaka [Wed, 13 Mar 2019 20:59:55 +0000 (22:59 +0200)]
bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)

6 years agobpo-36280: Add Constant.kind field (GH-12295)
Guido van Rossum [Wed, 13 Mar 2019 20:00:46 +0000 (13:00 -0700)]
bpo-36280: Add Constant.kind field (GH-12295)

The value is a string for string and byte literals, None otherwise.
It is 'u' for u"..." literals, 'b' for b"..." literals, '' for "..." literals.
The 'r' (raw) prefix is ignored.
Does not apply to f-strings.

This appears sufficient to make mypy capable of using the stdlib ast module instead of typed_ast (assuming a mypy patch I'm working on).

WIP: I need to make the tests pass. @ilevkivskyi @serhiy-storchaka

https://bugs.python.org/issue36280

6 years agobpo-31904: Adapt the _signal module to VxWorks RTOS (GH-12304)
pxinwr [Wed, 13 Mar 2019 17:18:25 +0000 (01:18 +0800)]
bpo-31904: Adapt the _signal module to VxWorks RTOS (GH-12304)

Limited signal fields in VxWorks.

6 years agobpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276)
Victor Stinner [Wed, 13 Mar 2019 16:55:01 +0000 (17:55 +0100)]
bpo-36262: Fix _Py_dg_strtod() memory leak (goto undfl) (GH-12276)

Fix an unlikely memory leak on conversion from string to float in the
function _Py_dg_strtod() used by float(str), complex(str),
pickle.load(), marshal.load(), etc.

Fix an unlikely memory leak in _Py_dg_strtod() on "undfl:" label:
rewrite memory management in this function to always release all
memory before exiting the function. Initialize variables to NULL, and
set them to NULL after calling Bfree() at the "cont:" label.

Note: Bfree(NULL) is well defined: it does nothing.