]> granicus.if.org Git - python/log
python
6 years agobpo-34939: Allow annotated global names in module namespace (GH-9844)
Pablo Galindo [Sun, 14 Oct 2018 17:01:03 +0000 (18:01 +0100)]
bpo-34939: Allow annotated global names in module namespace (GH-9844)

Allow annotated global names in the module namespace after the symbol is
declared as global. Previously, only symbols annotated before they are declared
as global (i.e. inside a function) were allowed. This change allows symbols to be
declared as global before the annotation happens in the global scope.

6 years agobpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850)
Pablo Galindo [Sun, 14 Oct 2018 16:41:11 +0000 (17:41 +0100)]
bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850)

* Add News entry for the change in multiprocessing.reduction.recvfds
made in GH-9613.

6 years agoUpdate compound_stmts.rst (#9864)
Andrés Delfino [Sun, 14 Oct 2018 08:18:16 +0000 (05:18 -0300)]
Update compound_stmts.rst (#9864)

6 years agobpo-34941: Fix searching Element subclasses. (GH-9766)
Serhiy Storchaka [Sun, 14 Oct 2018 07:32:19 +0000 (10:32 +0300)]
bpo-34941: Fix searching Element subclasses. (GH-9766)

Methods find(), findtext() and findall() of xml.etree.ElementTree.Element
were not able to find chldren which are instances of Element subclasses.

6 years agobpo-33656: Move pyshell ctypes import inside try block. (GH-9858)
Terry Jan Reedy [Sun, 14 Oct 2018 00:00:31 +0000 (20:00 -0400)]
bpo-33656: Move pyshell ctypes import inside try block. (GH-9858)

A Windows build with _tkinter, tkinter, and idlelib
but without ctypes is unlikely but apparently possible.

6 years agobpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837)
Andrew Svetlov [Sat, 13 Oct 2018 18:12:40 +0000 (21:12 +0300)]
bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837)

https://bugs.python.org/issue34970

6 years agoAdd new tests for bytes and bytearray constructors. (GH-9843)
Serhiy Storchaka [Sat, 13 Oct 2018 17:39:45 +0000 (20:39 +0300)]
Add new tests for bytes and bytearray constructors. (GH-9843)

Covered all special cases: bytes, tuple, list, differend
kinds of iterables and iterators.

6 years agoFixes issues in Windows release upload script (GH-9845)
Steve Dower [Sat, 13 Oct 2018 17:10:42 +0000 (10:10 -0700)]
Fixes issues in Windows release upload script (GH-9845)

6 years agobpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)
Zackery Spytz [Sat, 13 Oct 2018 09:27:30 +0000 (03:27 -0600)]
bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)

6 years agobpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue...
Zackery Spytz [Sat, 13 Oct 2018 09:26:09 +0000 (03:26 -0600)]
bpo-22872: multiprocessing.Queue's put() and get() now raise ValueError if the queue is closed. (GH-9010)

Previously, put() and get() would raise AssertionError and OSError,
respectively.

6 years agobpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)
Stéphane Wirtel [Sat, 13 Oct 2018 06:14:08 +0000 (08:14 +0200)]
bpo-34967: Sphinx is deprecating add_description_unit, use add_object_type (GH-9827)

6 years agobpo-34783: Disable test_nonexisting_script for macOS framework builds (GH-9831)
Ned Deily [Sat, 13 Oct 2018 03:54:20 +0000 (23:54 -0400)]
bpo-34783:  Disable test_nonexisting_script for macOS framework builds (GH-9831)

With macOS framework builds, test case test_nonexisting_script in
test_nonexisting_script fails because the test case assumes that
the file name in sys.executable will appear in the error message.
For macOS framework builds, sys.executable is the file name of the
stub launcher and its file name bears no relationship to the file
name of the actual python executable.  For now, skip the test in
this case.

6 years agoPin again sphinx version as stated in the comment. (GH-9824)
Julien Palard [Fri, 12 Oct 2018 17:23:37 +0000 (19:23 +0200)]
Pin again sphinx version as stated in the comment. (GH-9824)

6 years agobpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768)
Juliette Monsel [Fri, 12 Oct 2018 16:44:10 +0000 (18:44 +0200)]
bpo-23831: Add moveto method to the tkinter.Canvas widget. (GH-9768)

6 years agobpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)
Serhiy Storchaka [Fri, 12 Oct 2018 16:01:00 +0000 (19:01 +0300)]
bpo-34964: Make Tkinter sources more readable by adding blank lines. (GH-9822)

6 years agobpo-11233: Create availability directive for documentation (GH-9692)
Cheryl Sabella [Fri, 12 Oct 2018 14:55:20 +0000 (10:55 -0400)]
bpo-11233: Create availability directive for documentation (GH-9692)

Replace "Availability: xxx" with ".. availability:: xxx" in the doc.
Original patch by Georg Brandl.

Co-Authored-By: Georg Brandl <georg@python.org>
6 years agobpo-34900: Make TestCase.debug() work with subtests (GH-9707)
Bruno Oliveira [Fri, 12 Oct 2018 10:35:55 +0000 (07:35 -0300)]
bpo-34900: Make TestCase.debug() work with subtests (GH-9707)

6 years agobpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)
Gus Goulart [Fri, 12 Oct 2018 09:16:43 +0000 (06:16 -0300)]
bpo-34203: FAQ now recommends python 3.x over 2.x (GH-9796)

6 years agobpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH...
Zackery Spytz [Fri, 12 Oct 2018 08:31:21 +0000 (02:31 -0600)]
bpo-31516: Skip test_main_thread_during_shutdown() with COUNT_ALLOCS builds. (GH-8052)

6 years agobpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764)
Zackery Spytz [Fri, 12 Oct 2018 08:20:59 +0000 (02:20 -0600)]
bpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764)

6 years agobpo-34962: make doctest in Doc/ now passes, and is enforced in CI (GH-9806)
Stéphane Wirtel [Fri, 12 Oct 2018 07:51:05 +0000 (09:51 +0200)]
bpo-34962: make doctest in Doc/ now passes, and is enforced in CI (GH-9806)

6 years agoFix an incorrect check in compiler_try_except(). (GH-9810)
Zackery Spytz [Fri, 12 Oct 2018 05:54:03 +0000 (23:54 -0600)]
Fix an incorrect check in compiler_try_except(). (GH-9810)

6 years agoFix a possible decref of a borrowed reference in symtable.c. (GH-9786)
Zackery Spytz [Thu, 11 Oct 2018 05:05:35 +0000 (23:05 -0600)]
Fix a possible decref of a borrowed reference in symtable.c. (GH-9786)

6 years agobpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751)
Serhiy Storchaka [Thu, 11 Oct 2018 04:41:00 +0000 (07:41 +0300)]
bpo-34922: Fix integer overflow in the digest() and hexdigest() methods (GH-9751)

for the SHAKE algorithm in the hashlib module.

6 years agoMicro-optimize list index range checks (GH-9784)
Raymond Hettinger [Thu, 11 Oct 2018 03:37:28 +0000 (20:37 -0700)]
Micro-optimize list index range checks (GH-9784)

6 years agobpo-34576 warn users on security for http.server (#9720)
Felipe Rodrigues [Thu, 11 Oct 2018 02:43:40 +0000 (23:43 -0300)]
bpo-34576 warn users on security for http.server (#9720)

It was proposed to add an warning for http.server regarding security
issues. The wording was provided at bpo-26005 by @orsenthil

6 years agobpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
Elvis Pranskevichus [Wed, 10 Oct 2018 16:43:14 +0000 (12:43 -0400)]
bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)

Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in
3.7.0 in bpo-29708.  The change is bad, as it unconditionally overrides
*invalidation_mode*, even if it was passed as an explicit argument to
``py_compile.compile()`` or ``compileall``.  An environment variable
should *never* override an explicit argument to a library function.
That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH``
environment variable is set.

This changes ``py_compile.compile()`` to only look at
``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified.
I also made various relevant tests run with explicit control over the
value of ``SOURCE_DATE_EPOCH``.

While looking at this, I noticed that ``zipimport`` does not work
with hash-based .pycs _at all_, though I left the fixes for
subsequent commits.

6 years agobpo-34926: Make mimetypes.guess_type accept os.PathLike objects (GH-9777)
Mayank Asthana [Wed, 10 Oct 2018 14:46:44 +0000 (20:16 +0530)]
bpo-34926: Make mimetypes.guess_type accept os.PathLike objects (GH-9777)

:meth:`mimetypes.MimeTypes.guess_type` now accepts :term:`path-like object` in addition to url strings.

6 years agobpo-33613: Fix test_semaphore_tracker signal tests when using -Werror (GH-9778)
Pablo Galindo [Wed, 10 Oct 2018 07:40:14 +0000 (08:40 +0100)]
bpo-33613: Fix test_semaphore_tracker signal tests when using -Werror (GH-9778)

Tests involving sending signals to the semaphore_tracker will not fail anymore due to
the fact that running the test suite with -Werror propagates warnings as errors.

Fix a missing assertion when the semaphore_tracker is expected to die.

6 years agoConvert code of conduct to markdown for Github (GH-9776)
Ammar Askar [Wed, 10 Oct 2018 06:43:08 +0000 (02:43 -0400)]
Convert code of conduct to markdown for Github (GH-9776)

6 years agobpo-34913: Document gzip command line interface (GH-9782)
Stéphane Wirtel [Wed, 10 Oct 2018 06:28:26 +0000 (08:28 +0200)]
bpo-34913: Document gzip command line interface (GH-9782)

6 years agobpo-23596: Use argparse for the command line of gzip (GH-9781)
Stéphane Wirtel [Tue, 9 Oct 2018 22:41:33 +0000 (00:41 +0200)]
bpo-23596: Use argparse for the command line of gzip (GH-9781)

Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
6 years agobpo-23596: Add unit tests for the command line for the gzip module (GH-9775)
Stéphane Wirtel [Tue, 9 Oct 2018 21:16:43 +0000 (23:16 +0200)]
bpo-23596: Add unit tests for the command line for the gzip module (GH-9775)

Add unit tests for the command line for the gzip module

6 years agobpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716)
twisteroid ambassador [Tue, 9 Oct 2018 15:30:21 +0000 (23:30 +0800)]
bpo-34769: Thread safety for _asyncgen_finalizer_hook(). (GH-9716)

6 years agobpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH...
Victor Stinner [Tue, 9 Oct 2018 14:54:04 +0000 (16:54 +0200)]
bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656)

When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

Co-Authored-By: Marcel Plch <gmarcel.plch@gmail.com>
(cherry picked from commit 9b7c74ca32d1bec7128d550a9ab1b2ddc7046287)

6 years agobpo-32680 add default "sock" on SMTP objects (#5345)
Romuald Brunet [Tue, 9 Oct 2018 14:31:55 +0000 (16:31 +0200)]
bpo-32680 add default "sock" on SMTP objects (#5345)

By default the smtplib.SMTP objects did not have a sock attribute, it
was only created during connect()

6 years agoExtract sendfile tests into a separate test file (#9757)
Andrew Svetlov [Tue, 9 Oct 2018 04:52:57 +0000 (07:52 +0300)]
Extract sendfile tests into a separate test file (#9757)

6 years agobpo-34758: add .wasm to recognized file extensions in mimetypes module (GH-9464)
travisoneill [Tue, 9 Oct 2018 04:43:58 +0000 (21:43 -0700)]
bpo-34758: add .wasm to recognized file extensions in mimetypes module (GH-9464)

6 years agobpo-32174: Let .chm document display non-ASCII characters properly (GH-9758)
animalize [Mon, 8 Oct 2018 21:20:54 +0000 (16:20 -0500)]
bpo-32174: Let .chm document display non-ASCII characters properly (GH-9758)

Let .chm document display non-ASCII characters properly

Escape the `body` part of .chm source file to 7-bit ASCII, to fix visual effect on some MBCS Windows systems.

6 years agoExtract tests for sock_*() functions into a separate file (GH-9761)
Andrew Svetlov [Mon, 8 Oct 2018 20:06:18 +0000 (23:06 +0300)]
Extract tests for sock_*() functions into a separate file (GH-9761)

6 years agobpo-31715 Add mimetype for extension .mjs (#3908)
Bradley Meck [Mon, 8 Oct 2018 20:04:55 +0000 (15:04 -0500)]
bpo-31715 Add mimetype for extension .mjs (#3908)

6 years agobpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750)
Noah Wood [Mon, 8 Oct 2018 18:50:16 +0000 (14:50 -0400)]
bpo-34921: Allow escaped NoReturn in get_type_hints (GH-9750)

6 years agobpo-34911: Added support for secure websocket cookies (GH-9734)
Paul Bailey [Mon, 8 Oct 2018 18:49:29 +0000 (13:49 -0500)]
bpo-34911: Added support for secure websocket cookies (GH-9734)

6 years agobpo-34829: Add missing selection_ methods to the Tkinter Spinbox. (GH-9617)
Juliette Monsel [Mon, 8 Oct 2018 16:29:24 +0000 (18:29 +0200)]
bpo-34829: Add missing selection_ methods to the Tkinter Spinbox. (GH-9617)

Implement the methods selection_from(), selection_range(), selection_present()
and selection_to() for Tkinter Spinbox.

6 years agoUse double quote instead of backtick to clarify Ellipsis constant (GH-9754)
Xtreak [Mon, 8 Oct 2018 15:14:16 +0000 (20:44 +0530)]
Use double quote instead of backtick to clarify Ellipsis constant (GH-9754)

6 years agobpo-34925: Optimize common case for bisect() argument parsing (#9753)
Raymond Hettinger [Mon, 8 Oct 2018 15:02:41 +0000 (08:02 -0700)]
bpo-34925: Optimize common case for bisect() argument parsing (#9753)

6 years agoAdd missing closing quote and trailing period in str.isidentifier() docstring (GH...
Emanuele Gaifas [Mon, 8 Oct 2018 10:44:47 +0000 (12:44 +0200)]
Add missing closing quote and trailing period in str.isidentifier() docstring (GH-9756)

This rectifies commit ffc5a14d00db984c8e72c7b67da8a493e17e2c14.

6 years agobpo-33014: Clarify str.isidentifier docstring (GH-6088)
Sanyam Khurana [Mon, 8 Oct 2018 06:53:32 +0000 (12:23 +0530)]
bpo-33014: Clarify str.isidentifier docstring (GH-6088)

* bpo-33014: Clarify str.isidentifier docstring

* bpo-33014: Add code example in isidentifier documentation

6 years agobpo-34901: add isolated (-I) flag to sys.flags (GH-9708)
Danish Prakash [Sun, 7 Oct 2018 16:12:31 +0000 (16:12 +0000)]
bpo-34901: add isolated (-I) flag to sys.flags (GH-9708)

https://bugs.python.org/issue34901

6 years agoCorrect grammar mistake in re.rst. (GH-9745)
Andrés Delfino [Sat, 6 Oct 2018 19:48:30 +0000 (16:48 -0300)]
Correct grammar mistake in re.rst. (GH-9745)

6 years agobpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606)
Zackery Spytz [Sat, 6 Oct 2018 17:41:45 +0000 (11:41 -0600)]
bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606)

On failure, _PyBytes_Resize() will deallocate the bytes object and set
"result" to NULL.

https://bugs.python.org/issue34824

6 years agobpo-34906: Doc: Fix typos (2) (GH-9735)
Stéphane Wirtel [Sat, 6 Oct 2018 14:35:53 +0000 (16:35 +0200)]
bpo-34906: Doc: Fix typos (2) (GH-9735)

Fix typos

6 years agobpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733)
Zackery Spytz [Sat, 6 Oct 2018 06:44:25 +0000 (00:44 -0600)]
bpo-34910: Ensure that PyObject_Print() always returns -1 on error. (GH-9733)

6 years agobpo-34909: keep searching mixins until base class is found (GH-9737)
Ethan Furman [Sat, 6 Oct 2018 06:29:36 +0000 (23:29 -0700)]
bpo-34909: keep searching mixins until base class is found (GH-9737)

6 years agobpo-34158: Documentation UTC offset update (GH-8377)
Christophe Nanteuil [Fri, 5 Oct 2018 22:57:02 +0000 (00:57 +0200)]
bpo-34158: Documentation UTC offset update (GH-8377)

* Documentation of UTC offset update
Since changes in the UTC offset that allows sub-minute offsets, the documentation needs update:

- "%z" format code documentation update
Karthikeyan Singaravelan commented on bugs.python.org:
Added as part of 018d353c1c8c87767d2335cd884017c2ce12e045 and a fix regarding duplicate words for that part was added at bac2d5ba30339298db7d4caa9c8cd31d807cf081.
Relevant format string at https://github.com/python/cpython/pull/2896/files#diff-25e2d173c84057d069b7890450714eddR214.
Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/files#diff-acc40bec51c7de832de3361db3edae52R309.
Table at https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior could also be updated with microseconds being optional in the second column
%z | UTC offset in the form ±HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030

- isoformat documentation update
According to me, needs confirmation:
Relevant format string at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714eddR176
Relevant test case at https://github.com/python/cpython/pull/4699/files#diff-25e2d173c84057d069b7890450714edd

* From Martin Panter: some style improvment;
From @pganssle: using f for fractional part of seconds in all file.

6 years agobpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705)
Zackery Spytz [Fri, 5 Oct 2018 21:02:23 +0000 (15:02 -0600)]
bpo-34899: Fix a possible assertion failure due to int_from_bytes_impl() (GH-9705)

The _PyLong_FromByteArray() call in int_from_bytes_impl() was
unchecked.

6 years agoFix a compiler warning added in bpo-34872. (GH-9722)
Serhiy Storchaka [Fri, 5 Oct 2018 18:20:02 +0000 (21:20 +0300)]
Fix a compiler warning added in bpo-34872. (GH-9722)

6 years agoUse assertEqual() instead of assertEquals(). (GH-9721)
Serhiy Storchaka [Fri, 5 Oct 2018 18:09:56 +0000 (21:09 +0300)]
Use assertEqual() instead of assertEquals(). (GH-9721)

Fixes warnings in tests added in bpo-32117 and bpo-34603.

6 years agobpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)
Steve Dower [Fri, 5 Oct 2018 18:05:47 +0000 (11:05 -0700)]
bpo-34902: Fixes VM image for Azure Pipelines build (GH-9719)

6 years agoSimplify flags checks in sre_compile.py. (GH-9718)
Serhiy Storchaka [Fri, 5 Oct 2018 17:53:45 +0000 (20:53 +0300)]
Simplify flags checks in sre_compile.py. (GH-9718)

Flags SRE_FLAG_UNICODE and SRE_FLAG_ASCII are mutually exclusive.

6 years agobpo-34825: Add more entries to os to pathlib reference table (GH-9608)
Xtreak [Fri, 5 Oct 2018 15:24:11 +0000 (20:54 +0530)]
bpo-34825: Add more entries to os to pathlib reference table (GH-9608)

The added functions are as below :

| os module     | Pathlib       |
| ------------- | ------------- |
| os.chmod   | Path.chmod  |
| os.mkdir  | Path.mkdir  |
| os.rename | Path.rename |
| os.replace | Path.replace |
| os.rmdir  | Path.rmdir |
| os.remove, os.unlink | Path.unlink |
| os.path.samefile | Path.samefile |

Thanks

https://bugs.python.org/issue34825

6 years agobpo-34906: Doc: Fix typos (GH-9712)
Stéphane Wirtel [Fri, 5 Oct 2018 14:17:18 +0000 (16:17 +0200)]
bpo-34906: Doc: Fix typos (GH-9712)

6 years agobpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin (GH-4348)
E. M. Bray [Fri, 5 Oct 2018 11:38:50 +0000 (13:38 +0200)]
bpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin (GH-4348)

This is needed to even the run the test suite on buildbots for affected platforms; e.g.:

```
./python.exe  ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2
/home/embray/src/python/test-worker/3.x.test-worker/build/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2
Traceback (most recent call last):
  File "./Tools/scripts/run_tests.py", line 56, in <module>
    main(sys.argv[1:])
  File "./Tools/scripts/run_tests.py", line 52, in main
    os.execv(sys.executable, args)
PermissionError: [Errno 13] Permission denied
make: *** [Makefile:1073: buildbottest] Error 1
```

6 years agoFix a typo ssl.py docstring (GH-9697)
Matt Eaton [Fri, 5 Oct 2018 07:00:45 +0000 (02:00 -0500)]
Fix a typo ssl.py docstring (GH-9697)

6 years agobpo-34871: inspect: Don't pollute sys.modules (GH-9696)
INADA Naoki [Thu, 4 Oct 2018 16:47:09 +0000 (01:47 +0900)]
bpo-34871: inspect: Don't pollute sys.modules (GH-9696)

https://bugs.python.org/issue34871

6 years agobpo-34871: Fix two typos in test_inspect.py (GH-9698)
Chih-Hsuan Yen [Thu, 4 Oct 2018 13:15:00 +0000 (21:15 +0800)]
bpo-34871: Fix two typos in test_inspect.py (GH-9698)

`arg` is misspelled as `agr`. I noticed this when playing with https://bugs.python.org/issue34871

https://bugs.python.org/issue34871

6 years agobpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421)
Serhiy Storchaka [Thu, 4 Oct 2018 07:42:06 +0000 (10:42 +0300)]
bpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421)

Use tp_members and tp_getset instead.

6 years agobpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420)
Serhiy Storchaka [Thu, 4 Oct 2018 07:41:27 +0000 (10:41 +0300)]
bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420)

Use tp_members and tp_getset instead.

6 years agocloses bpo-34869: Remove LDLAST. (GH-9667)
Benjamin Peterson [Thu, 4 Oct 2018 02:23:24 +0000 (19:23 -0700)]
closes bpo-34869: Remove LDLAST. (GH-9667)

6 years agobpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679)
Elvis Pranskevichus [Wed, 3 Oct 2018 14:30:31 +0000 (10:30 -0400)]
bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679)

The C implementation of asyncio.Task currently fails to perform the
cancellation cleanup correctly in the following scenario.

    async def task1():
        async def task2():
            await task3     # task3 is never cancelled

        asyncio.current_task().cancel()
        await asyncio.create_task(task2())

The actuall error is a hardcoded call to `future_cancel()` instead of
calling the `cancel()` method of a future-like object.

Thanks to Vladimir Matveev for noticing the code discrepancy and to
Yury Selivanov for coming up with a pathological scenario.

6 years agobpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)
Zackery Spytz [Wed, 3 Oct 2018 06:01:30 +0000 (00:01 -0600)]
bpo-34879: Fix a possible null pointer dereference in bytesobject.c (GH-9683)

formatfloat() was not checking if PyBytes_FromStringAndSize()
failed, which could lead to a null pointer dereference in
_PyBytes_FormatEx().

6 years agoMake it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex...
Benjamin Peterson [Wed, 3 Oct 2018 04:38:39 +0000 (21:38 -0700)]
Make it clear that the msg argument to assertWarns/assertWarnsRegex/assertRaisesRegex is keyword-only. (GH-9680)

A follow up to be4e5b89204283a62e369439025f00362d0424f6.

6 years agobpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450)
tzickel [Tue, 2 Oct 2018 21:01:23 +0000 (00:01 +0300)]
bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-8450)

Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.

6 years agobpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)
Yury Selivanov [Tue, 2 Oct 2018 17:53:06 +0000 (13:53 -0400)]
bpo-34728: Fix asyncio tests to run under "-Werror" (GH-9661)

6 years agoRemove recent from logging cookbook (GH-9636)
Cheryl Sabella [Tue, 2 Oct 2018 16:35:05 +0000 (12:35 -0400)]
Remove recent from logging cookbook (GH-9636)

6 years agocloses bpo-34862: Guard definition of convert_sched_param with POSIX_SPAWN_SETSCHEDUL...
William Orr [Tue, 2 Oct 2018 05:19:56 +0000 (22:19 -0700)]
closes bpo-34862: Guard definition of convert_sched_param with POSIX_SPAWN_SETSCHEDULER. (GH-9658)

Fixes broken build on OpenBSD-current.

6 years agoMake it clear that the msg argument to assertRaises is keyword-only. (GH-9670)
Benjamin Peterson [Tue, 2 Oct 2018 05:18:44 +0000 (22:18 -0700)]
Make it clear that the msg argument to assertRaises is keyword-only. (GH-9670)

6 years agocloses bpo-34868: Improve error message with '_' is combined with an invalid type...
Benjamin Peterson [Tue, 2 Oct 2018 04:54:39 +0000 (21:54 -0700)]
closes bpo-34868: Improve error message with '_' is combined with an invalid type specifier. (GH-9666)

6 years agobpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662)
Ezio Melotti [Tue, 2 Oct 2018 00:34:46 +0000 (17:34 -0700)]
bpo-31865: Fix a couple of typos in the html.unescape() docs. (GH-9662)

6 years agobpo-30167: Add test for module.__cached__ is None (GH-7617)
INADA Naoki [Mon, 1 Oct 2018 12:10:37 +0000 (21:10 +0900)]
bpo-30167: Add test for module.__cached__ is None (GH-7617)

6 years agobpo-34476: Document that asyncio.sleep() always suspends. (#9643)
Hrvoje Nikšić [Mon, 1 Oct 2018 10:09:38 +0000 (12:09 +0200)]
bpo-34476: Document that asyncio.sleep() always suspends. (#9643)

6 years agobpo-30156: Remove property_descr_get() optimization (GH-9541)
Victor Stinner [Mon, 1 Oct 2018 10:03:22 +0000 (03:03 -0700)]
bpo-30156: Remove property_descr_get() optimization (GH-9541)

property_descr_get() uses a "cached" tuple to optimize function
calls. But this tuple can be discovered in debug mode with
sys.getobjects(). Remove the optimization, it's not really worth it
and it causes 3 different crashes last years.

Microbenchmark:

./python -m perf timeit -v \
    -s "from collections import namedtuple; P = namedtuple('P', 'x y'); p = P(1, 2)" \
    --duplicate 1024 "p.x"

Result:

Mean +- std dev: [ref] 32.8 ns +- 0.8 ns -> [patch] 40.4 ns +- 1.3 ns: 1.23x slower (+23%)

6 years agoFix name of argument in docs for functools.reduce(). (#9634)
Brendan Jurd [Mon, 1 Oct 2018 06:52:10 +0000 (16:52 +1000)]
Fix name of argument in docs for functools.reduce(). (#9634)

6 years agobpo-34850: Replace is with == in idlelib.iomenu (GH-9649)
Terry Jan Reedy [Sun, 30 Sep 2018 21:17:17 +0000 (17:17 -0400)]
bpo-34850: Replace is with == in idlelib.iomenu (GH-9649)

Patch by Serhiy Storchaka (in PR #9642).

6 years agobpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)
Serhiy Storchaka [Sun, 30 Sep 2018 18:07:05 +0000 (21:07 +0300)]
bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)

* Compiling a string annotation containing a lambda with keyword-only
argument without default value caused a crash.

* Remove the final "*" (it is incorrect syntax) in the representation of
lambda without *args and keyword-only arguments when compile from AST.

* Improve the representation of lambda without arguments.

6 years agobpo-34849: Don't log wating for selector.select in asyncio loop iteration (GH-9641)
Andrew Svetlov [Sun, 30 Sep 2018 05:28:40 +0000 (08:28 +0300)]
bpo-34849: Don't log wating for selector.select in asyncio loop iteration (GH-9641)

The waiting is pretty normal for any asyncio program, logging its time just adds
a noise to logs without any useful information provided.

https://bugs.python.org/issue34849

6 years agoSpeed-up math.dist() by 30% (GH-9628)
Raymond Hettinger [Sat, 29 Sep 2018 21:30:38 +0000 (14:30 -0700)]
Speed-up math.dist() by 30% (GH-9628)

6 years agobpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Zackery Spytz [Sat, 29 Sep 2018 16:15:55 +0000 (10:15 -0600)]
bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)

Switch "list" with "iterable" to match with the implementation.

6 years agobpo-31370: Remove references to threadless builds (#8805)
Zackery Spytz [Sat, 29 Sep 2018 16:07:11 +0000 (10:07 -0600)]
bpo-31370: Remove references to threadless builds (#8805)

Support for threadless builds was removed in a6a4dc81.

6 years agoFix astuple in dataclasses documentation (GH-9631)
방성범 (Bang Seongbeom) [Sat, 29 Sep 2018 10:50:31 +0000 (19:50 +0900)]
Fix astuple in dataclasses documentation (GH-9631)

6 years agoFix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)
Zackery Spytz [Sat, 29 Sep 2018 05:48:46 +0000 (23:48 -0600)]
Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)

_pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.

6 years agobpo-34797: Convert heapq to the argument clinic (GH-9560)
Pablo Galindo [Fri, 28 Sep 2018 19:39:43 +0000 (20:39 +0100)]
bpo-34797: Convert heapq to the argument clinic (GH-9560)

6 years agobpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)
Victor Stinner [Fri, 28 Sep 2018 15:40:08 +0000 (08:40 -0700)]
bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)

Since ProactorEventLoop is now the default in 3.8, remove examples
using it explicitly on Windows.

https://bugs.python.org/issue34687

6 years agobpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE (GH...
Pablo Galindo [Fri, 28 Sep 2018 09:51:05 +0000 (10:51 +0100)]
bpo-34521: Fix tests in test_multiprocessing_spawn to use correctly CMSG_SPACE (GH-9613)

After some failures in AMD64 FreeBSD CURRENT Debug 3.x buildbots
regarding tests in test_multiprocessing_spawn and after examining
similar failures in test_socket, some errors in the calculation of
ancillary data buffers were found in multiprocessing.reduction.

CMSG_LEN() can often be used as the buffer size for recvmsg() to
receive a single item of ancillary data, but RFC 3542 requires portable
applications to use CMSG_SPACE() and thus include space for padding,
even when the item will be the last in the buffer.

The failures we experience are due to the usage of CMSG_LEN() instead of
CMSG_SPACE().

6 years agobpo-34736: improve error message for invalid length b64decode inputs (GH-9563)
Tal Einat [Fri, 28 Sep 2018 05:57:22 +0000 (08:57 +0300)]
bpo-34736: improve error message for invalid length b64decode inputs (GH-9563)

Improvements:
1. Include the number of valid data characters in the error message.
2. Mention "number of data characters" rather than "length".

https://bugs.python.org/issue34736

6 years agobpo-34248: Add filename to error raised in {gnu,ndbm}.open() (GH-8590)
Zsolt Cserna [Thu, 27 Sep 2018 19:54:34 +0000 (21:54 +0200)]
bpo-34248: Add filename to error raised in {gnu,ndbm}.open() (GH-8590)

Report the filename to the exception when raising {gdbm,dbm.ndbm}.error in
dbm.gnu.open() and dbm.ndbm.open() functions, so it gets printed when the
exception is raised, and can also be obtained by the filename attribute of the
exception object.

6 years agobpo-34802: Fix asyncio.iscoroutine() docs (GH-9611)
Yury Selivanov [Thu, 27 Sep 2018 19:48:30 +0000 (15:48 -0400)]
bpo-34802: Fix asyncio.iscoroutine() docs (GH-9611)

6 years agobpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)
Yury Selivanov [Thu, 27 Sep 2018 18:55:55 +0000 (14:55 -0400)]
bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)

This fixes various compiler warnings.

6 years agobpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)
Serhiy Storchaka [Thu, 27 Sep 2018 14:42:37 +0000 (17:42 +0300)]
bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)

6 years agobpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures (GH-9599)
orlnub123 [Thu, 27 Sep 2018 11:16:26 +0000 (14:16 +0300)]
bpo-34819: Use a monotonic clock to compute timeouts in concurrent.futures (GH-9599)

Use a monotonic clock to compute timeouts in :meth:`Executor.map` and :func:`as_completed`, in order to prevent timeouts from deviating when the system clock is adjusted.

This may not be sufficient on all systems. On POSIX for example, the actual waiting (e.g. in ``sem_timedwait``) is specified to rely on the CLOCK_REALTIME clock.