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

5 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)

5 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)

5 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)

5 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)

5 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.

5 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)

5 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)

5 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.

5 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)

5 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)

5 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.

5 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

5 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)

5 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

5 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".

5 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.

5 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.

5 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.

5 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.

5 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.

5 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.

5 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

5 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)

5 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)

5 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.

5 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`.

5 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.

5 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

5 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)

5 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

5 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.

5 years agoRevert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH...
Victor Stinner [Mon, 4 Mar 2019 13:21:28 +0000 (14:21 +0100)]
Revert: bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617) (GH-12159)

* Revert "bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)"

This reverts commit bcfa450f210074e16feb761ae5b3e966a2532fcf.

* Revert "bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)"

This reverts commit bda918bf65a88560ec453aaba0758a9c0d49b449.

* Revert "bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)"

This reverts commit b05b711a2cef6c6c381e01069dedac372e0b9fb2.

* Revert "bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)"

This reverts commit ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.

5 years agobpo-31904: Add encoding support for VxWorks RTOS (GH-12051)
pxinwr [Mon, 4 Mar 2019 09:02:06 +0000 (17:02 +0800)]
bpo-31904: Add encoding support for VxWorks RTOS (GH-12051)

Use UTF-8 as the system encoding on VxWorks.

The main reason are:

1. The locale is frequently misconfigured.
2. Missing some functions to deal with locale in VxWorks C library.

5 years agoClean implementation of Parser/pgen and fix some style issues (GH-12156)
Pablo Galindo [Mon, 4 Mar 2019 07:26:13 +0000 (07:26 +0000)]
Clean implementation of Parser/pgen and fix some style issues (GH-12156)

5 years agobpo-20906: Various revisions to the Unicode howto (#8394)
Andrew Kuchling [Mon, 4 Mar 2019 04:10:28 +0000 (23:10 -0500)]
bpo-20906: Various revisions to the Unicode howto  (#8394)

* bpo-20906: Corrections & revisions to Unicode HOWTO

* bpo-34484: don't describe range as a Private Use Area

5 years agofix typo in configparser doc (GH-12154)
Woko [Mon, 4 Mar 2019 02:23:19 +0000 (10:23 +0800)]
fix typo in configparser doc (GH-12154)

5 years agobpo-35899: Fix Enum handling of empty and weird strings (GH-11891)
Brennan D Baraban [Sun, 3 Mar 2019 22:09:11 +0000 (14:09 -0800)]
bpo-35899: Fix Enum handling of empty and weird strings (GH-11891)

Co-authored-by: Maxwell <maxwellpxt@gmail.com>
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
https://bugs.python.org/issue35899

5 years agobpo-36170: posix_spawn doesn't exist on 3.7 (GH-12143)
Mark Williams [Sun, 3 Mar 2019 17:42:25 +0000 (09:42 -0800)]
bpo-36170: posix_spawn doesn't exist on 3.7 (GH-12143)

The 3.8 docs claim that `os.posix_spawn` was introduced in 3.7, but it wasn't; it will be introduced in 3.8.

5 years agoadd missing break statement (GH-12147)
Inada Naoki [Sun, 3 Mar 2019 16:22:39 +0000 (01:22 +0900)]
add missing break statement (GH-12147)

Bug introduced by 848037c.

5 years agofixed duplicated method name of test_getuserbase() (GH-12140)
native-api [Sun, 3 Mar 2019 16:05:19 +0000 (19:05 +0300)]
fixed duplicated method name of test_getuserbase() (GH-12140)

5 years agobpo-36091: Remove reference to async generator in Lib/types.py. (GH-11996)
Henry Chen [Sun, 3 Mar 2019 14:35:24 +0000 (06:35 -0800)]
bpo-36091: Remove reference to async generator in Lib/types.py. (GH-11996)

5 years agoUse names SEEK_SET, etc instead of magic number (GH-12057)
ngie-eign [Sun, 3 Mar 2019 07:28:26 +0000 (23:28 -0800)]
Use names SEEK_SET, etc instead of magic number (GH-12057)

The previous code hardcoded `SEEK_SET`, etc. While it's very unlikely
that these values will change, it's best to use the definitions to avoid
there being mismatches in behavior with the code in the future.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
5 years agoRemove some code which has been dead since 1994 (#12136)
Alex Gaynor [Sat, 2 Mar 2019 04:37:34 +0000 (23:37 -0500)]
Remove some code which has been dead since 1994 (#12136)

5 years agobpo-36103: change default buffer size of shutil.copyfileobj() (GH-12115)
Inada Naoki [Sat, 2 Mar 2019 04:31:01 +0000 (13:31 +0900)]
bpo-36103: change default buffer size of shutil.copyfileobj() (GH-12115)

It is changed from 16KiB to 64KiB.  The previous default value
is used since 1990.

coreutils chose 128 KiB as minimum buffer size for block device I/O.

But shutil.copyfileobj() can be used for non block devices.
So I choose more conservative value.

As my quick benchmark, performance difference between 64KiB and
128 KiB is up to ~5%.  On the other hand, performance difference
between 32 KiB and 64 KiB can be more than 10% when file is fully
buffered.

This is why 64 KiB is rational value.

5 years agobpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary...
Eric Snow [Fri, 1 Mar 2019 23:50:31 +0000 (16:50 -0700)]
bpo-36097: Use only public C-API in the_xxsubinterpreters module (adding as necessary). (#12003)

5 years agobpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814)
Pablo Galindo [Fri, 1 Mar 2019 23:34:44 +0000 (15:34 -0800)]
bpo-35808: Retire pgen and use pgen2 to generate the parser (GH-11814)

Pgen is the oldest piece of technology in the CPython repository, building it requires various #if[n]def PGEN hacks in other parts of the code and it also depends more and more on CPython internals. This commit removes the old pgen C code and replaces it for a new version implemented in pure Python. This is a modified and adapted version of lib2to3/pgen2 that can generate grammar files compatibles with the current parser.

This commit also eliminates all the #ifdef and code branches related to pgen, simplifying the code and making it more maintainable. The regen-grammar step now uses $(PYTHON_FOR_REGEN) that can be any version of the interpreter, so the new pgen code maintains compatibility with older versions of the interpreter (this also allows regenerating the grammar with the current CI solution that uses Python3.5). The new pgen Python module also makes use of the Grammar/Tokens file that holds the token specification, so is always kept in sync and avoids having to maintain duplicate token definitions.

5 years agobpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. (GH-12031)
Ned Deily [Fri, 1 Mar 2019 22:53:50 +0000 (17:53 -0500)]
bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. (GH-12031)

 Patch by Kevin Walzer.

5 years agobpo-36043: FileCookieJar supports os.PathLike (GH-11945)
Stéphane Wirtel [Fri, 1 Mar 2019 20:40:54 +0000 (21:40 +0100)]
bpo-36043: FileCookieJar supports os.PathLike (GH-11945)

https://bugs.python.org/issue36043

5 years agobpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh...
Eric Snow [Fri, 1 Mar 2019 20:15:45 +0000 (13:15 -0700)]
bpo-33608: Simplify ceval's DISPATCH by hoisting eval_breaker ahead of time. (gh-12062)

This includes fixes to various _Py_atomic_* macros.

5 years agobpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)
Eric Snow [Fri, 1 Mar 2019 19:35:10 +0000 (12:35 -0700)]
bpo-33608: Use _Py_AddPendingCall() in _PyCrossInterpreterData_Release(). (gh-12024)

5 years agobpo-36146: Add TEST_EXTENSIONS to setup.py (GH-12129)
Victor Stinner [Fri, 1 Mar 2019 17:21:49 +0000 (18:21 +0100)]
bpo-36146: Add TEST_EXTENSIONS to setup.py (GH-12129)

Add TEST_EXTENSIONS constant to setup.py to allow to not build test
extensions like _testcapi.

Changes:

* Add add_ldflags_cppflags() subfunction
* Rename add_compiler_directories() to configure_compiler().
* Remove unused COMPILED_WITH_PYDEBUG constant.
* Use self.add() rather than accessing directly self.extensions.
* Remove module_enabled() function: check differently if curses
  extension is built or not.

5 years agobpo-35178: Fix warnings._formatwarnmsg() (GH-12033)
Xtreak [Fri, 1 Mar 2019 17:17:55 +0000 (22:47 +0530)]
bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)

Ensure custom formatwarning function can receive line as positional argument.

Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
5 years agobpo-36142: Add preconfig.c (GH-12128)
Victor Stinner [Fri, 1 Mar 2019 16:52:56 +0000 (17:52 +0100)]
bpo-36142: Add preconfig.c (GH-12128)

* Add _PyArgv_Decode() function
* Move _Py_ClearFileSystemEncoding() and _Py_SetFileSystemEncoding()
  to preconfig.c.

5 years agobpo-36146: Don't run code at setup.py top level (GH-12127)
Victor Stinner [Fri, 1 Mar 2019 16:19:04 +0000 (17:19 +0100)]
bpo-36146: Don't run code at setup.py top level (GH-12127)

* Move set_compiler_flags() calls and concurrent.future hack from
  module top-level to main()
* Remove unused variables 'macros' and 'libraries' from
  detect_multiprocessing().
* Move SUMMARY and CLASSIFIERS constants at the top, move
  set_compiler_flags() function below these constants.
* Add some empty new lines to respect PEP 8.

5 years agobpo-36146: Split setup.py into subfunctions (GH-12125)
Victor Stinner [Fri, 1 Mar 2019 15:43:28 +0000 (16:43 +0100)]
bpo-36146: Split setup.py into subfunctions (GH-12125)

* Split PyBuildExt.detect_modules() huge function into subfunctions.
* Move curses, hashlib and some other code to reorganize the code.
* detect_tkinter() now returns False if the extension is missing.
* Add PyBuildExt.config_h_vars attribute

5 years agobpo-36142: Move command line parsing to coreconfig.c (GH-12123)
Victor Stinner [Fri, 1 Mar 2019 15:25:19 +0000 (16:25 +0100)]
bpo-36142: Move command line parsing to coreconfig.c (GH-12123)

* Add _PyCoreConfig_ReadFromArgv() function which parses command line
  options: move code from main.c to coreconfig.c.
* Add _PyCoreConfig_Write() to write the new configuration: coerce
  the LC_CTYPE locale, set Py_xxx global configuration variables,
  etc.
* _PyCoreConfig_ReadFromArgv() now only changes the LC_CTYPE locale
  temporarily. _PyCoreConfig_Write() becomes responsible to set the
  LC_CTYPE locale.
* Add _Py_SetArgcArgv() and _Py_ClearArgcArgv() functions
* Rename many "pymain_xxx()" functions
* Add "const" to some function parameters
* Reorganize main.c to declare functions in the order in which they
  are called.

5 years agobpo-36146: Refactor setup.py: Add PyBuildExt.srcdir (GH-12124)
Victor Stinner [Fri, 1 Mar 2019 14:59:39 +0000 (15:59 +0100)]
bpo-36146: Refactor setup.py: Add PyBuildExt.srcdir (GH-12124)

* Add PyBuildExt.srcdir atribute in setup.py: the source directory is
  now always absolute.
* Add PyBuildExt.inc_dirs and PyBuildExt.lib_dirs attributes:
  replace 'inc_dirs' and 'lib_dirs' local variables of
  detect_modules().
* Replace "from distutils.errors import *"
  with "from distutils.errors import CCompilerError, DistutilsError"
  to be able to use static analyzers like pyflakes
* Reorder imports.

5 years agobpo-36146: Refactor setup.py: PyBuildExt.add() method (GH-12097)
Victor Stinner [Fri, 1 Mar 2019 14:31:45 +0000 (15:31 +0100)]
bpo-36146: Refactor setup.py: PyBuildExt.add() method (GH-12097)

* Add PyBuildExt.add() which adds the extension directly to
  self.extensions, rather than using a temporary 'exts' local
  variable in detect_modules() and then add 'exts' to self.extensions
* Convert 'missing' local variable from detect_modules()
  into PyBuildExt.missing attribute
* _detect_openssl(), _decimal_ext() and _detect_nis() now call
  directly self.add(), rather than returning an extension
  (or None if not found).
* Rename _decimal_ext() to _detect_decimal() for consistency with
  other methods.

5 years agobpo-36146: Fix inc_dirs in setup.py on macOS (GH-12098)
Victor Stinner [Fri, 1 Mar 2019 12:53:46 +0000 (13:53 +0100)]
bpo-36146: Fix inc_dirs in setup.py on macOS (GH-12098)

Fix setup.py on macOS: only add /usr/include/ffi to include
directories of _ctypes, not for all extensions.

5 years agobpo-36142: Remove _PyMain structure (GH-12120)
Victor Stinner [Fri, 1 Mar 2019 12:10:14 +0000 (13:10 +0100)]
bpo-36142: Remove _PyMain structure (GH-12120)

* Move fields from _PyMain to _PyCoreConfig:

  * skip_first_line
  * run_command
  * run_module
  * run_filename

* Replace _PyMain.stdin_is_interactive with a new
  stdin_is_interactive(config) function
* Rename _PyMain to _PyArgv. Add "const _PyArgv *args" field
  to _PyCmdline.

5 years agobpo-36142: Rework error reporting in pymain_main() (GH-12113)
Victor Stinner [Fri, 1 Mar 2019 11:14:41 +0000 (12:14 +0100)]
bpo-36142: Rework error reporting in pymain_main() (GH-12113)

Add a new _Py_INIT_EXIT() macro to be able to exit Python with an
exitcode using _PyInitError API. Rewrite function calls by
pymain_main() to use _PyInitError.

Changes:

* Remove _PyMain.err and _PyMain.status field
* Add _Py_INIT_EXIT() macro and _PyInitError.exitcode field.
* Rename _Py_FatalInitError() to _Py_ExitInitError().

5 years agobpo-36152: IDLE: Remove unused parameter from colorizer (GH-12109)
Cheryl Sabella [Fri, 1 Mar 2019 10:19:40 +0000 (05:19 -0500)]
bpo-36152: IDLE: Remove unused parameter from colorizer (GH-12109)

Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close().  In IDLE, both have always been None or False since 2007.

5 years agobpo-36155: Check for identity on test_gc.test_get_objects (GH-12116)
Pablo Galindo [Fri, 1 Mar 2019 09:12:27 +0000 (01:12 -0800)]
bpo-36155: Check for identity on test_gc.test_get_objects (GH-12116)

5 years agobpo-36018: Add documentation link to "random variable" (GH-12114)
Raymond Hettinger [Fri, 1 Mar 2019 05:47:26 +0000 (21:47 -0800)]
bpo-36018: Add documentation link to "random variable" (GH-12114)

https://bugs.python.org/issue36018

5 years agobpo-36142: Exclude coreconfig.h from Py_LIMITED_API (GH-12111)
Victor Stinner [Fri, 1 Mar 2019 02:44:13 +0000 (03:44 +0100)]
bpo-36142: Exclude coreconfig.h from Py_LIMITED_API (GH-12111)

The whole coreconfig.h header is now excluded from Py_LIMITED_API.
Move functions definitions into a new internal pycore_coreconfig.h
header.

* Move Include/coreconfig.h to Include/cpython/coreconfig.h
* coreconfig.h header is now excluded from Py_LIMITED_API
* Move functions to pycore_coreconfig.h

5 years agobpo-29571: Fix test_re.test_locale_flag() (GH-12099)
Victor Stinner [Thu, 28 Feb 2019 23:08:03 +0000 (00:08 +0100)]
bpo-29571: Fix test_re.test_locale_flag() (GH-12099)

Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.

For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.

5 years agobpo-36018: Add special value tests and make minor tweaks to the docs (GH-12096)
Raymond Hettinger [Thu, 28 Feb 2019 17:16:25 +0000 (09:16 -0800)]
bpo-36018: Add special value tests and make minor tweaks to the docs (GH-12096)

https://bugs.python.org/issue36018

5 years agoAdd versionadded directives to ssl.minimum_version and ssl.maximum_version (GH-11894)
Zhiming Wang [Thu, 28 Feb 2019 17:15:04 +0000 (01:15 +0800)]
Add versionadded directives to ssl.minimum_version and ssl.maximum_version (GH-11894)

5 years agobpo-36146: Refactor setup.py (GH-12093)
Victor Stinner [Thu, 28 Feb 2019 16:48:38 +0000 (17:48 +0100)]
bpo-36146: Refactor setup.py (GH-12093)

* Rename globals to upper case to better distinguish if a variable is
  global or local:

  * Rename cross_compiling to CROSS_COMPILING
  * Rename host_platform to HOST_PLATFORM
  * Rename disabled_module_list to DISABLED_MODULE_LIST

* Add MS_WINDOWS, CYGWIN and MACOS constants.
* Use booleans: replace "return 0" with "return False"
  and replace "return 1" with "return True"

5 years agoDocument the surprising sideeffect PyErr_Print(). (#12081)
Gregory P. Smith [Wed, 27 Feb 2019 23:27:32 +0000 (15:27 -0800)]
Document the surprising sideeffect PyErr_Print(). (#12081)

Did you know an API documented as printing the pending traceback would sometimes exit the process?

You do now.

5 years agoFix grammar error in timeit module docs (GH-12066)
Shiv Dhar [Wed, 27 Feb 2019 23:21:15 +0000 (04:51 +0530)]
Fix grammar error in timeit module docs (GH-12066)

skip issue
skip news

5 years agoUpdate FAQ to point to Infrastructure Team website. (GH-12077)
Ned Deily [Wed, 27 Feb 2019 22:23:34 +0000 (17:23 -0500)]
Update FAQ to point to Infrastructure Team website. (GH-12077)

5 years agobpo-36096: IDLE: Refactor class variables in colorizer (GH-12002)
Cheryl Sabella [Wed, 27 Feb 2019 13:21:16 +0000 (08:21 -0500)]
bpo-36096: IDLE: Refactor class variables in colorizer (GH-12002)

5 years agobpo-31904: Add cross-build support for VxWorks RTOS (GH-11968)
pxinwr [Wed, 27 Feb 2019 11:09:28 +0000 (19:09 +0800)]
bpo-31904: Add cross-build support for VxWorks RTOS (GH-11968)

5 years agobpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition (GH-12053)
Joannah Nanjekye [Tue, 26 Feb 2019 16:18:23 +0000 (19:18 +0300)]
bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition (GH-12053)

Use longer timeout for accept() in the server and block on accept in the client.
The client now only sets the timeout once the socket is connected.

5 years agobpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry instead of...
Giampaolo Rodola [Tue, 26 Feb 2019 11:04:41 +0000 (12:04 +0100)]
bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry instead of path str (GH-11997)

5 years agocloses bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)
Benjamin Peterson [Tue, 26 Feb 2019 07:12:10 +0000 (23:12 -0800)]
closes bpo-36115: Fix some reference leaks in typeobject.c. (GH-12045)

a24107b04c1277e3c1105f98aff5bfa3a98b33a0 introduced a few refleaks.

https://bugs.python.org/issue36115

5 years agobpo-36106: Resolve sinpi name clash with libm (IEEE-754 violation). (GH-12027)
Dima Pasechnik [Tue, 26 Feb 2019 06:36:11 +0000 (06:36 +0000)]
bpo-36106: Resolve sinpi name clash with libm (IEEE-754 violation). (GH-12027)

The standard math library (libm) may follow IEEE-754 recommendation to
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
And this triggers a name clash, found by FreeBSD developer
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
(it has to be named "sinpi", not "sinPi", cf. e.g.
https://en.cppreference.com/w/c/experimental/fpext4).

5 years agobpo-36109: Fix random test_descr failure. (GH-12044)
Serhiy Storchaka [Tue, 26 Feb 2019 06:03:21 +0000 (08:03 +0200)]
bpo-36109: Fix random test_descr failure. (GH-12044)

5 years agoRun autoreconf.
Benjamin Peterson [Tue, 26 Feb 2019 05:37:59 +0000 (21:37 -0800)]
Run autoreconf.

5 years agocloses bpo-13497: Fix `broken nice` configure test. (GH-12041)
ngie-eign [Tue, 26 Feb 2019 05:34:24 +0000 (21:34 -0800)]
closes bpo-13497: Fix `broken nice` configure test. (GH-12041)

Per POSIX, `nice(3)` requires `unistd.h` and `exit(3)` requires `stdlib.h`.

Fixing the test will prevent false positives with pedantic compilers like clang.

5 years agobpo-24643: Fix "#define timezone _timezone" clashes on Windows (GH-12019)
Zackery Spytz [Mon, 25 Feb 2019 23:56:44 +0000 (16:56 -0700)]
bpo-24643: Fix "#define timezone _timezone" clashes on Windows (GH-12019)

5 years agobpo-36102: Prepend slash to all POSIX shared memory block names (#12036)
Davin Potts [Mon, 25 Feb 2019 22:41:52 +0000 (16:41 -0600)]
bpo-36102: Prepend slash to all POSIX shared memory block names (#12036)

5 years agoClean up code which checked presence of os.{stat,lstat,chmod} (#11643)
Anthony Sottile [Mon, 25 Feb 2019 22:32:27 +0000 (14:32 -0800)]
Clean up code which checked presence of os.{stat,lstat,chmod} (#11643)

5 years agoAutospec functions should propagate mock calls to parent GH-11273
Xtreak [Mon, 25 Feb 2019 21:46:34 +0000 (03:16 +0530)]
Autospec functions should propagate mock calls to parent GH-11273

5 years agobpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)
Sergey Fedoseev [Mon, 25 Feb 2019 21:37:26 +0000 (02:37 +0500)]
bpo-36030: Remove _PyStack_AsTuple() and _PyStack_AsTupleSlice() (GH-12032)

5 years agoPost v3.8.0a2
Łukasz Langa [Mon, 25 Feb 2019 20:08:21 +0000 (21:08 +0100)]
Post v3.8.0a2

5 years agoMerge tag 'v3.8.0a2'
Łukasz Langa [Mon, 25 Feb 2019 20:07:31 +0000 (21:07 +0100)]
Merge tag 'v3.8.0a2'

Python 3.8.0a2

5 years agobpo-36030: Add _PyTuple_FromArray() function (GH-11954)
Sergey Fedoseev [Mon, 25 Feb 2019 16:59:12 +0000 (21:59 +0500)]
bpo-36030: Add _PyTuple_FromArray() function (GH-11954)

5 years agoRemove empty Dictionaries section from programming FAQ (GH-12026)
Andre Delfino [Mon, 25 Feb 2019 16:22:07 +0000 (13:22 -0300)]
Remove empty Dictionaries section from programming FAQ (GH-12026)

5 years agobpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
Serhiy Storchaka [Mon, 25 Feb 2019 15:59:46 +0000 (17:59 +0200)]
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)

5 years agobpo-28450: Fix and improve the documentation for unknown escapes in RE. (GH-11920)
Serhiy Storchaka [Mon, 25 Feb 2019 15:58:30 +0000 (17:58 +0200)]
bpo-28450: Fix and improve the documentation for unknown escapes in RE. (GH-11920)

5 years agobpo-36048: Use __index__() instead of __int__() for implicit conversion if available...
Serhiy Storchaka [Mon, 25 Feb 2019 15:57:58 +0000 (17:57 +0200)]
bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)

Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.

5 years agoCorrect name of 'defaultobj' parameter in PyDict_SetDefault() signature. (GH-11929)
Sergey Fedoseev [Mon, 25 Feb 2019 14:52:40 +0000 (19:52 +0500)]
Correct name of 'defaultobj' parameter in PyDict_SetDefault() signature. (GH-11929)

5 years agov3.8.0a2 v3.8.0a2
Łukasz Langa [Mon, 25 Feb 2019 12:08:32 +0000 (13:08 +0100)]
v3.8.0a2

5 years agocloses bpo-36083: Fix formatting of the manpage Synopsis. (GH-12017)
Miro Hrončok [Mon, 25 Feb 2019 00:50:29 +0000 (01:50 +0100)]
closes bpo-36083: Fix formatting of the manpage Synopsis. (GH-12017)

More specifically, the options of --check-hash-based-pycs.

5 years agobpo-33671: allow setting shutil.copyfile() bufsize globally (GH-12016)
Giampaolo Rodola [Sun, 24 Feb 2019 23:46:40 +0000 (15:46 -0800)]
bpo-33671: allow setting shutil.copyfile() bufsize globally (GH-12016)

5 years agobpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)
Eric Snow [Sun, 24 Feb 2019 23:40:47 +0000 (15:40 -0800)]
bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)

This involves moving the global "pending calls" state to PyInterpreterState.

https://bugs.python.org/issue33608

5 years agobpo-36101: remove non-ascii characters in docstring (GH-12018)
animalize [Sun, 24 Feb 2019 23:18:48 +0000 (07:18 +0800)]
bpo-36101: remove non-ascii characters in docstring (GH-12018)

* remove non-ascii characters in docstring
* clinic.py emits a warning when docstring has non-ascii character