]> granicus.if.org Git - python/log
python
6 years agobpo-25652: Fix __rmod__ of UserString (GH-13326)
Batuhan Taşkaya [Tue, 21 May 2019 20:27:36 +0000 (23:27 +0300)]
bpo-25652: Fix __rmod__ of UserString (GH-13326)

The ``__rmod__`` method of ``collections.UserString`` class had a bug that made it unusable.

https://bugs.python.org/issue25652

6 years agobpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)
Matthias Bussonnier [Tue, 21 May 2019 20:12:03 +0000 (13:12 -0700)]
bpo-34616: Add PyCF_ALLOW_TOP_LEVEL_AWAIT to allow top-level await (GH-13148)

Co-Authored-By: Yury Selivanov <yury@magic.io>
6 years agobpo-23378: Add an extend action to argparse (GH-13305)
Batuhan Taşkaya [Tue, 21 May 2019 17:47:42 +0000 (20:47 +0300)]
bpo-23378: Add an extend action to argparse (GH-13305)

Add an extend action to argparse

https://bugs.python.org/issue23378

6 years agobpo-36035: fix Path.rglob for broken links (GH-11988)
Jörg Stucke [Tue, 21 May 2019 17:44:40 +0000 (19:44 +0200)]
bpo-36035: fix Path.rglob for broken links (GH-11988)

Links creating an infinite symlink loop would raise an exception.

6 years agobpo-36929: Modify io/re tests to allow for missing mod name (#13392)
Max Bernstein [Tue, 21 May 2019 17:09:21 +0000 (10:09 -0700)]
bpo-36929: Modify io/re tests to allow for missing mod name (#13392)

* bpo-36929: Modify io/re tests to allow for missing mod name

For a vanishingly small number of internal types, CPython sets the
tp_name slot to mod_name.type_name, either in the PyTypeObject or the
PyType_Spec. There are a few minor places where this surfaces:

* Custom repr functions for those types (some of which ignore the
  tp_name in favor of using a string literal, such as _io.TextIOWrapper)
* Pickling error messages

The test suite only tests the former. This commit modifies the test
suite to allow Python implementations to omit the module prefix.

https://bugs.python.org/issue36929

6 years agoAnnotate the unexplained assignment in exception unbinding (GH-11448)
Chris Angelico [Tue, 21 May 2019 13:34:19 +0000 (23:34 +1000)]
Annotate the unexplained assignment in exception unbinding (GH-11448)

6 years agobpo-36648: fix mmap issue for VxWorks (GH-12394)
Lihua Zhao [Tue, 21 May 2019 10:50:14 +0000 (18:50 +0800)]
bpo-36648: fix mmap issue for VxWorks (GH-12394)

The mmap module set MAP_SHARED flag when map anonymous memory, however VxWorks
only support MAP_PRIVATE when map anonymous memory, this commit clear MAP_SHARED
and set MAP_PRIVATE.

6 years agobpo-31904: Add posix module support for VxWorks (GH-12118)
pxinwr [Tue, 21 May 2019 10:46:37 +0000 (18:46 +0800)]
bpo-31904: Add posix module support for VxWorks (GH-12118)

6 years agoRevert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" ...
Victor Stinner [Tue, 21 May 2019 10:44:57 +0000 (12:44 +0200)]
Revert "bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)" (GH-13458)

This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.

6 years agobpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421)
Erik Janssens [Tue, 21 May 2019 10:11:11 +0000 (12:11 +0200)]
bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421)

Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant.
Moreover, include windows.h on Windows, not only when MSC is used.

6 years agoFix RuntimeWarning in unittest.mock asyncio example (GH-13449)
Xtreak [Tue, 21 May 2019 08:47:17 +0000 (14:17 +0530)]
Fix RuntimeWarning in unittest.mock asyncio example (GH-13449)

* This PR fixes the `RuntimeWarning` in `inspect.isawaitable(mock())` where `mock()` was not awaited.
* Fix typo in asynctest project.

6 years agobpo-36932: use proper deprecation-removed directive (GH-13349)
Matthias Bussonnier [Tue, 21 May 2019 06:20:10 +0000 (23:20 -0700)]
bpo-36932: use proper deprecation-removed directive (GH-13349)

.. And update some deprecation warnings with version numbers.

https://bugs.python.org/issue36932

6 years agoRemove workaround for defaults in namedtuple now that we have the defaults parameter...
Andre Delfino [Tue, 21 May 2019 00:52:17 +0000 (21:52 -0300)]
Remove workaround for defaults in namedtuple now that we have the defaults parameter (GH-13263)

6 years agobpo-35563: Add reference links to warnings.rst (GH-11289)
Cheryl Sabella [Mon, 20 May 2019 22:45:05 +0000 (18:45 -0400)]
bpo-35563: Add reference links to warnings.rst (GH-11289)

6 years agobpo-36969: Make PDB args command display keyword only arguments (GH-13452)
Rémi Lapeyre [Mon, 20 May 2019 22:17:30 +0000 (00:17 +0200)]
bpo-36969: Make PDB args command display keyword only arguments (GH-13452)

6 years agobpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)
Matthias Bussonnier [Mon, 20 May 2019 20:44:11 +0000 (13:44 -0700)]
bpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)

This parameter is marked as deprecated since 3.6 and for removal in 3.8.
It already had no effects.

6 years agobpo-23896: Add a grammar where exec isn't a stmt (#13272)
Batuhan Taşkaya [Mon, 20 May 2019 20:27:10 +0000 (23:27 +0300)]
bpo-23896: Add a grammar where exec isn't a stmt (#13272)

https://bugs.python.org/issue23896

6 years agobpo-36888: Add multiprocessing.parent_process() (GH-13247)
Thomas Moreau [Mon, 20 May 2019 19:37:05 +0000 (21:37 +0200)]
bpo-36888: Add multiprocessing.parent_process() (GH-13247)

6 years agobpo-36949: Implement __repr__ on WeakSet (GH-13415)
Batuhan Taşkaya [Mon, 20 May 2019 17:01:07 +0000 (20:01 +0300)]
bpo-36949: Implement __repr__ on WeakSet (GH-13415)

6 years agobpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296)
Lisa Roach [Mon, 20 May 2019 16:19:53 +0000 (09:19 -0700)]
bpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296)

6 years agobpo-36763: Fix _PyRuntime.preconfig.coerce_c_locale (GH-13444)
Victor Stinner [Mon, 20 May 2019 15:16:38 +0000 (17:16 +0200)]
bpo-36763: Fix _PyRuntime.preconfig.coerce_c_locale (GH-13444)

_PyRuntime.preconfig.coerce_c_locale can now be used to
check if the C locale has been coerced.

* Fix _Py_LegacyLocaleDetected(): don't attempt to coerce the
  C locale if LC_ALL environment variable is set. Add 'warn'
  parameter: emit_stderr_warning_for_legacy_locale() must not
  the LC_ALL env var.
* _PyPreConfig_Write() sets coerce_c_locale to 0 if
  _Py_CoerceLegacyLocale() fails.

6 years agobpo-22865: Expand on documentation for the pty.spawn function (GH-11980)
Geoff Shannon [Mon, 20 May 2019 15:06:16 +0000 (08:06 -0700)]
bpo-22865: Expand on documentation for the pty.spawn function (GH-11980)

6 years agoPass _asyncio_internal=True into stream tests on windows (#13442)
Andrew Svetlov [Mon, 20 May 2019 14:38:57 +0000 (17:38 +0300)]
Pass _asyncio_internal=True into stream tests on windows (#13442)

6 years agobpo-36763: Fix encoding/locale tests in test_embed (GH-13443)
Victor Stinner [Mon, 20 May 2019 14:38:48 +0000 (16:38 +0200)]
bpo-36763: Fix encoding/locale tests in test_embed (GH-13443)

* Fix encoding and locale tests in test_embed.InitConfigTests.
* InitConfigTests now only computes EXPECTED_CONFIG once.
* Add tests for PYTHONWARNINGS and PYTHONPATH env vars

6 years agobpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails (GH-11553)
Niklas Fiekas [Mon, 20 May 2019 12:02:17 +0000 (14:02 +0200)]
bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails (GH-11553)

This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it.

https://bugs.python.org/issue35721

6 years agobpo-36763: Fix Python preinitialization (GH-13432)
Victor Stinner [Mon, 20 May 2019 09:02:00 +0000 (11:02 +0200)]
bpo-36763: Fix Python preinitialization (GH-13432)

* Add _PyPreConfig.parse_argv
* Add _PyCoreConfig._config_init field and _PyCoreConfigInitEnum enum
  type
* Initialization functions: reject preconfig=NULL and config=NULL
* Add config parameter to _PyCoreConfig_DecodeLocaleErr(): pass
  config->argv to _Py_PreInitializeFromPyArgv(), to parse config
  command line arguments in preinitialization.
* Add config parameter to _PyCoreConfig_SetString(). It now
  preinitializes Python.
* _PyCoreConfig_SetPyArgv() now also preinitializes Python for wide
  argv
* Fix _Py_PreInitializeFromCoreConfig(): don't pass args to
  _Py_PreInitializeFromPyArgv() if config.parse_argv=0.
* Use "char * const *" and "wchar_t * const *" types for 'argv'
  parameters and _PyArgv.argv.
* Add unit test on preinitialization from argv.
* _PyPreConfig.allocator type becomes int
* Add _PyPreConfig_InitFromPreConfig() and
  _PyPreConfig_InitFromCoreConfig() helper functions

6 years agobpo-36958: In IDLE, print exit message (GH-13435)
Terry Jan Reedy [Mon, 20 May 2019 02:52:22 +0000 (22:52 -0400)]
bpo-36958: In IDLE, print exit message (GH-13435)

Print any argument other than None or int passed to SystemExit
or sys.exit().

6 years agocloses bpo-36951: Correct some types in the type_members struct in typeobject.c....
Zackery Spytz [Mon, 20 May 2019 00:26:35 +0000 (18:26 -0600)]
closes bpo-36951: Correct some types in the type_members struct in typeobject.c. (GH-13403)

6 years agobpo-35134: Register new traceback.h header files (GH-13431)
Victor Stinner [Mon, 20 May 2019 00:22:32 +0000 (02:22 +0200)]
bpo-35134: Register new traceback.h header files (GH-13431)

Add new cpython/traceback.h and pycore_traceback.h header files to
Makefile.pre.in and PCbuild/ project.

6 years agobpo-35134: Split traceback.h header (GH-13430)
Victor Stinner [Sun, 19 May 2019 22:14:57 +0000 (00:14 +0200)]
bpo-35134: Split traceback.h header (GH-13430)

Add new Include/cpython/traceback.h and Include/internal/traceback.h
header files.

6 years agobpo-35252: Remove FIXME from test_functools (GH-10551)
Lysandros Nikolaou [Sun, 19 May 2019 22:11:21 +0000 (00:11 +0200)]
bpo-35252: Remove FIXME from test_functools (GH-10551)

6 years agobpo-34580: Update sqlite3 examples to call close() explicitly (GH-9079)
Xtreak [Sun, 19 May 2019 21:52:20 +0000 (03:22 +0530)]
bpo-34580: Update sqlite3 examples to call close() explicitly (GH-9079)

The sqlit3.Connection object doesn't call its close() method when it's used
as a context manager.

6 years agobpo-36957: Speed up math.isqrt (#13405)
Mark Dickinson [Sun, 19 May 2019 16:51:56 +0000 (17:51 +0100)]
bpo-36957: Speed up math.isqrt (#13405)

* Add math.isqrt function computing the integer square root.

* Code cleanup: remove redundant comments, rename some variables.

* Tighten up code a bit more; use Py_XDECREF to simplify error handling.

* Update Modules/mathmodule.c

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* Update Modules/mathmodule.c

Use real argument clinic type instead of an alias

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* Add proof sketch

* Updates from review.

* Correct and expand documentation.

* Fix bad reference handling on error; make some variables block-local; other tidying.

* Style and consistency fixes.

* Add missing error check; don't try to DECREF a NULL a

* Simplify some error returns.

* Another two test cases:

- clarify that floats are rejected even if they happen to be
  squares of small integers
- TypeError beats ValueError for a negative float

* Add fast path for small inputs. Needs tests.

* Speed up isqrt for n >= 2**64 as well; add extra tests.

* Reduce number of test-cases to avoid dominating the run-time of test_math.

* Don't perform unnecessary extra iterations when computing c_bit_length.

* Abstract common uint64_t code out into a separate function.

* Cleanup.

* Add a missing Py_DECREF in an error branch. More cleanup.

* Update Modules/mathmodule.c

Add missing `static` declaration to helper function.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* Add missing backtick.

6 years agobpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)
Berker Peksag [Sun, 19 May 2019 15:56:15 +0000 (18:56 +0300)]
bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)

6 years agobpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)
Bar Harel [Sun, 19 May 2019 13:57:13 +0000 (16:57 +0300)]
bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)

6 years agobpo-36948: Fix NameError in urllib.request.URLopener.retrieve (GH-13389)
Xtreak [Sun, 19 May 2019 13:40:06 +0000 (19:10 +0530)]
bpo-36948: Fix NameError in urllib.request.URLopener.retrieve (GH-13389)

6 years agobpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)
Serhiy Storchaka [Sun, 19 May 2019 11:14:38 +0000 (14:14 +0300)]
bpo-36957: Add _PyLong_Rshift() and _PyLong_Lshift(). (GH-13416)

6 years agoOrthographical fix (GH-13418)
Boštjan Mejak [Sun, 19 May 2019 09:01:36 +0000 (11:01 +0200)]
Orthographical fix (GH-13418)

Add a missing comma.

6 years agoFix typo in test comment (GH-11442)
Ashwin Ramaswami [Sun, 19 May 2019 01:17:48 +0000 (18:17 -0700)]
Fix typo in test comment (GH-11442)

6 years agobpo-33519: clarify that .copy() is not part of the MutableSequence ABC (GH-6965)
Jelle Zijlstra [Sun, 19 May 2019 00:17:56 +0000 (17:17 -0700)]
bpo-33519: clarify that .copy() is not part of the MutableSequence ABC (GH-6965)

6 years agobpo-36961: Handle positional-only arguments in uparse.c (GH-13412)
Pablo Galindo [Sat, 18 May 2019 22:40:22 +0000 (23:40 +0100)]
bpo-36961: Handle positional-only arguments in uparse.c (GH-13412)

6 years agoAdd support for PEP572 in ast_unparse.c (GH-13337)
Batuhan Taşkaya [Sat, 18 May 2019 22:10:20 +0000 (01:10 +0300)]
Add support for PEP572 in ast_unparse.c (GH-13337)

6 years agobpo-36567: Use manpages_url to create links for man pages (GH-13339)
Batuhan Taşkaya [Sat, 18 May 2019 21:53:53 +0000 (00:53 +0300)]
bpo-36567: Use manpages_url to create links for man pages (GH-13339)

6 years agobpo-19376: Added doc mentioning `datetime.strptime()` without a year fails for Feb...
Abhishek Kumar Singh [Sat, 18 May 2019 20:36:19 +0000 (02:06 +0530)]
bpo-19376: Added doc mentioning `datetime.strptime()` without a year fails for Feb 29. (GH-10243)

6 years agobpo-2180: Treat line continuation at EOF as a `SyntaxError` (GH-13401)
Anthony Sottile [Sat, 18 May 2019 18:27:17 +0000 (11:27 -0700)]
bpo-2180: Treat line continuation at EOF as a `SyntaxError` (GH-13401)

This makes the parser consistent with the tokenize module (already the case
in `pypy`).

sample
------

```python
x = 5\
```

before
------

```console
$ python3 t.py
$ python3 -mtokenize t.py
t.py:2:0: error: EOF in multi-line statement
```

after
-----

```console
$ ./python t.py
  File "t.py", line 3
    x = 5\

         ^
SyntaxError: unexpected EOF while parsing
$ ./python -m tokenize t.py
t.py:2:0: error: EOF in multi-line statement
```

https://bugs.python.org/issue2180

6 years agobpo-36546: Add more tests and expand docs (#13406)
Raymond Hettinger [Sat, 18 May 2019 17:18:29 +0000 (10:18 -0700)]
bpo-36546: Add more tests and expand docs (#13406)

6 years agobpo-36887: add math.isqrt (GH-13244)
Mark Dickinson [Sat, 18 May 2019 11:29:50 +0000 (12:29 +0100)]
bpo-36887: add math.isqrt (GH-13244)

* Add math.isqrt function computing the integer square root.

* Code cleanup: remove redundant comments, rename some variables.

* Tighten up code a bit more; use Py_XDECREF to simplify error handling.

* Update Modules/mathmodule.c

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* Update Modules/mathmodule.c

Use real argument clinic type instead of an alias

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
* Add proof sketch

* Updates from review.

* Correct and expand documentation.

* Fix bad reference handling on error; make some variables block-local; other tidying.

* Style and consistency fixes.

* Add missing error check; don't try to DECREF a NULL a

* Simplify some error returns.

* Another two test cases:

- clarify that floats are rejected even if they happen to be
  squares of small integers
- TypeError beats ValueError for a negative float

* Documentation and markup improvements; thanks Serhiy for the suggestions!

* Cleaner Misc/NEWS entry wording.

* Clean up (with one fix) to the algorithm explanation and proof.

6 years agobpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)
Victor Stinner [Sat, 18 May 2019 02:17:01 +0000 (04:17 +0200)]
bpo-36763: Remove _PyCoreConfig.dll_path (GH-13402)

6 years agobpo-36763: Use _PyCoreConfig_InitPythonConfig() (GH-13398)
Victor Stinner [Sat, 18 May 2019 01:21:27 +0000 (03:21 +0200)]
bpo-36763: Use _PyCoreConfig_InitPythonConfig() (GH-13398)

_PyPreConfig_InitPythonConfig() and _PyCoreConfig_InitPythonConfig()
no longer inherit their values from global configuration variables.

Changes:

* _PyPreCmdline_Read() now ignores -X dev and PYTHONDEVMODE
  if dev_mode is already set.
* Inline _PyPreConfig_INIT macro into _PyPreConfig_Init() function.
* Inline _PyCoreConfig_INIT macro into _PyCoreConfig_Init() function.
* Replace _PyCoreConfig_Init() with _PyCoreConfig_InitPythonConfig()
  in most tests of _testembed.c.
* Replace _PyCoreConfig_Init() with _PyCoreConfig_InitIsolatedConfig()
  in _freeze_importlib.c.
* Move some initialization functions from the internal
  to the private API.

6 years agoFix couple of dead code paths (GH-7418)
David Carlier [Fri, 17 May 2019 23:46:22 +0000 (23:46 +0000)]
Fix couple of dead code paths (GH-7418)

6 years agoDocument a workaround for a curses bug (GH-13209)
Toshio Kuratomi [Fri, 17 May 2019 22:54:02 +0000 (18:54 -0400)]
Document a workaround for a curses bug (GH-13209)

6 years agoCorrect typos in the Barrier specification (GH-9395)
Géry Ogam [Fri, 17 May 2019 22:44:57 +0000 (00:44 +0200)]
Correct typos in the Barrier specification (GH-9395)

6 years agobpo-36763: _Py_InitializeFromArgs() argc becomes Py_ssize_t (GH-13396)
Victor Stinner [Fri, 17 May 2019 22:38:16 +0000 (00:38 +0200)]
bpo-36763: _Py_InitializeFromArgs() argc becomes Py_ssize_t (GH-13396)

* The type of initlization function 'argc' parameters becomes
  Py_ssize_t, instead of int.
* Change _PyPreConfig_Copy() return type to void, instead of int.
  The function cannot fail anymore.
* Fix compilation warnings on Windows.

6 years agobpo-27268: Fix incorrect error message on float('') (GH-2745)
Pedro Lacerda [Fri, 17 May 2019 22:32:44 +0000 (19:32 -0300)]
bpo-27268: Fix incorrect error message on float('') (GH-2745)

6 years agobpo-36763: Add _PyInitError functions (GH-13395)
Victor Stinner [Fri, 17 May 2019 21:54:00 +0000 (23:54 +0200)]
bpo-36763: Add _PyInitError functions (GH-13395)

* Add _PyInitError functions:

  * _PyInitError_Ok()
  * _PyInitError_Error()
  * _PyInitError_NoMemory()
  * _PyInitError_Exit()
  * _PyInitError_IsError()
  * _PyInitError_IsExit()
  * _PyInitError_Failed()

* frozenmain.c and _testembed.c now use functions rather than macros.
* Move _Py_INIT_xxx() macros to the internal API.
* Move _PyWstrList_INIT macro to the internal API.

6 years agobpo-36763: _Py_RunMain() doesn't call Py_Exit() anymore (GH-13390)
Victor Stinner [Fri, 17 May 2019 21:05:29 +0000 (23:05 +0200)]
bpo-36763: _Py_RunMain() doesn't call Py_Exit() anymore (GH-13390)

Py_Main() and _Py_RunMain() now return the exitcode rather than
calling Py_Exit(exitcode) when calling PyErr_Print() if the current
exception type is SystemExit.

* Add _Py_HandleSystemExit().
* Add pymain_exit_err_print().
* Add pymain_exit_print().

6 years agobpo-36945: Add _PyPreConfig.configure_locale (GH-13368)
Victor Stinner [Fri, 17 May 2019 20:44:16 +0000 (22:44 +0200)]
bpo-36945: Add _PyPreConfig.configure_locale (GH-13368)

_PyPreConfig_InitIsolatedConfig() sets configure_locale to 0 to
prevent Python to modify the LC_CTYPE locale. In that case,
coerce_c_locale an coerce_c_locale_warn are set to 0 as well.

6 years agobpo-36782: Created C API wrappers and added missing tests for functions in the PyDate...
Edison A [Fri, 17 May 2019 20:28:42 +0000 (13:28 -0700)]
bpo-36782: Created C API wrappers and added missing tests for functions in the PyDateTimeAPI. (#13088)

* created a c API wrapper for pyDate_FromDate and added the test

* 📜🤖 Added by blurb_it.

* fixed auto-alignment by vscode

* made changes as per PEP7

* Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst

* Refactored code as per requested changes

* Remove Whitespace to Fix failed travis build

* Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst

* Add a new line at end of ACKS

* Added C API function for PyDateTime_FromDateAndTime

* Added a test for the C API wrapper of PyDateTime_FromDateAndTime

* Added C API function for PyDateTime_FromDateAndTime

* Added a test for the C API wrapper of PyDateTime_FromDateAndTimeAndFold

* Remove Whitespace using patchcheck

* Added a C API function for PyTime_FromTime

* Added a test for the C API wrapper of PyTime_FromTime

* Added a C API function for PyTime_FromTimeAndFold

* Added a test for the C API wrapper of PyTime_FromTimeAndFold

* Added a C API function for PyDelta_FromDSU

* Added a test for the C API wrapper of PyDelta_FromDSU

* Refactor code, re-edit lines longer than 80 chars

* Fix Whitespace issues in DatetimeTester

* List all tests that were added in this PR

* Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst

* Reformat code as per PEP7 guidelines

* Remove unused varibles from another function

* Added specific tests for the Fold Attribute

* Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst

* Reformat code according to requested changes

* Reformat code to PEP7 Guidelines

* Reformat code to PEP7 Guidelines

* Re-add name to blurb

* Added a backtick to blurb file

* Update 2019-05-04-21-25-19.bpo-36782.h3oPIb.rst

* Remove the need to initialize mandatory parameters

* Make the macro parameter mandatory

* Re-arrange the order of unit-test args

* Removed the need to initialize macro

change all the int macro = 0 to int macro; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* Removed the need to initialize macro

change all the `int macro = 0` to `int macro`; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* Removed the need to initialize macro

change all the `int macro = 0` to `int macro`; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* Removed the need to initialize macro

change all the `int macro = 0` to `int macro`; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* Removed the need to initialize macro

change all the `int macro = 0` to `int macro`; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
* Removed the need to initialize macro

change all the `int macro = 0` to `int macro`; now that macro is required

Co-Authored-By: Paul Ganssle <pganssle@users.noreply.github.com>
6 years agobpo-33524: Fix the folding of email header when max_line_length is 0 or None (#13391)
Abhilash Raj [Fri, 17 May 2019 19:28:44 +0000 (12:28 -0700)]
bpo-33524: Fix the folding of email header when max_line_length is 0 or None (#13391)

and there are non-ascii characters in the header.

6 years agobpo-36867: _test_multiprocessing: avoid weak sync primitive (GH-13292)
Pierre Glaser [Fri, 17 May 2019 18:20:07 +0000 (20:20 +0200)]
bpo-36867: _test_multiprocessing: avoid weak sync primitive (GH-13292)

Avoid weak sync primitive in multiprocessing resource_tracker test.

6 years agobpo-36942 Windows build changes for Windows ARM64 (GH-13366)
Paul Monson [Fri, 17 May 2019 17:08:55 +0000 (10:08 -0700)]
bpo-36942 Windows build changes for Windows ARM64 (GH-13366)

6 years agobpo-36941: Windows build changes for Windows ARM64 (GH-13365)
Paul Monson [Fri, 17 May 2019 17:07:24 +0000 (10:07 -0700)]
bpo-36941: Windows build changes for Windows ARM64 (GH-13365)

6 years agobpo-36763: Add _PyCoreConfig_InitPythonConfig() (GH-13388)
Victor Stinner [Fri, 17 May 2019 17:01:14 +0000 (19:01 +0200)]
bpo-36763: Add _PyCoreConfig_InitPythonConfig() (GH-13388)

Add new functions to get the Python interpreter behavior:

* _PyPreConfig_InitPythonConfig()
* _PyCoreConfig_InitPythonConfig()

Add new functions to get an isolated configuration:

* _PyPreConfig_InitIsolatedConfig()
* _PyCoreConfig_InitIsolatedConfig()

Replace _PyPreConfig_INIT and _PyCoreConfig_INIT with new functions
_PyPreConfig_Init() and _PyCoreConfig_Init().

_PyCoreConfig: set configure_c_stdio and parse_argv to 0 by default
to behave as Python 3.6 in the default configuration.

_PyCoreConfig_Read() no longer sets coerce_c_locale_warn to 1 if it's
equal to 0. coerce_c_locale_warn must now be set to -1 (ex: using
_PyCoreConfig_InitPythonConfig()) to enable C locale coercion
warning.

Add unit tests for _PyCoreConfig_InitPythonConfig()
and _PyCoreConfig_InitIsolatedConfig().

Changes:

* Rename _PyCoreConfig_GetCoreConfig() to _PyPreConfig_GetCoreConfig()
* Fix core_read_precmdline(): handle parse_argv=0
* Fix _Py_PreInitializeFromCoreConfig(): pass coreconfig.argv
  to _Py_PreInitializeFromPyArgv(), except if parse_argv=0

6 years agobpo-36763: Add PyMemAllocatorName (GH-13387)
Victor Stinner [Fri, 17 May 2019 13:20:52 +0000 (15:20 +0200)]
bpo-36763: Add PyMemAllocatorName (GH-13387)

* Add PyMemAllocatorName enum
* _PyPreConfig.allocator type becomes PyMemAllocatorName, instead of
  char*
* Remove _PyPreConfig_Clear()
* Add _PyMem_GetAllocatorName()
* Rename _PyMem_GetAllocatorsName() to
  _PyMem_GetCurrentAllocatorName()
* Remove _PyPreConfig_SetAllocator(): just call
  _PyMem_SetupAllocators() directly, we don't have do reallocate the
  configuration with the new allocator anymore!
* _PyPreConfig_Write() parameter becomes const, as it should be in
  the first place!

6 years agoSimplify SSLSocket / SSLObject doc string (GH-9972)
Christian Heimes [Fri, 17 May 2019 11:08:14 +0000 (13:08 +0200)]
Simplify SSLSocket / SSLObject doc string (GH-9972)

Instead of maintaining the same doc string two times, let's copy common
doc strings from SSLObject methods and properties to SSLSocket.

Signed-off-by: Christian Heimes <christian@python.org>
6 years agodocs 36789: resolve incorrect note regarding UTF-8 (GH-13111)
redshiftzero [Fri, 17 May 2019 10:44:18 +0000 (03:44 -0700)]
docs 36789: resolve incorrect note regarding UTF-8 (GH-13111)

6 years agobpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)
Pablo Galindo [Fri, 17 May 2019 10:37:08 +0000 (11:37 +0100)]
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)

Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.

6 years agoFix typo in _PyMethodDef_RawFastCallKeywords error message (GH-13343)
Jeroen Demeyer [Fri, 17 May 2019 10:21:35 +0000 (12:21 +0200)]
Fix typo in _PyMethodDef_RawFastCallKeywords error message (GH-13343)

6 years agobpo-36908: 'This module is always available' isn't helpful. (#13297)
Ned Batchelder [Fri, 17 May 2019 09:59:14 +0000 (05:59 -0400)]
bpo-36908: 'This module is always available' isn't helpful. (#13297)

Makes the documentation of math and cmath module
more helpful for the beginners.

6 years agoDoc: Replace the deprecated highlightlang directive by highlight. (#13377)
Stéphane Wirtel [Fri, 17 May 2019 09:55:34 +0000 (11:55 +0200)]
Doc: Replace the deprecated highlightlang directive by highlight. (#13377)

highlightlang is deprecated since April 2018 in Sphinx.
See https://github.com/sphinx-doc/sphinx/pull/4845

6 years agobpo-36763: Remove _PyCoreConfig.program (GH-13373)
Victor Stinner [Fri, 17 May 2019 09:12:09 +0000 (11:12 +0200)]
bpo-36763: Remove _PyCoreConfig.program (GH-13373)

Use _PyCoreConfig.program_name instead.

6 years agoDoc: Add link threading.settrace to sys.settrace (GH-13345)
Stefan Hoelzl [Fri, 17 May 2019 08:50:03 +0000 (10:50 +0200)]
Doc: Add link threading.settrace to sys.settrace (GH-13345)

6 years agobpo-35545: Fix asyncio discarding IPv6 scopes (GH-11271)
Erwan Le Pape [Fri, 17 May 2019 08:28:39 +0000 (10:28 +0200)]
bpo-35545: Fix asyncio discarding IPv6 scopes  (GH-11271)

This PR proposes a solution to [bpo-35545](https://bugs.python.org/issue35545) by adding an optional `flowinfo` and `scopeid` to `asyncio.base_events._ipaddr_info` to carry the full address information into `_ipaddr_info` and avoid discarding IPv6 specific information.

Changelog entry & regression tests to come.

https://bugs.python.org/issue35545

6 years agobpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)
Zackery Spytz [Fri, 17 May 2019 07:13:03 +0000 (01:13 -0600)]
bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)

The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.

Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
6 years agobpo-36763: Cleanup precmdline in _PyCoreConfig_Read() (GH-13371)
Victor Stinner [Fri, 17 May 2019 01:15:12 +0000 (03:15 +0200)]
bpo-36763: Cleanup precmdline in _PyCoreConfig_Read() (GH-13371)

precmdline is only needed in _PyCoreConfig_Read(), not in
config_read_cmdline(). Reorganize _PyCoreConfig_Read().

6 years agobpo-36751: Undeprecate getfullargspec (GH-13245)
Pablo Galindo [Thu, 16 May 2019 20:08:15 +0000 (21:08 +0100)]
bpo-36751: Undeprecate getfullargspec (GH-13245)

6 years agobpo-36763: Add _PyCoreConfig.configure_c_stdio (GH-13363)
Victor Stinner [Thu, 16 May 2019 16:30:15 +0000 (18:30 +0200)]
bpo-36763: Add _PyCoreConfig.configure_c_stdio (GH-13363)

Add tests for configure_c_stdio and pathconfig_warnings parameters.

6 years agobpo-36763: Add _Py_InitializeMain() (GH-13362)
Victor Stinner [Thu, 16 May 2019 15:38:16 +0000 (17:38 +0200)]
bpo-36763: Add _Py_InitializeMain() (GH-13362)

* Add a private _Py_InitializeMain() function.
* Add again _PyCoreConfig._init_main.
* _Py_InitializeFromConfig() now uses _init_main to decide
  if _Py_InitializeMainInterpreter() should be called.
* _PyCoreConfig: rename _frozen to pathconfig_warnings, its value is
  now the opposite of Py_FrozenFlag.
* Add an unit test for _init_main=0 and _Py_InitializeMain().

6 years agobpo-36763: Add _PyCoreConfig.parse_argv (GH-13361)
Victor Stinner [Thu, 16 May 2019 15:02:56 +0000 (17:02 +0200)]
bpo-36763: Add _PyCoreConfig.parse_argv (GH-13361)

* _PyCoreConfig_Read() doesn't parse nor update argv
  if parse_argv is 0.
* Move path configuration fields in _PyCoreConfig.
* Add an unit test for parse_argv=0.
* Remove unused "done": label in _Py_RunMain().

6 years agobpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
Andrew Svetlov [Thu, 16 May 2019 14:52:10 +0000 (17:52 +0300)]
bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)

The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is.

https://bugs.python.org/issue36921

6 years agobpo-36763: _PyInitError always use int for exitcode (GH-13360)
Victor Stinner [Thu, 16 May 2019 14:39:26 +0000 (16:39 +0200)]
bpo-36763: _PyInitError always use int for exitcode (GH-13360)

We cannot use "unsigned int" for exitcode on Windows, since
Py_Main() and _Py_RunMain() always return an "int".

Changes:

* _PyPathConfig_ComputeSysPath0() now returns -1 if an exception is
  raised.
* pymain_run_python() no longer uses _PyInitError but display the
  exception and set exitcode to 1 in case of error.
* Fix _Py_RunMain(): return an exitcode rather than calling
  exit() on pymain_run_python() failure.
* _Py_ExitInitError() no longer uses ExitProcess() on Windows, use
  exit() on all platforms.
* _Py_ExitInitError() now fails with a fatal error if 'err' is not an
  error not an exit.

6 years agobpo-35589: Prevent buffer copy in sock_sendall() (GH-11418)
Andrew Svetlov [Thu, 16 May 2019 13:30:16 +0000 (16:30 +0300)]
bpo-35589: Prevent buffer copy in sock_sendall() (GH-11418)

No NEWs is needed since the problem was introduced on master only and never released.

https://bugs.python.org/issue35589

6 years agobpo-36748: optimize TextIOWrapper.write() for ASCII string (GH-13002)
Inada Naoki [Thu, 16 May 2019 06:03:20 +0000 (15:03 +0900)]
bpo-36748: optimize TextIOWrapper.write() for ASCII string (GH-13002)

6 years agoFix typos in documentation. Patch by tirkarthi. (GH-13354)
Terry Jan Reedy [Thu, 16 May 2019 05:20:37 +0000 (01:20 -0400)]
Fix typos in documentation.  Patch by tirkarthi. (GH-13354)

6 years agoFix typos in documentation (#13344)
Xtreak [Thu, 16 May 2019 04:34:24 +0000 (10:04 +0530)]
Fix typos in documentation (#13344)

6 years agobpo-36511: Windows arm32 buildbot changes (remove extra space) (GH-13351)
Paul Monson [Wed, 15 May 2019 23:10:39 +0000 (16:10 -0700)]
bpo-36511: Windows arm32 buildbot changes (remove extra space) (GH-13351)

@zooba
I just realized that this whitespace fix didn't get pushed.

https://bugs.python.org/issue36511

6 years agobpo-36511: Windows ARM32 buildbot changes (GH-12917)
Paul Monson [Wed, 15 May 2019 22:42:29 +0000 (15:42 -0700)]
bpo-36511: Windows ARM32 buildbot changes (GH-12917)

6 years agobpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779)
Paul Monson [Wed, 15 May 2019 22:38:55 +0000 (15:38 -0700)]
bpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779)

6 years agobpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)
‮zlohhcuB treboR [Wed, 15 May 2019 22:02:11 +0000 (00:02 +0200)]
bpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)

Similarly to how several pathlib file creation functions have an "exists_ok" parameter, we should introduce "missing_ok" that makes removal functions not raise an exception when a file or directory is already absent.  IMHO, this should cover Path.unlink and Path.rmdir.  Note, Path.resolve() has a "strict" parameter since 3.6 that does the same thing. Naming this of this new parameter tries to be consistent with the "exists_ok" parameter as that is more explicit about what it does (as opposed to "strict").

https://bugs.python.org/issue33123

6 years agobpo-36786: Run compileall in parallel during "make install" (GH-13078)
Antoine Pitrou [Wed, 15 May 2019 21:45:18 +0000 (23:45 +0200)]
bpo-36786: Run compileall in parallel during "make install" (GH-13078)

6 years agobpo-26707: Enable plistlib to read UID keys. (GH-12153)
Jon Janzen [Wed, 15 May 2019 20:14:38 +0000 (22:14 +0200)]
bpo-26707: Enable plistlib to read UID keys. (GH-12153)

Plistlib currently throws an exception when asked to decode a valid
.plist file that was generated by Apple's NSKeyedArchiver. Specifically,
this is caused by a byte 0x80 (signifying a UID) not being understood.

This fixes the problem by enabling the binary plist reader and writer
to read and write plistlib.UID objects.

6 years agoReference zipimport source code from docs. (GH-13310)
Xtreak [Wed, 15 May 2019 16:18:35 +0000 (21:48 +0530)]
Reference zipimport source code from docs. (GH-13310)

6 years agobpo-36799: Fix typo in ctypes.rst (GH-13104)
Yavor Konstantinov [Wed, 15 May 2019 15:02:13 +0000 (08:02 -0700)]
bpo-36799: Fix typo in ctypes.rst (GH-13104)

6 years agobpo-36763: InitConfigTests tests all core config (GH-13331)
Victor Stinner [Wed, 15 May 2019 00:12:48 +0000 (02:12 +0200)]
bpo-36763: InitConfigTests tests all core config (GH-13331)

Remove UNTESTED_CORE_CONFIG from test_embed.InitConfigTests: all core
config fields are now tested!

Changes:

* Test also dll_path on Windows
* Add run_main_config unit test: test config using _Py_RunMain().

6 years agobpo-36801: Temporarily fix regression in writer.drain() (#13330)
Andrew Svetlov [Tue, 14 May 2019 21:39:13 +0000 (00:39 +0300)]
bpo-36801: Temporarily fix regression in writer.drain() (#13330)

6 years agobpo-36763: Add test for _PyCoreConfig_SetString() (GH-13275)
Victor Stinner [Tue, 14 May 2019 20:01:51 +0000 (22:01 +0200)]
bpo-36763: Add test for _PyCoreConfig_SetString() (GH-13275)

test_embed: add test_init_read_set() to test newly added APIs: test
module_search_paths and executable.

6 years agobpo-36760: Clarify subprocess capture_output docs. (GH-13322)
Gregory P. Smith [Tue, 14 May 2019 19:33:17 +0000 (12:33 -0700)]
bpo-36760: Clarify subprocess capture_output docs. (GH-13322)

Clarify how to capture stdout and stderr combined into one stream.

6 years agobpo-36618: Don't add -fmax-type-align=8 flag for clang (GH-13320)
Victor Stinner [Tue, 14 May 2019 17:29:53 +0000 (19:29 +0200)]
bpo-36618: Don't add -fmax-type-align=8 flag for clang (GH-13320)

Python 3.8 now respects the x86-64 ABI: memory allocations are
aligned on 16 bytes. The clang flag was only used as a temporary
workaround.

6 years agobpo-33529, email: Fix infinite loop in email header encoding (GH-12020)
Krzysztof Wojcik [Tue, 14 May 2019 16:55:23 +0000 (18:55 +0200)]
bpo-33529, email: Fix infinite loop in email header encoding (GH-12020)

6 years agojson.tool: use stdin and stdout in default cmdlne arguments (GH-11992)
Hervé Beraud [Tue, 14 May 2019 16:52:42 +0000 (18:52 +0200)]
json.tool: use stdin and stdout in default cmdlne arguments (GH-11992)

Argparse can handle default value as stdin and stdout for parameters
as file type (infile, outfile).