]> granicus.if.org Git - python/log
python
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.

6 years agoFix stepping into a frame without a __name__ (GH-12064)
Anthony Sottile [Wed, 13 Mar 2019 03:57:09 +0000 (20:57 -0700)]
Fix stepping into a frame without a __name__ (GH-12064)

6 years agobpo-35661: Fix failing test on buildbot (GH-12297)
Cheryl Sabella [Wed, 13 Mar 2019 00:15:47 +0000 (20:15 -0400)]
bpo-35661: Fix failing test on buildbot (GH-12297)

6 years agobpo-36174: Update nuget authoring for new license field. (GH-12300)
Steve Dower [Tue, 12 Mar 2019 23:48:17 +0000 (16:48 -0700)]
bpo-36174: Update nuget authoring for new license field. (GH-12300)

6 years agoCorrect minor edit to news entry. (GH-12298)
Ned Deily [Tue, 12 Mar 2019 23:44:20 +0000 (19:44 -0400)]
Correct minor edit to news entry. (GH-12298)

6 years agobpo-36264: Updates documentation for change to expanduser on Windows (GH-12294)
Steve Dower [Tue, 12 Mar 2019 22:15:26 +0000 (15:15 -0700)]
bpo-36264: Updates documentation for change to expanduser on Windows (GH-12294)

6 years agoMinor edits to news entries (ported from 3.7) (GH-12293)
Ned Deily [Tue, 12 Mar 2019 16:21:22 +0000 (12:21 -0400)]
Minor edits to news entries (ported from 3.7) (GH-12293)

6 years agobpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)
Anthony Sottile [Tue, 12 Mar 2019 15:39:57 +0000 (08:39 -0700)]
bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)

6 years agocanonicalize "Inada Naoki" in ACKS and 3.8 News (GH-12286)
Inada Naoki [Tue, 12 Mar 2019 08:27:43 +0000 (17:27 +0900)]
canonicalize "Inada Naoki" in ACKS and 3.8 News (GH-12286)

6 years agobpo-30040: new empty dict uses key-sharing dict (GH-1080)
Inada Naoki [Tue, 12 Mar 2019 08:25:44 +0000 (17:25 +0900)]
bpo-30040: new empty dict uses key-sharing dict (GH-1080)

Sizeof new empty dict becomes 72 bytes from 240 bytes (amd64).
It is same size to empty dict created by dict.clear().

6 years agobpo-35892: Fix mode() and add multimode() (#12089)
Raymond Hettinger [Tue, 12 Mar 2019 07:43:27 +0000 (00:43 -0700)]
bpo-35892: Fix mode() and add multimode() (#12089)

6 years agobpo-35931: Gracefully handle any exception in pdb debug command (GH-12103)
Daniel Hahler [Tue, 12 Mar 2019 03:29:04 +0000 (04:29 +0100)]
bpo-35931: Gracefully handle any exception in pdb debug command (GH-12103)

This is relevant for `debug doesnotexist()`, which would crash with a
NameError otherwise.

6 years agobpo-35132: Fixes missing target in gdb pep0393 check. (GH-11848)
Lisa Roach [Tue, 12 Mar 2019 03:21:25 +0000 (20:21 -0700)]
bpo-35132: Fixes missing target in gdb pep0393 check. (GH-11848)

6 years agoDoc: Fix inconsistency in multiprocessing (GH-12273)
Julien Palard [Mon, 11 Mar 2019 13:54:48 +0000 (14:54 +0100)]
Doc: Fix inconsistency in multiprocessing (GH-12273)

6 years agobpo-36234: Add more tests to PosixUidGidTests (GH-12234)
Victor Stinner [Mon, 11 Mar 2019 12:57:53 +0000 (13:57 +0100)]
bpo-36234: Add more tests to PosixUidGidTests (GH-12234)

test_posix.PosixUidGidTests:

* Add tests for invalid uid/gid type (str)
* Add UID_OVERFLOW and GID_OVERFLOW constants to replace (1 << 32)

Initial patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
6 years agoVarious refinements to the NormalDist examples and recipes (GH-12272)
Raymond Hettinger [Mon, 11 Mar 2019 06:43:33 +0000 (23:43 -0700)]
Various refinements to the NormalDist examples and recipes (GH-12272)

6 years agobpo-36176: Fix IDLE autocomplete & calltip popup colors. (#12262)
Terry Jan Reedy [Mon, 11 Mar 2019 00:18:40 +0000 (20:18 -0400)]
bpo-36176: Fix IDLE autocomplete & calltip popup colors. (#12262)

Prevent conflicts with Linux dark themes
(and slightly darken calltip background).

6 years agobpo-35647: Fix path check in cookiejar (#11436)
Xtreak [Sun, 10 Mar 2019 17:12:28 +0000 (22:42 +0530)]
bpo-35647: Fix path check in cookiejar (#11436)

* Refactor cookie path check as per RFC 6265

* Add tests for prefix match of path

* Add news entry

* Fix set_ok_path and refactor tests

* Use slice for last letter

6 years agobpo-21314: Add a FAQ entry about positional only parameters (GH-10641)
Lysandros Nikolaou [Sun, 10 Mar 2019 11:30:11 +0000 (12:30 +0100)]
bpo-21314: Add a FAQ entry about positional only parameters (GH-10641)

6 years agoFix padding on asyncio.IncompleteReadError docs (GH-12258)
Andre Delfino [Sun, 10 Mar 2019 11:02:17 +0000 (08:02 -0300)]
Fix padding on asyncio.IncompleteReadError docs (GH-12258)

6 years agobpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)
sth [Sun, 10 Mar 2019 10:29:14 +0000 (11:29 +0100)]
bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)

6 years agobpo-35121: prefix dot in domain for proper subdomain validation (GH-10258)
Xtreak [Sun, 10 Mar 2019 02:09:48 +0000 (07:39 +0530)]
bpo-35121: prefix dot in domain for proper subdomain validation (GH-10258)

Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy.  Patch by Karthikeyan Singaravelan.

6 years agocloses bpo-33376: Update to Unicode 12.0.0. (GH-12256)
Benjamin Peterson [Sun, 10 Mar 2019 00:25:55 +0000 (16:25 -0800)]
closes bpo-33376: Update to Unicode 12.0.0. (GH-12256)

6 years agoRework integer overflow path in math.prod and add more tests (GH-11809)
Pablo Galindo [Sat, 9 Mar 2019 19:18:08 +0000 (19:18 +0000)]
Rework integer overflow path in math.prod and add more tests (GH-11809)

The overflow check was relying on undefined behaviour as it was using the result of the multiplication to do the check, and once the overflow has already happened, any operation on the result is undefined behaviour.

Some extra checks that exercise code paths related to this are also added.

6 years agoFix typos and improve grammar in threading.Barrier docstrings (GH-12210)
Carl Bordum Hansen [Sat, 9 Mar 2019 17:38:05 +0000 (18:38 +0100)]
Fix typos and improve grammar in threading.Barrier docstrings (GH-12210)

6 years agoRemove d_initial from the parser as it is unused (GH-12212)
tyomitch [Sat, 9 Mar 2019 15:35:50 +0000 (17:35 +0200)]
Remove d_initial from the parser as it is unused (GH-12212)

d_initial, the first state of a particular DFA in the parser has always been initialized to 0 in the old pgen as well as the new pgen. As this value is not used and the first state of each DFA is assumed to be the first element in the array representing it, remove d_initial from the parser to reduce complexity.

6 years agoMake a documentation link target more specific (GH-12249)
Raymond Hettinger [Sat, 9 Mar 2019 08:42:23 +0000 (00:42 -0800)]
Make a documentation link target more specific (GH-12249)

6 years agobpo-33608: Make sure locks in the runtime are properly re-created. (gh-12245)
Eric Snow [Sat, 9 Mar 2019 06:44:33 +0000 (23:44 -0700)]
bpo-33608: Make sure locks in the runtime are properly re-created.  (gh-12245)

6 years agobpo-33608: Minor cleanup related to pending calls. (gh-12247)
Eric Snow [Sat, 9 Mar 2019 05:47:07 +0000 (22:47 -0700)]
bpo-33608: Minor cleanup related to pending calls. (gh-12247)

6 years agoSimplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)
Eric Snow [Sat, 9 Mar 2019 00:25:54 +0000 (17:25 -0700)]
Simplify DISPATCH by hoisting eval_breaker ahead of time. (gh-12243)

6 years agobpo-35661: Store the venv prompt in pyvenv.cfg (GH-11440)
Cheryl Sabella [Fri, 8 Mar 2019 22:01:27 +0000 (17:01 -0500)]
bpo-35661: Store the venv prompt in pyvenv.cfg (GH-11440)

6 years agoFix the Py_atomic_* macros. (#12240)
Eric Snow [Fri, 8 Mar 2019 19:06:56 +0000 (12:06 -0700)]
Fix the Py_atomic_* macros. (#12240)

The macros were working only because our usage happened to parse correctly.  Changing that usage (e.g. with pointers) would break the macros.  This fixes that.

6 years agobpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)
Anthony Sottile [Fri, 8 Mar 2019 18:58:00 +0000 (10:58 -0800)]
bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)

6 years agobpo-34162: Add entries for idlelib/NEWS.txt (#12232)
Terry Jan Reedy [Fri, 8 Mar 2019 08:04:32 +0000 (03:04 -0500)]
bpo-34162: Add entries for idlelib/NEWS.txt (#12232)

6 years agoFix typo (double 'the') in CODEOWNERS (GH-12227)
Benedikt Werner [Fri, 8 Mar 2019 01:09:40 +0000 (02:09 +0100)]
Fix typo (double 'the') in CODEOWNERS (GH-12227)

6 years agobpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)
Guido van Rossum [Thu, 7 Mar 2019 20:38:08 +0000 (12:38 -0800)]
bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)

This adds a `feature_version` flag to `ast.parse()` (documented) and `compile()` (hidden) that allow tweaking the parser to support older versions of the grammar. In particular if `feature_version` is 5 or 6, the hacks for the `async` and `await` keyword from PEP 492 are reinstated. (For 7 or higher, these are unconditionally treated as keywords, but they are still special tokens rather than `NAME` tokens that the parser driver recognizes.)

https://bugs.python.org/issue35975

6 years agobpo-36140: Fix an incorrect check in msidb_getsummaryinformation() (GH-12074)
Zackery Spytz [Thu, 7 Mar 2019 18:20:13 +0000 (11:20 -0700)]
bpo-36140: Fix an incorrect check in msidb_getsummaryinformation() (GH-12074)

6 years agobpo-36108: Avoid failing the build on race condition in clean (GH-12217)
Steve Dower [Thu, 7 Mar 2019 17:09:15 +0000 (09:09 -0800)]
bpo-36108: Avoid failing the build on race condition in clean (GH-12217)

6 years agoNormalDist.overlap() only needs one example (GH-12218)
Raymond Hettinger [Thu, 7 Mar 2019 16:54:31 +0000 (08:54 -0800)]
NormalDist.overlap() only needs one example (GH-12218)

6 years agobpo-36216: Add check for characters in netloc that normalize to separators (GH-12201)
Steve Dower [Thu, 7 Mar 2019 16:02:26 +0000 (08:02 -0800)]
bpo-36216: Add check for characters in netloc that normalize to separators (GH-12201)

6 years agoRefine statistics.NormalDist documentation and improve test coverage (GH-12208)
Raymond Hettinger [Thu, 7 Mar 2019 07:23:55 +0000 (23:23 -0800)]
Refine statistics.NormalDist documentation and improve test coverage (GH-12208)

6 years agobpo-36169 : Add overlap() method to statistics.NormalDist (GH-12149)
Raymond Hettinger [Thu, 7 Mar 2019 06:59:40 +0000 (22:59 -0800)]
bpo-36169 : Add overlap() method to statistics.NormalDist (GH-12149)

6 years agoFix the documentation for set.copy() (GH-12176)
Andre Delfino [Thu, 7 Mar 2019 05:23:21 +0000 (02:23 -0300)]
Fix the documentation for set.copy() (GH-12176)

Remove 's' mention as there's no argument.

6 years agobpo-36185: Fix typo in Doc/c-api/objbuffer.rst. (GH-12204)
Emmanuel Arias [Thu, 7 Mar 2019 05:16:41 +0000 (02:16 -0300)]
bpo-36185: Fix typo in Doc/c-api/objbuffer.rst. (GH-12204)

6 years agobpo-36139: Fix mmap_object_dealloc(): hold the GIL to call PyMem_Free() (GH-12199)
Davide Rizzo [Wed, 6 Mar 2019 17:08:31 +0000 (18:08 +0100)]
bpo-36139: Fix mmap_object_dealloc(): hold the GIL to call PyMem_Free() (GH-12199)

6 years agobpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)
Jeremy Kloth [Wed, 6 Mar 2019 16:54:12 +0000 (09:54 -0700)]
bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.

6 years agocloses bpo-36139: release GIL around munmap(). (GH-12073)
Davide Rizzo [Wed, 6 Mar 2019 15:52:34 +0000 (16:52 +0100)]
closes bpo-36139: release GIL around munmap(). (GH-12073)

6 years agobpo-36209: Fix typo on hashlib error message (GH-12194)
Emmanuel Arias [Wed, 6 Mar 2019 14:35:35 +0000 (11:35 -0300)]
bpo-36209: Fix typo on hashlib error message (GH-12194)

6 years agobpo-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191)
Victor Stinner [Wed, 6 Mar 2019 11:51:53 +0000 (12:51 +0100)]
bpo-36142: PYTHONMALLOC overrides PYTHONDEV (GH-12191)

bpo-34247, bpo-36142: The PYTHONMALLOC environment variable has the
priority over PYTHONDEV env var and "-X dev" command line option.
For example, PYTHONMALLOC=malloc PYTHONDEVMODE=1 sets the memory
allocators to "malloc" (and not to "debug").

Add an unit test.

6 years agobpo-35807: Upgrade ensurepip bundled pip and setuptools (GH-12189)
Pradyun Gedam [Wed, 6 Mar 2019 11:42:21 +0000 (17:12 +0530)]
bpo-35807: Upgrade ensurepip bundled pip and setuptools (GH-12189)

* Update pip to 19.0.3
* Update setuptools to 40.8.0

6 years agoAdd more tests for pdf() and cdf() (GH-12190)
Raymond Hettinger [Wed, 6 Mar 2019 10:31:14 +0000 (02:31 -0800)]
Add more tests for pdf() and cdf() (GH-12190)

6 years agobpo-36142: _PyPreConfig_Read() sets LC_CTYPE (GH-12188)
Victor Stinner [Wed, 6 Mar 2019 00:44:31 +0000 (01:44 +0100)]
bpo-36142: _PyPreConfig_Read() sets LC_CTYPE (GH-12188)

* _PyPreConfig_Read() now sets temporarily LC_CTYPE to the user
  preferred locale, as _PyPreConfig_Write() will do permanentely.
* Fix _PyCoreConfig_Clear(): clear run_xxx attributes
* _Py_SetArgcArgv() doesn't have to be exported
* _PyCoreConfig_SetGlobalConfig() no longer applies preconfig

6 years agobpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)
Victor Stinner [Wed, 6 Mar 2019 00:13:43 +0000 (01:13 +0100)]
bpo-36142: Add _PyPreConfig_SetAllocator() (GH-12187)

* _PyPreConfig_Write() now reallocates the pre-configuration with the
  new memory allocator.
* It is no longer needed to force the "default raw memory allocator"
  to clear pre-configuration and core configuration. Simplify the
  code.
* _PyPreConfig_Write() now does nothing if called after
  Py_Initialize(): no longer check if the allocator is the same.
* Remove _PyMem_GetDebugAllocatorsName(): dev mode sets again
  allocator to "debug".

6 years agobpo-36142: _PyPreConfig_Write() sets the allocator (GH-12186)
Victor Stinner [Tue, 5 Mar 2019 23:36:56 +0000 (00:36 +0100)]
bpo-36142: _PyPreConfig_Write() sets the allocator (GH-12186)

* _PyPreConfig_Write() now sets the memory allocator.
* _PyPreConfig_Write() gets a return type: _PyInitError.
* _Py_InitializeCore() now reads and writes the pre-configuration
  (set the memory allocator, configure the locale) before reading and
  writing the core configuration.

6 years agobpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)
Victor Stinner [Tue, 5 Mar 2019 22:31:54 +0000 (23:31 +0100)]
bpo-36142: Add _PyMem_GetDebugAllocatorsName() (GH-12185)

The development mode now uses the effective name of the debug memory
allocator ("pymalloc_debug" or "malloc_debug"). So the name doesn't
change after setting the memory allocator.

6 years agobpo-36187: Remove NamedStore. (GH-12167)
Serhiy Storchaka [Tue, 5 Mar 2019 18:42:06 +0000 (20:42 +0200)]
bpo-36187: Remove NamedStore. (GH-12167)

NamedStore has been replaced with Store. The difference between
NamedStore and Store is handled when precess the NamedExpr node
one level upper.

6 years agoFix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180)
Serhiy Storchaka [Tue, 5 Mar 2019 16:41:09 +0000 (18:41 +0200)]
Fix the C function signature for _collections._tuplegetter.__reduce__. (GH-12180)

Correctly fixes bpo-36197.

6 years agobpo-36142: Add _PyPreConfig.allocator (GH-12181)
Victor Stinner [Tue, 5 Mar 2019 16:37:44 +0000 (17:37 +0100)]
bpo-36142: Add _PyPreConfig.allocator (GH-12181)

* Move 'allocator' and 'dev_mode' fields from _PyCoreConfig
  to _PyPreConfig.
* Fix InitConfigTests of test_embed: dev_mode sets allocator to
  "debug", add a new tests for env vars with dev mode enabled.

6 years agobpo-33012: Fix compilation warnings in memoryobject.c and _collectionsmodule.c (GH...
Stéphane Wirtel [Tue, 5 Mar 2019 15:10:53 +0000 (16:10 +0100)]
bpo-33012: Fix compilation warnings in memoryobject.c and _collectionsmodule.c (GH-12179)

Cast function pointers to (void(*)(void)) before casting to (PyCFunction)
to make "warning: cast between incompatible function types" false alarm quiet.

6 years agobpo-36142: Add _PyPreConfig.utf8_mode (GH-12174)
Victor Stinner [Tue, 5 Mar 2019 11:32:09 +0000 (12:32 +0100)]
bpo-36142: Add _PyPreConfig.utf8_mode (GH-12174)

* Move following fields from _PyCoreConfig to _PyPreConfig:

  * coerce_c_locale
  * coerce_c_locale_warn
  * legacy_windows_stdio
  * utf8_mode

* _PyPreConfig_ReadFromArgv() is now responsible to choose the
  filesystem encoding
* _PyPreConfig_Write() now sets the LC_CTYPE locale

6 years agobpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)
Serhiy Storchaka [Tue, 5 Mar 2019 08:06:26 +0000 (10:06 +0200)]
bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)

6 years agobpo-22831: Use "with" to avoid possible fd leaks in tests (part 1). (GH-10928)
Serhiy Storchaka [Tue, 5 Mar 2019 08:05:57 +0000 (10:05 +0200)]
bpo-22831: Use "with" to avoid possible fd leaks in tests (part 1). (GH-10928)

6 years agocloses bpo-36188: Clean up 'unbound' method left-overs. (GH-12169)
Martijn Pieters [Tue, 5 Mar 2019 05:19:34 +0000 (05:19 +0000)]
closes bpo-36188: Clean up 'unbound' method left-overs. (GH-12169)

Methods are always bound, and `__self__` can no longer be `NULL`
(`method_new()` and `PyMethod_New()` both explicitly check for this).

Moreover, once a bound method is bound, it *stays* bound and won't be re-bound
to something else, so the section in the datamodel that talks about accessing
an methods in a different descriptor-binding context doesn't apply any more in
Python 3.

6 years agoDoc: Use `option` word for command line interface. (GH-12142)
NAKAMURA Osamu [Tue, 5 Mar 2019 04:43:43 +0000 (13:43 +0900)]
Doc: Use `option` word for command line interface. (GH-12142)

For command line option, `option` is better than `parameter`.

6 years agobpo-36142: Add _PyPreConfig_ReadFromArgv() (GH-12173)
Victor Stinner [Tue, 5 Mar 2019 01:44:12 +0000 (02:44 +0100)]
bpo-36142: Add _PyPreConfig_ReadFromArgv() (GH-12173)

The new function is now responsible to parse -E and -I command line
arguments.

6 years agobpo-36142: Add _PyPreConfig structure (GH-12172)
Victor Stinner [Tue, 5 Mar 2019 01:01:27 +0000 (02:01 +0100)]
bpo-36142: Add _PyPreConfig structure (GH-12172)

* Add _PyPreConfig structure
* Move 'ignored' and 'use_environment' fields from _PyCoreConfig
  to _PyPreConfig
* Add a new "_PyPreConfig preconfig;" field to _PyCoreConfig

6 years agoFixed a missing . and a missing capital letter. (GH-12170)
Jules Lasne (jlasne) [Mon, 4 Mar 2019 18:12:04 +0000 (19:12 +0100)]
Fixed a missing . and a missing capital letter. (GH-12170)

6 years agobpo-36179: Fix ref leaks in _hashopenssl (GH-12158)
Christian Heimes [Mon, 4 Mar 2019 15:45:41 +0000 (16:45 +0100)]
bpo-36179: Fix ref leaks in _hashopenssl (GH-12158)

Fix two unlikely reference leaks in _hashopenssl. The leaks only occur in
out-of-memory cases. Thanks to Charalampos Stratakis.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue36179

6 years agobpo-35198 Fix C++ extension compilation on AIX (GH-10437)
Kevin Adler [Mon, 4 Mar 2019 14:48:40 +0000 (08:48 -0600)]
bpo-35198 Fix C++ extension compilation on AIX (GH-10437)

For C++ extensions, distutils tries to replace the C compiler with the
C++ compiler, but it assumes that C compiler is the first element after
any environment variables set. On AIX, linking goes through ld_so_aix,
so it is the first element and the compiler is the next element. Thus
the replacement is faulty:

ld_so_aix gcc ... -> g++ gcc ...

Also, it assumed that self.compiler_cxx had only 1 element or that
there were the same number of elements as the linker has and in the
same order. This might not be the case, so instead concatenate
everything together.