]> granicus.if.org Git - python/log
python
5 years agobpo:34848 : Correct an incorrect docstring for range().index method (GH-9877)
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Fri, 3 May 2019 12:22:12 +0000 (17:52 +0530)]
bpo:34848 : Correct an incorrect  docstring for range().index method (GH-9877)

5 years agoAdd correct license for C14N test suite to license docs. (GH-13055)
Stefan Behnel [Thu, 2 May 2019 20:11:04 +0000 (22:11 +0200)]
Add correct license for C14N test suite to license docs. (GH-13055)

5 years agobpo-36763: Remove _PyCoreConfig._init_main (GH-13066)
Victor Stinner [Thu, 2 May 2019 19:30:21 +0000 (15:30 -0400)]
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066)

5 years agobpo-36763: _PyCoreConfig_SetPyArgv() preinitializes Python (GH-13037)
Victor Stinner [Thu, 2 May 2019 19:25:34 +0000 (15:25 -0400)]
bpo-36763: _PyCoreConfig_SetPyArgv() preinitializes Python (GH-13037)

_PyCoreConfig_SetPyArgv() and _PyCoreConfig_SetWideString() now
pre-initialize Python if needed to ensure that the locale encoding is
properly configured.

* Add _Py_PreInitializeFromPyArgv() internal function.
* Add 'args' parameter to _Py_PreInitializeFromCoreConfig()

5 years agobpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)
Victor Stinner [Thu, 2 May 2019 18:56:30 +0000 (14:56 -0400)]
bpo-36775: _PyCoreConfig only uses wchar_t* (GH-13062)

_PyCoreConfig: Change filesystem_encoding, filesystem_errors,
stdio_encoding and stdio_errors fields type from char* to wchar_t*.

Changes:

* PyInterpreterState: replace fscodec_initialized (int) with fs_codec
  structure.
* Add get_error_handler_wide() and unicode_encode_utf8() helper
  functions.
* Add error_handler parameter to unicode_encode_locale()
  and unicode_decode_locale().
* Remove _PyCoreConfig_SetString().
* Rename _PyCoreConfig_SetWideString() to _PyCoreConfig_SetString().
* Rename _PyCoreConfig_SetWideStringFromString()
  to _PyCoreConfig_DecodeLocale().

5 years agobpo-36776: Add @support.skip_unless_symlink to test_lll.py (GH-13058)
Zackery Spytz [Thu, 2 May 2019 18:55:00 +0000 (12:55 -0600)]
bpo-36776: Add @support.skip_unless_symlink to test_lll.py (GH-13058)

5 years agobpo-36763: Add _PyCoreConfig._config_version (GH-13065)
Victor Stinner [Thu, 2 May 2019 18:46:29 +0000 (14:46 -0400)]
bpo-36763: Add _PyCoreConfig._config_version (GH-13065)

Add private _config_version field to _PyPreConfig and _PyCoreConfig
to prepare future ABI compatibility.

5 years agoFix typo: quaatile to quantile (GH=13001)
Xtreak [Thu, 2 May 2019 18:20:59 +0000 (23:50 +0530)]
Fix typo: quaatile to quantile (GH=13001)

5 years agobpo-36775: Add _PyUnicode_InitEncodings() (GH-13057)
Victor Stinner [Thu, 2 May 2019 15:54:20 +0000 (11:54 -0400)]
bpo-36775: Add _PyUnicode_InitEncodings() (GH-13057)

Move get_codec_name() and initfsencoding() from pylifecycle.c to
unicodeobject.c.

Rename also "init" functions in pylifecycle.c.

5 years agobpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)
Victor Stinner [Thu, 2 May 2019 15:28:57 +0000 (11:28 -0400)]
bpo-36775: Add _Py_FORCE_UTF8_FS_ENCODING macro (GH-13056)

Add _Py_FORCE_UTF8_LOCALE and _Py_FORCE_UTF8_FS_ENCODING macros to
avoid factorize "#if defined(__ANDROID__) || defined(__VXWORKS__)"
and "#if defined(__APPLE__)".

Cleanup also config_init_fs_encoding().

5 years agobpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)
Zackery Spytz [Thu, 2 May 2019 15:03:43 +0000 (09:03 -0600)]
bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)

5 years agobpo-13611: Include C14N 2.0 test data in installation (GH-13053)
Stefan Behnel [Thu, 2 May 2019 08:35:02 +0000 (10:35 +0200)]
bpo-13611: Include C14N 2.0 test data in installation (GH-13053)

* Include C14N 2.0 test data in installation.
* Add README file to the C14N test data directory to reference the original source and licensing conditions.

5 years agoFix tiny tiny typo in 3.8 what's new (GH-13049)
Daniel Porteous [Thu, 2 May 2019 08:20:59 +0000 (04:20 -0400)]
Fix tiny tiny typo in 3.8 what's new (GH-13049)

I feel silly even making such a tiny typo fix, but I couldn't help but notice it.

5 years agoregarding to grammar and spell check (#13020)
Hossein Pourbozorg [Thu, 2 May 2019 08:17:55 +0000 (12:47 +0430)]
regarding to grammar and spell check (#13020)

5 years agobpo-36763: Make _PyCoreConfig.check_hash_pycs_mode public (GH-13052)
Victor Stinner [Thu, 2 May 2019 03:51:56 +0000 (23:51 -0400)]
bpo-36763: Make _PyCoreConfig.check_hash_pycs_mode public (GH-13052)

_PyCoreConfig: Rename _check_hash_pycs_mode field to
check_hash_pycs_mode (make it public) and change its type from "const
char*" to "wchar_t*".

5 years agoChange bisect to bisect_cmd in docstring (#13040)
Xtreak [Thu, 2 May 2019 02:49:50 +0000 (08:19 +0530)]
Change bisect to bisect_cmd in docstring (#13040)

5 years agobpo-36018: Update example to show mean and stdev (GH-13047)
Raymond Hettinger [Thu, 2 May 2019 00:49:12 +0000 (17:49 -0700)]
bpo-36018: Update example to show mean and stdev (GH-13047)

5 years agoMove dangling bullet points into named subsections (GH-13046)
Raymond Hettinger [Thu, 2 May 2019 00:48:13 +0000 (17:48 -0700)]
Move dangling bullet points into named subsections (GH-13046)

5 years agoMock 100% coverage (GH-13045)
Chris Withers [Wed, 1 May 2019 22:04:04 +0000 (23:04 +0100)]
Mock 100% coverage (GH-13045)

This was achieved by:
* moving many pass statements in tests onto their own lines, so they pass line coverage and can match an easy ignore pattern if branch coverage is added later.
* removing code that cannot be reached.
* removing long-disabled tests.
* removing unused code.
* adding tests for uncovered code

It turned out that removing `if __name__ == '__main__'` blocks that run unittest.main() at the bottom of test files was surprisingly contentious, so they remain and can be filtered out with an appropriate .coveragerc.

5 years agobpo-30458: Use InvalidURL instead of ValueError. (GH-13044)
Gregory P. Smith [Wed, 1 May 2019 20:39:21 +0000 (16:39 -0400)]
bpo-30458: Use InvalidURL instead of ValueError. (GH-13044)

Use http.client.InvalidURL instead of ValueError as the new error case's exception.

5 years agobpo-13611: C14N 2.0 implementation for ElementTree (GH-12966)
Stefan Behnel [Wed, 1 May 2019 20:34:13 +0000 (22:34 +0200)]
bpo-13611: C14N 2.0 implementation for ElementTree (GH-12966)

* Implement C14N 2.0 as a new canonicalize() function in ElementTree.

Missing features:
- prefix renaming in XPath expressions (tag and attribute text is supported)
- preservation of original prefixes given redundant namespace declarations

5 years agoNamespace packages _bootstrap.ModuleSpec.loader attributes are no longer None (#10376)
Géry Ogam [Wed, 1 May 2019 20:08:17 +0000 (22:08 +0200)]
Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer None (#10376)

Namespace packages _bootstrap.ModuleSpec.loader attributes are no longer `None` _after_ calling the importlib._bootstrap._init_module_attrs function.

See:
* https://stackoverflow.com/questions/52869541/namespace-package-spec-loader-and-loader-attributes-not-set-to-none
* https://bugs.python.org/issue35181

5 years agobpo-36676: Namespace prefix aware parsing support for the ET.XMLParser target (GH...
Stefan Behnel [Wed, 1 May 2019 19:49:58 +0000 (21:49 +0200)]
bpo-36676: Namespace prefix aware parsing support for the ET.XMLParser target (GH-12885)

* bpo-36676: Implement namespace prefix aware parsing support for the XMLParser target in ElementTree.

5 years agobpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree...
Stefan Behnel [Wed, 1 May 2019 19:20:38 +0000 (21:20 +0200)]
bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree. (#12883)

* bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree.

* bpo-36673: Rewrite the comment/PI factory handling for the TreeBuilder in "_elementtree" to make it use the same factories as the ElementTree module, and to make it explicit when the comments/PIs are inserted into the tree and when they are not (which is the default).

5 years agobpo-27682: Handle client connection terminations in wsgiref (GH-9713)
Petter Strandmark [Wed, 1 May 2019 17:32:15 +0000 (19:32 +0200)]
bpo-27682: Handle client connection terminations in wsgiref (GH-9713)

5 years agoMNT: set stacklevel in the getfullargspec deprecation warning to 2 (GH-13029)
Thomas A Caswell [Wed, 1 May 2019 15:12:35 +0000 (11:12 -0400)]
MNT: set stacklevel in the getfullargspec deprecation warning to 2 (GH-13029)

This is consistent with the rest of the `warnings.warn` usage in the
inspect.py module and aids identifying code that needs to be fixed.

This warning came in via d5d2b4546939b98244708e5bb0cfccd55b99d244

5 years agobpo-36763: Add _PyCoreConfig_SetString() (GH-13035)
Victor Stinner [Wed, 1 May 2019 13:22:52 +0000 (15:22 +0200)]
bpo-36763: Add _PyCoreConfig_SetString() (GH-13035)

Add 3 new config methods:

* _PyCoreConfig_SetString()
* _PyCoreConfig_SetWideString()
* _PyCoreConfig_SetWideStringFromString()

Changes:

* _PyCoreConfig_Copy() returns _PyInitError.
* Add CONFIG_GET_ENV_DUP().

5 years agobpo-30458: Disable https related urllib tests on a build without ssl (GH-13032)
Xtreak [Wed, 1 May 2019 11:59:49 +0000 (17:29 +0530)]
bpo-30458: Disable https related urllib tests on a build without ssl (GH-13032)

These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.

https://bugs.python.org/issue30458

5 years agoremove jython support from unittest.mock (GH#13033)
Chris Withers [Wed, 1 May 2019 07:48:44 +0000 (08:48 +0100)]
remove jython support from unittest.mock (GH#13033)

5 years agobpo-36763: Rework _PyInitError API (GH-13031)
Victor Stinner [Wed, 1 May 2019 03:35:33 +0000 (05:35 +0200)]
bpo-36763: Rework _PyInitError API (GH-13031)

* Remove _PyInitError.user_err field and _Py_INIT_USER_ERR() macro:
  use _Py_INIT_ERR() instead. _Py_ExitInitError() now longer calls
  abort() on error: exit with exit code 1 instead.
* Add _PyInitError._type private field.
* exitcode field type is now unsigned int on Windows.
* Rename prefix field to _func.
* Rename msg field to err_msg.

5 years agobpo-30458: Disallow control chars in http URLs. (GH-12755)
Gregory P. Smith [Wed, 1 May 2019 02:12:21 +0000 (19:12 -0700)]
bpo-30458: Disallow control chars in http URLs. (GH-12755)

Disallow control chars in http URLs in urllib.urlopen.  This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.

5 years agobpo-36763: Add _PyCoreConfig_SetArgv() (GH-13030)
Victor Stinner [Wed, 1 May 2019 00:30:12 +0000 (02:30 +0200)]
bpo-36763: Add _PyCoreConfig_SetArgv() (GH-13030)

* Add 2 new config methods:

  * _PyCoreConfig_SetArgv()
  * _PyCoreConfig_SetWideArgv()

* Add also an internal _PyCoreConfig_SetPyArgv() method.
* Remove 'args' parameter from _PyCoreConfig_Read().

5 years agobpo-36763: Fix Py_SetStandardStreamEncoding() (GH-13028)
Victor Stinner [Tue, 30 Apr 2019 23:36:13 +0000 (01:36 +0200)]
bpo-36763: Fix Py_SetStandardStreamEncoding() (GH-13028)

Fix memory leak in Py_SetStandardStreamEncoding(): release memory
if the function is called twice.

5 years agoDon't report deleted attributes in __dir__ (GH#10148)
Mario Corchero [Tue, 30 Apr 2019 18:56:36 +0000 (19:56 +0100)]
Don't report deleted attributes in __dir__ (GH#10148)

When an attribute is deleted from a Mock, a sentinel is added rather
than just deleting the attribute. This commit checks for such sentinels
when returning the child mocks in the __dir__ method as users won't
expect deleted attributes to appear when performing dir(mock).

5 years agobpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)
Steve Dower [Tue, 30 Apr 2019 12:03:02 +0000 (12:03 +0000)]
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)

5 years agobpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)
Victor Stinner [Tue, 30 Apr 2019 10:19:34 +0000 (12:19 +0200)]
bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)

Initialize "stack_t current_stack" to zero using memset().

5 years agobpo-25430: improve performance of IPNetwork.__contains__ (GH-1785)
gescheit [Tue, 30 Apr 2019 07:54:30 +0000 (10:54 +0300)]
bpo-25430: improve performance of IPNetwork.__contains__ (GH-1785)

make a compare in bit-operation manner.

5 years agobpo-36018: Test idempotence. Test two methods against one-another. (GH-13021)
Raymond Hettinger [Tue, 30 Apr 2019 06:47:33 +0000 (23:47 -0700)]
bpo-36018: Test idempotence. Test two methods against one-another. (GH-13021)

5 years agocloses bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008)
Utkarsh Gupta [Tue, 30 Apr 2019 02:20:06 +0000 (02:20 +0000)]
closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008)

5 years agobpo-36751: Deprecate getfullargspec and report positional-only args as regular args...
Pablo Galindo [Tue, 30 Apr 2019 01:01:14 +0000 (02:01 +0100)]
bpo-36751: Deprecate getfullargspec and report positional-only args as regular args (GH-13016)

* bpo-36751: Deprecate getfullargspec and report positional-only args as regular args

* Use inspect.signature in testhelpers

5 years agobpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060)
Marco Rougeth [Mon, 29 Apr 2019 23:23:28 +0000 (00:23 +0100)]
bpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060)

5 years agoPrevent macOS installer build failure if ABIFLAGS is empty. (GH-13012)
Ned Deily [Mon, 29 Apr 2019 19:11:53 +0000 (15:11 -0400)]
Prevent macOS installer build failure if ABIFLAGS is empty. (GH-13012)

5 years agobpo-34602: Avoid failures setting macOS stack resource limit (GH-13011)
Ned Deily [Mon, 29 Apr 2019 19:07:39 +0000 (15:07 -0400)]
bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011)

Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  For now, revert the original change and resume using
the default stack size when linking the interpreter.

5 years agobpo-1613500: Don't hardcode output file mode in fileinput.FileInput (GH-12986)
Berker Peksag [Mon, 29 Apr 2019 14:55:39 +0000 (17:55 +0300)]
bpo-1613500: Don't hardcode output file mode in fileinput.FileInput (GH-12986)

5 years agobpo-36004: Add date.fromisocalendar (GH-11888)
Paul Ganssle [Mon, 29 Apr 2019 13:22:03 +0000 (09:22 -0400)]
bpo-36004: Add date.fromisocalendar (GH-11888)

This commit implements the first version of date.fromisocalendar, the
inverse function for date.isocalendar.

5 years agobpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007)
xdegaye [Mon, 29 Apr 2019 12:53:30 +0000 (14:53 +0200)]
bpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007)

5 years agoAdd initial 'whatsnew' section for PEP 570 (GH-12942)
Guido van Rossum [Mon, 29 Apr 2019 12:49:30 +0000 (05:49 -0700)]
Add initial 'whatsnew' section for PEP 570 (GH-12942)

5 years agobpo-36540: PEP 570 -- Implementation (GH-12701)
Pablo Galindo [Mon, 29 Apr 2019 12:36:57 +0000 (13:36 +0100)]
bpo-36540: PEP 570 -- Implementation (GH-12701)

This commit contains the implementation of PEP570: Python positional-only parameters.

* Update Grammar/Grammar with new typedarglist and varargslist

* Regenerate grammar files

* Update and regenerate AST related files

* Update code object

* Update marshal.c

* Update compiler and symtable

* Regenerate importlib files

* Update callable objects

* Implement positional-only args logic in ceval.c

* Regenerate frozen data

* Update standard library to account for positional-only args

* Add test file for positional-only args

* Update other test files to account for positional-only args

* Add News entry

* Update inspect module and related tests

5 years agoRevert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006)
Victor Stinner [Mon, 29 Apr 2019 11:04:07 +0000 (13:04 +0200)]
Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006)

This reverts commit b36e5d627d4232a01850707eb78a5067f3fd77f4.

5 years agobpo-36356: Destroy the GIL at exit (GH-12453)
Victor Stinner [Mon, 29 Apr 2019 09:15:56 +0000 (11:15 +0200)]
bpo-36356: Destroy the GIL at exit (GH-12453)

* Add _PyEval_FiniThreads2(). _PyEval_FiniThreads() now only clears
  the pending lock, whereas _PyEval_FiniThreads2() destroys the GIL.
* pymain_free() now calls _PyEval_FiniThreads2().
* Py_FinalizeEx() now calls _PyEval_FiniThreads().

5 years agobpo-36747: Remove the stale scriptsinstall Makefile target (GH-13003)
xdegaye [Mon, 29 Apr 2019 09:01:42 +0000 (11:01 +0200)]
bpo-36747: Remove the stale scriptsinstall Makefile target (GH-13003)

5 years agobpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly (GH...
Joannah Nanjekye [Mon, 29 Apr 2019 08:38:45 +0000 (04:38 -0400)]
bpo-36475: Finalize PyEval_AcquireLock() and PyEval_AcquireThread() properly (GH-12667)

PyEval_AcquireLock() and PyEval_AcquireThread() now
terminate the current thread if called while the interpreter is
finalizing, making them consistent with PyEval_RestoreThread(),
Py_END_ALLOW_THREADS, and PyGILState_Ensure().

5 years ago bpo-21536: On Android, C extensions are linked to libpython (GH-12989)
xdegaye [Mon, 29 Apr 2019 07:27:40 +0000 (09:27 +0200)]
 bpo-21536: On Android, C extensions are linked to libpython (GH-12989)

5 years agoFix typo in 'tandem' word (GH-12998) (GH-12998)
Andrey [Mon, 29 Apr 2019 04:33:26 +0000 (14:33 +1000)]
Fix typo in 'tandem' word (GH-12998) (GH-12998)

5 years agobpo-36546: More tests: type preservation and equal inputs (#13000)
Raymond Hettinger [Mon, 29 Apr 2019 04:31:55 +0000 (21:31 -0700)]
bpo-36546: More tests: type preservation and equal inputs (#13000)

5 years agobpo-36729: Delete unused text variable on tests. (GH-12959)
Emmanuel Arias [Mon, 29 Apr 2019 02:24:24 +0000 (23:24 -0300)]
bpo-36729: Delete unused text variable on tests. (GH-12959)

5 years agobpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)
Zackery Spytz [Sun, 28 Apr 2019 12:58:52 +0000 (06:58 -0600)]
bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)

https://bugs.python.org/issue36745

5 years agobpo-36715: Add usage note for dict.fromkeys() (GH-12974)
Raymond Hettinger [Sun, 28 Apr 2019 07:22:36 +0000 (00:22 -0700)]
bpo-36715: Add usage note for dict.fromkeys() (GH-12974)

5 years agobpo-32424: Improve test coverage for xml.etree.ElementTree (GH-12891)
Gordon P. Hemsley [Sun, 28 Apr 2019 04:41:43 +0000 (00:41 -0400)]
bpo-32424: Improve test coverage for xml.etree.ElementTree (GH-12891)

* Fix typo in test_cyclic_gc subtest
* Improve test coverage for xml.etree.ElementTree

5 years agobpo-2091: Fix typo in exception message (GH-12987)
Berker Peksag [Sat, 27 Apr 2019 19:40:45 +0000 (22:40 +0300)]
bpo-2091: Fix typo in exception message (GH-12987)

5 years agobpo-36025: Fix PyDate_FromTimestamp API (GH-11922)
Paul Ganssle [Sat, 27 Apr 2019 19:39:40 +0000 (15:39 -0400)]
bpo-36025: Fix PyDate_FromTimestamp API (GH-11922)

In the process of converting the date.fromtimestamp function to use
argument clinic in GH-8535, the C API for PyDate_FromTimestamp was
inadvertently changed to expect a timestamp object rather than an
argument tuple.

This PR fixes this backwards-incompatible change by adding a new wrapper
function for the C API function that unwraps the argument tuple and
passes it to the underlying function.

This PR also adds tests for both PyDate_FromTimestamp and
PyDateTime_FromTimestamp to prevent any further regressions.

5 years agobpo-36722: Style and grammar edits for ABI news entries (GH-12979)
Paul Ganssle [Sat, 27 Apr 2019 18:14:35 +0000 (14:14 -0400)]
bpo-36722: Style and grammar edits for ABI news entries (GH-12979)

5 years agoSyntax highlight IDLE html doc code example. (GH-12981)
Terry Jan Reedy [Sat, 27 Apr 2019 03:22:36 +0000 (23:22 -0400)]
Syntax highlight IDLE html doc code example. (GH-12981)

The new markup is currently ignored by IDLE's tk doc display.

5 years agobpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)
Victor Stinner [Fri, 26 Apr 2019 16:56:19 +0000 (18:56 +0200)]
bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)

Py_TRACE_REFS ABI is incompatible with release and debug (Py_DEBUG)
ABI.

5 years agobpo-36722: Add What's New entry for debug ABI (GH-12957)
Victor Stinner [Fri, 26 Apr 2019 15:56:44 +0000 (17:56 +0200)]
bpo-36722: Add What's New entry for debug ABI (GH-12957)

5 years agobpo-21536: Revert Makefile change on python-config (GH-12971)
Victor Stinner [Fri, 26 Apr 2019 15:55:17 +0000 (17:55 +0200)]
bpo-21536: Revert Makefile change on python-config (GH-12971)

Misc/python-config.sh lives in the build directory, not in the source
directory.

5 years agobpo-31525: Increase minimum sqlite version number check (GH-12923)
Charles Pigott [Fri, 26 Apr 2019 15:38:12 +0000 (16:38 +0100)]
bpo-31525: Increase minimum sqlite version number check (GH-12923)

5 years agobpo-36733: Fix PYTHONPATH for make regen-add (GH-12969)
Victor Stinner [Fri, 26 Apr 2019 11:09:47 +0000 (13:09 +0200)]
bpo-36733: Fix PYTHONPATH for make regen-add (GH-12969)

Add PYTHONPATH=$(srcdir) to run $(PYTHON_FOR_REGEN) -m Parser.pgen,
so it's possible to build Python from a different directory.

5 years agobpo-36356: pymain_exit_error() only call pymain_free() for exit (GH-12968)
Victor Stinner [Fri, 26 Apr 2019 11:05:47 +0000 (13:05 +0200)]
bpo-36356: pymain_exit_error() only call pymain_free() for exit (GH-12968)

Add _Py_INIT_HAS_EXITCODE() macro.

5 years agobpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)
Victor Stinner [Fri, 26 Apr 2019 09:12:26 +0000 (11:12 +0200)]
bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)

Regrtest.finalize() now closes explicitly the WindowsLoadTracker
instance.

5 years agobpo-36719: Fix regrtest re-run (GH-12964)
Victor Stinner [Fri, 26 Apr 2019 07:56:37 +0000 (09:56 +0200)]
bpo-36719: Fix regrtest re-run (GH-12964)

Properly handle a test which fail but then pass.

Add test_rerun_success() unit test.

5 years agobpo-36719: regrtest always detect uncollectable objects (GH-12951)
Victor Stinner [Fri, 26 Apr 2019 07:28:53 +0000 (09:28 +0200)]
bpo-36719: regrtest always detect uncollectable objects (GH-12951)

regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.

--findleaks becomes a deprecated alias to --fail-env-changed.

5 years agobpo-36669: add matmul support to weakref.proxy (GH-12932)
Mark Dickinson [Fri, 26 Apr 2019 06:56:15 +0000 (15:56 +0900)]
bpo-36669: add matmul support to weakref.proxy (GH-12932)

5 years agobpo-36725: Refactor regrtest multiprocessing code (GH-12961)
Victor Stinner [Fri, 26 Apr 2019 06:40:25 +0000 (08:40 +0200)]
bpo-36725: Refactor regrtest multiprocessing code (GH-12961)

Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.

Changes:

* Worker processes are now killed immediately if tests are
  interrupted or if a test does crash (CHILD_ERROR): worker
  processes are killed.
* Rewrite how errors in a worker thread are reported to
  the main thread. No longer ignore BaseException or parsing errors
  silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.

5 years agobpo-36724: Add _PyWarnings_Fini() (#12963)
Victor Stinner [Fri, 26 Apr 2019 03:49:26 +0000 (05:49 +0200)]
bpo-36724: Add _PyWarnings_Fini() (#12963)

Py_FinalizeEx() now clears _PyRuntime.warnings variables and
_PyRuntime.exitfuncs.

Changes:

* Add _PyWarnings_Fini(): called by Py_FinalizeEx()
* call_ll_exitfuncs() now clears _PyRuntime.exitfuncs while iterating
  on it (on backward order).

5 years agobpo-36710: Fix compiler warning on PyThreadState_Delete() (GH-12962)
Victor Stinner [Fri, 26 Apr 2019 03:48:51 +0000 (05:48 +0200)]
bpo-36710: Fix compiler warning on PyThreadState_Delete() (GH-12962)

_PyThreadState_Delete() has no return value.

5 years agobpo-36725: regrtest: add TestResult type (GH-12960)
Victor Stinner [Fri, 26 Apr 2019 02:08:53 +0000 (04:08 +0200)]
bpo-36725: regrtest: add TestResult type (GH-12960)

* Add TestResult and MultiprocessResult types to ensure that results
  always have the same fields.
* runtest() now handles KeyboardInterrupt
* accumulate_result() and format_test_result() now takes a TestResult
* cleanup_test_droppings() is now called by runtest() and mark the
  test as ENV_CHANGED if the test leaks support.TESTFN file.
* runtest() now includes code "around" the test in the test timing
* Add print_warning() in test.libregrtest.utils to standardize how
  libregrtest logs warnings to ease parsing the test output.
* support.unload() is now called with abstest rather than test_name
* Rename 'test' variable/parameter to 'test_name'
* dash_R(): remove unused the_module parameter
* Remove unused imports

5 years agobpo-36710: Add runtime parameter in gcmodule.c (GH-12958)
Victor Stinner [Fri, 26 Apr 2019 00:32:01 +0000 (02:32 +0200)]
bpo-36710: Add runtime parameter in gcmodule.c (GH-12958)

Add 'state' or 'runtime' parameter to functions in gcmodule.c to
avoid to rely directly on the global variable _PyRuntime.

5 years agobpo-36710: Add runtime variable in pystate.c (GH-12956)
Victor Stinner [Thu, 25 Apr 2019 23:53:18 +0000 (01:53 +0200)]
bpo-36710: Add runtime variable in pystate.c (GH-12956)

Add 'gilstate', 'runtime' or 'xidregistry' parameter to many
functions on pystate.c to avoid lying on _PyRuntime global.

5 years agobpo-36722: Debug build loads libraries built in release mode (GH-12952)
Victor Stinner [Thu, 25 Apr 2019 23:40:00 +0000 (01:40 +0200)]
bpo-36722: Debug build loads libraries built in release mode (GH-12952)

In debug build, import now also looks for C extensions compiled in
release mode and for C extensions compiled in the stable ABI.

5 years agobpo-35920: Windows 10 ARM32 platform support (GH-11774)
Paul Monson [Thu, 25 Apr 2019 18:36:45 +0000 (11:36 -0700)]
bpo-35920: Windows 10 ARM32 platform support (GH-11774)

5 years agobpo-21536: C extensions are no longer linked to libpython (GH-12946)
Victor Stinner [Thu, 25 Apr 2019 18:13:10 +0000 (20:13 +0200)]
bpo-21536: C extensions are no longer linked to libpython (GH-12946)

On Unix, C extensions are no longer linked to libpython.

It is now possible to load a C extension built using a shared library
Python with a statically linked Python.

When Python is embedded, libpython must not be loaded with
RTLD_LOCAL, but RTLD_GLOBAL instead. Previously, using RTLD_LOCAL, it
was already not possible to load C extensions which were not linked
to libpython, like C extensions of the standard library built by the
"*shared*" section of Modules/Setup.

distutils, python-config and python-config.py have been modified.

5 years agobpo-35537: Document posix_spawn() change in subprocess (GH-11668)
Victor Stinner [Thu, 25 Apr 2019 12:30:16 +0000 (14:30 +0200)]
bpo-35537: Document posix_spawn() change in subprocess (GH-11668)

Document that subprocess.Popen no longer raise an exception on error
like missing program on very specific platforms when using
os.posix_spawn() is used.

5 years agobpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875)
Victor Stinner [Thu, 25 Apr 2019 09:59:34 +0000 (11:59 +0200)]
bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875)

bpo-28552, bpo-7774: Fix distutils.sysconfig if sys.executable is
None or an empty string: use os.getcwd() to initialize project_base.

Fix also the distutils build command: don't use sys.executable if
it's evaluated as false (None or empty string).

5 years agobpo-36465: Fix test_regrtest on Windows (GH-12945)
Victor Stinner [Wed, 24 Apr 2019 23:46:31 +0000 (01:46 +0200)]
bpo-36465: Fix test_regrtest on Windows (GH-12945)

Fix Py_DEBUG constant: check for sys.gettotalrefcount attribute
rather than sys.getobjects.

Update also SpecialBuilds.txt documentation.

5 years agobpo-36465: Make release and debug ABI compatible (GH-12615)
Victor Stinner [Wed, 24 Apr 2019 22:56:28 +0000 (00:56 +0200)]
bpo-36465: Make release and debug ABI compatible (GH-12615)

Release build and debug build are now ABI compatible: the Py_DEBUG
define no longer implies Py_TRACE_REFS define which introduces the
only ABI incompatibility.

A new "./configure --with-trace-refs" build option is now required to
get Py_TRACE_REFS define which adds sys.getobjects() function and
PYTHONDUMPREFS environment variable.

Changes:

* Add ./configure --with-trace-refs
* Py_DEBUG no longer implies Py_TRACE_REFS

5 years agoAdd @pablogsal to code owners file for Parser/pgen (GH-12944)
Pablo Galindo [Wed, 24 Apr 2019 20:25:23 +0000 (21:25 +0100)]
Add @pablogsal to code owners file for Parser/pgen (GH-12944)

Add myself to the codeowners file as I would like to
be automatically added as a reviewer for PRs that touch
that component.

5 years agobpo-36668: FIX reuse semaphore tracker for child processes (#5172)
Thomas Moreau [Wed, 24 Apr 2019 19:45:52 +0000 (21:45 +0200)]
bpo-36668: FIX reuse semaphore tracker for child processes (#5172)

Fix the multiprocessing.semaphore_tracker so it is reused by child processes.

5 years agoIssue 35224: Add PEP 572 (assignment expressions) to What's New (#12941)
Guido van Rossum [Wed, 24 Apr 2019 18:30:17 +0000 (11:30 -0700)]
Issue 35224: Add PEP 572 (assignment expressions) to What's New (#12941)

This is meant as a stub, during the PyCon sprints we can iterate.

5 years agobpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939)
Victor Stinner [Wed, 24 Apr 2019 16:23:53 +0000 (18:23 +0200)]
bpo-36710: Add runtime variable to Py_InitializeEx() (GH-12939)

Py_InitializeEx() now uses a runtime variable passed to subfunctions,
rather than working directly on the global variable _PyRuntime.

Add 'runtime' parameter to _PyCoreConfig_Write(), _PySys_Create(),
_PySys_InitMain(), _PyGILState_Init(),
emit_stderr_warning_for_legacy_locale() and other subfunctions.

5 years agobpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937)
Victor Stinner [Wed, 24 Apr 2019 15:24:01 +0000 (17:24 +0200)]
bpo-36710: Add runtime variable to Py_FinalizeEx() (GH-12937)

* Add a 'runtime' variable to Py_FinalizeEx() rather than working
  directly on the global variable _PyRuntime
* Add a 'runtime' parameter to _PyGC_Fini(), _PyGILState_Fini()
  and call_ll_exitfuncs()

5 years agobpo-30840: Document relative imports (#12831)
Joannah Nanjekye [Wed, 24 Apr 2019 15:14:44 +0000 (11:14 -0400)]
bpo-30840: Document relative imports (#12831)

* document relative imports

* 📜🤖 Added by blurb_it.

* fix indentation error

* remove indentation

* Document relative imports

* Document relative imports

* remove from ...package

* Document relative imports

* remove trailing space

* Document relative imports

* Document relative imports

5 years agobpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936)
Victor Stinner [Wed, 24 Apr 2019 15:14:33 +0000 (17:14 +0200)]
bpo-36710: PyOS_AfterFork_Child() pass runtime parameter (GH-12936)

The PyOS_AfterFork_Child() function now pass a 'runtime' parameter to
subfunctions.

* Fix _PyRuntimeState_ReInitThreads(): use the correct memory allocator
* Add runtime parameter to _PyRuntimeState_ReInitThreads(),
  _PyGILState_Reinit() and _PyInterpreterState_DeleteExceptMain()
* Move _PyGILState_Reinit() to the internal C API.

5 years agobpo-36710: Add runtime parameter to _PyThreadState_Init() (GH-12935)
Victor Stinner [Wed, 24 Apr 2019 14:47:40 +0000 (16:47 +0200)]
bpo-36710: Add runtime parameter to _PyThreadState_Init() (GH-12935)

* Add 'runtime' parameter to _PyThreadState_Init()
* Add 'gilstate' parameter to _PyGILState_NoteThreadState()
* Move _PyThreadState_Init() and _PyThreadState_DeleteExcept()
   to the internal C API.

5 years agobpo-36707: Remove the "m" flag (pymalloc) from SOABI (GH-12931)
Victor Stinner [Wed, 24 Apr 2019 14:10:09 +0000 (16:10 +0200)]
bpo-36707: Remove the "m" flag (pymalloc) from SOABI (GH-12931)

"./configure --with-pymalloc" no longer adds the "m" flag to SOABI
(sys.implementation.cache_tag).

Enabling or disabling pymalloc has no impact on the ABI.

5 years agofix typo in gzip.py (GH-12928)
Maximilian Nöthe [Wed, 24 Apr 2019 09:21:02 +0000 (11:21 +0200)]
fix typo in gzip.py (GH-12928)

5 years agobpo-36454: Fix test_time.test_monotonic() (GH-12929)
Victor Stinner [Tue, 23 Apr 2019 22:15:12 +0000 (00:15 +0200)]
bpo-36454: Fix test_time.test_monotonic() (GH-12929)

Change test_time.test_monotonic() to test only the lower bound of elapsed time
after a sleep command rather than the upper bound. This prevents unnecessary
test failures on slow buildbots. Patch by Victor Stinner.

5 years agoreplace 'sequencial argument' by 'positional' in doc (GH-12925)
Mathieu Dupuy [Tue, 23 Apr 2019 13:01:09 +0000 (15:01 +0200)]
replace 'sequencial argument' by 'positional' in doc (GH-12925)

5 years agobpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)
Zackery Spytz [Tue, 23 Apr 2019 11:56:08 +0000 (05:56 -0600)]
bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)

5 years agofix warnings by adding more const (GH-12924)
Inada Naoki [Tue, 23 Apr 2019 11:39:37 +0000 (20:39 +0900)]
fix warnings by adding more const (GH-12924)