]> granicus.if.org Git - python/log
python
6 years agobpo-35537: subprocess can use posix_spawn with pipes (GH-11575)
Victor Stinner [Wed, 23 Jan 2019 18:00:39 +0000 (19:00 +0100)]
bpo-35537: subprocess can use posix_spawn with pipes (GH-11575)

* subprocess.Popen can now also use os.posix_spawn() with pipes,
  but only if pipe file descriptors are greater than 2.
* Fix Popen._posix_spawn(): set '_child_created' attribute to True.
* Add Popen._close_pipe_fds() helper function to factorize the code.

6 years agobpo-35713: Reorganize sys module initialization (GH-11658)
Victor Stinner [Wed, 23 Jan 2019 14:04:40 +0000 (15:04 +0100)]
bpo-35713: Reorganize sys module initialization (GH-11658)

* Rename _PySys_BeginInit() to _PySys_InitCore().
* Rename _PySys_EndInit() to _PySys_InitMain().
* Add _PySys_Create(). It calls _PySys_InitCore() which becomes
  private.
* Add _PySys_SetPreliminaryStderr().
* Rename _Py_ReadyTypes() to _PyTypes_Init().
* Misc code cleanup.

6 years agobpo-35781: Changed references to deprecated 'warn' method in logging documentation...
yuji38kwmt [Wed, 23 Jan 2019 07:27:13 +0000 (16:27 +0900)]
bpo-35781: Changed references to deprecated 'warn' method in logging documentation in favour of 'warning' (GH-11654)

6 years agobpo-35722: Updated the documentation for the 'disable_existing_loggers' parameter...
Géry Ogam [Wed, 23 Jan 2019 07:12:39 +0000 (08:12 +0100)]
bpo-35722: Updated the documentation for the 'disable_existing_loggers' parameter (GH-11525)

6 years agobpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537)
Manjusaka [Wed, 23 Jan 2019 07:08:38 +0000 (15:08 +0800)]
bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537)

QueueHandler.prepare() now makes a copy of the record before modifying and enqueueing it, to avoid affecting other handlers in the chain.

6 years agobpo-35713: Split _Py_InitializeCore into subfunctions (GH-11650)
Victor Stinner [Tue, 22 Jan 2019 20:18:05 +0000 (21:18 +0100)]
bpo-35713: Split _Py_InitializeCore into subfunctions (GH-11650)

* Split _Py_InitializeCore_impl() into subfunctions: add multiple pycore_init_xxx() functions
* Preliminary sys.stderr is now set earlier to get an usable
  sys.stderr ealier.
* Move code into _Py_Initialize_ReconfigureCore() to be able to call
  it from _Py_InitializeCore().
* Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions()
  function.
* Call _PyExc_Init() earlier in _Py_InitializeCore_impl()
  and new_interpreter() to get working exceptions earlier.
* _Py_ReadyTypes() now returns _PyInitError rather than calling
  Py_FatalError().
* Misc code cleanup

6 years agobpo-35683: Improve Azure Pipelines steps (GH-11493)
Steve Dower [Tue, 22 Jan 2019 18:49:52 +0000 (10:49 -0800)]
bpo-35683: Improve Azure Pipelines steps (GH-11493)

6 years agobpo-35713: Rework Python initialization (GH-11647)
Victor Stinner [Tue, 22 Jan 2019 16:39:03 +0000 (17:39 +0100)]
bpo-35713: Rework Python initialization (GH-11647)

* The PyByteArray_Init() and PyByteArray_Fini() functions have been
  removed. They did nothing since Python 2.7.4 and Python 3.2.0, were
  excluded from the limited API (stable ABI), and were not
  documented.
* Move "_PyXXX_Init()" and "_PyXXX_Fini()" declarations from
  Include/cpython/pylifecycle.h to
  Include/internal/pycore_pylifecycle.h. Replace
  "PyAPI_FUNC(TYPE)" with "extern TYPE".
* _PyExc_Init() now returns an error on failure rather than calling
  Py_FatalError(). Move macros inside _PyExc_Init() and undefine them
  when done. Rewrite macros to make them look more like statement:
  add ";" when using them, add "do { ... } while (0)".
* _PyUnicode_Init() now returns a _PyInitError error rather than call
  Py_FatalError().
* Move stdin check from _PySys_BeginInit() to init_sys_streams().
* _Py_ReadyTypes() now returns a _PyInitError error rather than
  calling Py_FatalError().

6 years agobpo-35720: Fixing a memory leak in pymain_parse_cmdline_impl() (GH-11528)
Lucas Cimon [Tue, 22 Jan 2019 16:15:01 +0000 (17:15 +0100)]
bpo-35720: Fixing a memory leak in pymain_parse_cmdline_impl() (GH-11528)

When the loop in the pymain_read_conf function in this same file
calls pymain_init_cmdline_argv() a 2nd time, the pymain->command
buffer of wchar_t is overriden and the previously allocated memory
is never freed.

6 years agobpo-33416: Add end positions to Python AST (GH-11605)
Ivan Levkivskyi [Tue, 22 Jan 2019 11:18:22 +0000 (11:18 +0000)]
bpo-33416: Add end positions to Python AST (GH-11605)

The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points:
* It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`.
* I add end position information to both CST and AST.  Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient.
* Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear.
* For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in
  ```python
  class C:
      pass

  pass
  ```
  the end line and end column for the class definition is (2, 8).
* For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node.
* I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing.

An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.

6 years agobpo-35758: Fix building on ARM + MSVC (gh-11531)
Minmin Gong [Mon, 21 Jan 2019 20:49:40 +0000 (12:49 -0800)]
bpo-35758: Fix building on ARM + MSVC (gh-11531)

* Disable x87 control word for non-x86 targets

On msvc, x87 control word is only available on x86 target. Need to disable it for other targets to prevent compiling problems.

* Include immintrin.h on x86 and x64 only

Immintrin.h is only available on x86 and x64. Need to disable it for other targets to prevent compiling problems.

6 years agobpo-35782: Fix error message in randrange (GH-11620)
Kumar Akshay [Mon, 21 Jan 2019 19:19:59 +0000 (00:49 +0530)]
bpo-35782: Fix error message in randrange (GH-11620)

https://bugs.python.org/issue35782

6 years agobpo-35794: Catch PermissionError in test_no_such_executable (GH-11635)
Pablo Galindo [Mon, 21 Jan 2019 14:35:43 +0000 (14:35 +0000)]
bpo-35794: Catch PermissionError in test_no_such_executable (GH-11635)

PermissionError can be raised if there are directories in the $PATH that are not accessible
when using posix_spawnp.

6 years agobpo-35772: Fix test_tarfile on ppc64 (GH-11606)
Victor Stinner [Mon, 21 Jan 2019 09:24:12 +0000 (10:24 +0100)]
bpo-35772: Fix test_tarfile on ppc64 (GH-11606)

Fix sparse file tests of test_tarfile on ppc64le with the tmpfs
filesystem.

Fix the function testing if the filesystem supports sparse files:
create a file which contains data and "holes", instead of creating a
file which contains no data.

tmpfs effective block size is a page size (tmpfs lives in the page
cache). RHEL uses 64 KiB pages on aarch64, ppc64 and ppc64le, only
s390x and x86_64 use 4 KiB pages, whereas the test punch holes of
4 KiB.

test.pythoninfo: Add resource.getpagesize().

6 years agobpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (#11057)
Pablo Galindo [Mon, 21 Jan 2019 08:57:46 +0000 (08:57 +0000)]
bpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (#11057)

* Allow repeated deletion of unittest.mock.Mock attributes

* fixup! Allow repeated deletion of unittest.mock.Mock attributes

* fixup! fixup! Allow repeated deletion of unittest.mock.Mock attributes

6 years agoAdd information about DeprecationWarning for invalid escaped characters in the re...
Pablo Galindo [Sun, 20 Jan 2019 18:57:56 +0000 (18:57 +0000)]
Add information about DeprecationWarning for invalid escaped characters in the re module (GH-5255)

6 years agobpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495)
Marc Schlaich [Sun, 20 Jan 2019 18:47:42 +0000 (19:47 +0100)]
bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495)

6 years agobpo-35770: Fix off-by-1 error. (#11618)
Terry Jan Reedy [Fri, 18 Jan 2019 22:05:40 +0000 (17:05 -0500)]
bpo-35770: Fix off-by-1 error. (#11618)

6 years agobpo-35733: Make isinstance(ast.Constant(boolean), ast.Num) be false. (GH-11547)
Anthony Sottile [Fri, 18 Jan 2019 19:30:28 +0000 (11:30 -0800)]
bpo-35733: Make isinstance(ast.Constant(boolean), ast.Num) be false. (GH-11547)

6 years agobpo-35770: IDLE macosx deletes Options => Configure IDLE. (GH-11614)
Terry Jan Reedy [Fri, 18 Jan 2019 19:00:45 +0000 (14:00 -0500)]
bpo-35770: IDLE macosx deletes Options => Configure IDLE. (GH-11614)

It previously deleted Window => Zoom Height by mistake.
(Zoom Height is now on the Options menu).  On Mac, the settings
dialog is accessed via Preferences on the IDLE menu.

6 years agobpo-21257: document http.client.parse_headers (GH-11443)
Ashwin Ramaswami [Fri, 18 Jan 2019 15:49:16 +0000 (07:49 -0800)]
bpo-21257: document http.client.parse_headers (GH-11443)

Document http.client.parse_headers

6 years agobpo-35045: Accept TLSv1 default in min max test (GH-11510)
Christian Heimes [Fri, 18 Jan 2019 15:09:30 +0000 (16:09 +0100)]
bpo-35045: Accept TLSv1 default in min max test (GH-11510)

Make ssl tests less strict and also accept TLSv1 as system default. The
changes unbreaks test_min_max_version on Fedora 29.

Signed-off-by: Christian Heimes <christian@python.org>
6 years agobpo-35283: Update the docstring of threading.Thread.join method (GH-11596)
Dong-hee Na [Fri, 18 Jan 2019 09:50:47 +0000 (18:50 +0900)]
bpo-35283: Update the docstring of threading.Thread.join method (GH-11596)

6 years agobpo-35769: Change IDLE's name for new files from 'Untitled' to 'untitled' (GH-11602)
Terry Jan Reedy [Fri, 18 Jan 2019 07:09:53 +0000 (02:09 -0500)]
bpo-35769: Change IDLE's name for new files from 'Untitled' to 'untitled' (GH-11602)

'Untitled' violates the PEP 8 standard for .py files

6 years agobpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)
Serhiy Storchaka [Fri, 18 Jan 2019 05:47:48 +0000 (07:47 +0200)]
bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)

6 years agobpo-35730: IDLE - test squeezer reload() by checking load_font() (GH-11585)
Tal Einat [Fri, 18 Jan 2019 02:26:06 +0000 (04:26 +0200)]
bpo-35730: IDLE - test squeezer reload() by checking load_font() (GH-11585)

6 years agobpo-23156: Remove obsolete tix install directions (GH-11595)
Terry Jan Reedy [Fri, 18 Jan 2019 00:00:51 +0000 (19:00 -0500)]
bpo-23156: Remove obsolete tix install directions (GH-11595)

Tix was deprecated in 3.6 and the doc is wrong.  New users should use ttk.

6 years agobpo-34161: Update idlelib/NEWS.txt to 2019 Jan 17 (GH-11597)
Terry Jan Reedy [Thu, 17 Jan 2019 23:44:13 +0000 (18:44 -0500)]
bpo-34161: Update idlelib/NEWS.txt to 2019 Jan 17 (GH-11597)

6 years agobpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)
Timo Furrer [Thu, 17 Jan 2019 14:15:53 +0000 (15:15 +0100)]
bpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)

6 years agobpo-35701: Added __weakref__ slot to uuid.UUID (GH-11570)
David H [Thu, 17 Jan 2019 12:16:51 +0000 (13:16 +0100)]
bpo-35701: Added __weakref__ slot to uuid.UUID (GH-11570)

Added test for weakreferencing a uuid.UUID object.

6 years agobpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)
Dong-hee Na [Thu, 17 Jan 2019 12:14:45 +0000 (21:14 +0900)]
bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)

Add a deprecated warning for the threading.Thread.isAlive() method.

6 years agoFixes typo in asyncio.queue doc (GH-11581)
Slam [Thu, 17 Jan 2019 11:52:17 +0000 (13:52 +0200)]
Fixes typo in asyncio.queue doc (GH-11581)

Typo fix for method doc, I'm pretty sure coro is meant, because there's no consumer threads for thread-unsafe queue.

Most probably this piece of doc was copied from `queue.Queue`

There's not BPO bug for this, afaik.

6 years agobpo-35486: Note Py3.6 import system API requirement change (GH-11540)
Nick Coghlan [Thu, 17 Jan 2019 10:41:29 +0000 (20:41 +1000)]
bpo-35486: Note Py3.6 import system API requirement change (GH-11540)

While the introduction of ModuleNotFoundError was fully backwards
compatible on the import API consumer side, folks providing alternative
implementations of `__import__` need to make an update to be
forward compatible with clients that start relying on the new subclass.

https://bugs.python.org/issue35486

6 years agoRevert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)
Victor Stinner [Wed, 16 Jan 2019 22:38:06 +0000 (23:38 +0100)]
Revert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)

This reverts commit 07858894689047c77f9c12ddc061d30681368d19.

6 years agobpo-35537: subprocess can now use os.posix_spawnp (GH-11579)
Victor Stinner [Wed, 16 Jan 2019 14:26:20 +0000 (15:26 +0100)]
bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)

The subprocess module can now use the os.posix_spawnp() function,
if it is available, to locate the program in the PATH.

6 years agobpo-35674: Add os.posix_spawnp() (GH-11554)
Joannah Nanjekye [Wed, 16 Jan 2019 13:29:26 +0000 (16:29 +0300)]
bpo-35674: Add os.posix_spawnp() (GH-11554)

Add a new os.posix_spawnp() function.

6 years agobpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)
Victor Stinner [Tue, 15 Jan 2019 23:02:35 +0000 (00:02 +0100)]
bpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)

The subprocess module can now use the os.posix_spawn() function
in some cases for better performance. Currently, it is only used on macOS
and Linux (using glibc 2.24 or newer) if all these conditions are met:

* executable path contains a directory
* close_fds=False
* preexec_fn, pass_fds, cwd, stdin, stdout, stderr
  and start_new_session parameters are not set

Co-authored-by: Joannah Nanjekye <nanjekyejoannah@gmail.com>
6 years agobpo-35746: Fix segfault in ssl's cert parser (GH-11569)
Christian Heimes [Tue, 15 Jan 2019 22:47:42 +0000 (23:47 +0100)]
bpo-35746: Fix segfault in ssl's cert parser (GH-11569)

Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
distribution points with empty DP or URI correctly. A malicious or buggy
certificate can result into segfault.

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

6 years agobpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)
Victor Stinner [Tue, 15 Jan 2019 12:58:38 +0000 (13:58 +0100)]
bpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)

asyncio.ProactorEventLoop now catchs and logs send errors when the
self-pipe is full: BaseProactorEventLoop._write_to_self() now catchs
and logs OSError exceptions, as done by
BaseSelectorEventLoop._write_to_self().

6 years agobpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)
Serhiy Storchaka [Tue, 15 Jan 2019 11:26:38 +0000 (13:26 +0200)]
bpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)

Handle the case of an empty module name in PYTHONBREAKPOINT.

Fixes a regression introduced in bpo-34756.

6 years agobpo-11555: Enhance IocpProactor.close() log again (GH-11563)
Victor Stinner [Tue, 15 Jan 2019 11:13:48 +0000 (12:13 +0100)]
bpo-11555: Enhance IocpProactor.close() log again (GH-11563)

Add repr(self) to the log to display the number of pending overlapped
in the log.

6 years agobpo-34323: Enhance IocpProactor.close() log (GH-11555)
Victor Stinner [Tue, 15 Jan 2019 10:48:00 +0000 (11:48 +0100)]
bpo-34323: Enhance IocpProactor.close() log (GH-11555)

IocpProactor.close() now uses time to decide when to log: wait 1
second before the first log, then log every second. Log also the
number of seconds since close() was called.

6 years agobpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)
Henry Chen [Tue, 15 Jan 2019 10:29:21 +0000 (02:29 -0800)]
bpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)

Show correct number of repeats.

6 years agobpo-29707: Document that os.path.ismount() is not able to reliable detect bind mounts...
Serhiy Storchaka [Tue, 15 Jan 2019 08:55:40 +0000 (10:55 +0200)]
bpo-29707: Document that os.path.ismount() is not able to reliable detect bind mounts. (GH-11238)

6 years agobpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)
Serhiy Storchaka [Tue, 15 Jan 2019 08:53:18 +0000 (10:53 +0200)]
bpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)

6 years agobpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). ...
Serhiy Storchaka [Mon, 14 Jan 2019 10:58:37 +0000 (12:58 +0200)]
bpo-34756: Silence only ImportError and AttributeError in sys.breakpointhook(). (GH-9457)

6 years agobpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)
MichaelSaah [Mon, 14 Jan 2019 10:23:39 +0000 (05:23 -0500)]
bpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)

Previously, calling the strftime() method on a datetime object with a
trailing '%' in the format string would result in an exception. However,
this only occured when the datetime C module was being used; the python
implementation did not match this behavior. Datetime is now PEP-399
compliant, and will not throw an exception on a trailing '%'.

6 years agobpo-35730: Disable IDLE test_reload assertion. (GH-11543)
Terry Jan Reedy [Sun, 13 Jan 2019 17:50:29 +0000 (12:50 -0500)]
bpo-35730: Disable IDLE test_reload assertion. (GH-11543)

IDLE's test_squeezer.SqueezerTest.test_reload, added for issue 35196,
failed on both Gentoo buildbots.

6 years agobpo-35196: Optimize Squeezer's write() interception (GH-10454)
Tal Einat [Sun, 13 Jan 2019 15:01:50 +0000 (17:01 +0200)]
bpo-35196: Optimize Squeezer's write() interception (GH-10454)

The new functionality of Squeezer.reload() is also tested, along with some general
re-working of the tests in test_squeezer.py.

6 years agobpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)
Anthony Sottile [Sun, 13 Jan 2019 04:05:13 +0000 (20:05 -0800)]
bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)

6 years agobpo-34512: Document platform-specific strftime() behavior for non-ASCII format string...
Alexey Izbyshev [Sat, 12 Jan 2019 17:21:54 +0000 (00:21 +0700)]
bpo-34512: Document platform-specific strftime() behavior for non-ASCII format strings (GH-8948)

6 years agobpo-35552: Fix reading past the end in PyUnicode_FromFormat() and PyBytes_FromFormat...
Serhiy Storchaka [Sat, 12 Jan 2019 08:30:35 +0000 (10:30 +0200)]
bpo-35552: Fix reading past the end in PyUnicode_FromFormat() and PyBytes_FromFormat(). (GH-11276)

Format characters "%s" and "%V" in PyUnicode_FromFormat() and "%s" in PyBytes_FromFormat()
no longer read memory past the limit if precision is specified.

6 years agobpo-35634: Raise an error when first passed kwargs contains duplicated keys. (GH...
Serhiy Storchaka [Sat, 12 Jan 2019 08:12:24 +0000 (10:12 +0200)]
bpo-35634: Raise an error when first passed kwargs contains duplicated keys. (GH-11438)

6 years agobpo-35494: Improve syntax error messages for unbalanced parentheses in f-string....
Serhiy Storchaka [Sat, 12 Jan 2019 07:46:50 +0000 (09:46 +0200)]
bpo-35494: Improve syntax error messages for unbalanced parentheses in f-string. (GH-11161)

6 years agobpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)
Serhiy Storchaka [Sat, 12 Jan 2019 07:22:29 +0000 (09:22 +0200)]
bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)

Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat()
with empty result.

6 years agobpo-35719: Optimize multi-argument math functions. (GH-11527)
Serhiy Storchaka [Sat, 12 Jan 2019 06:26:34 +0000 (08:26 +0200)]
bpo-35719: Optimize multi-argument math functions. (GH-11527)

Use the fast call convention for math functions atan2(),
copysign(), hypot() and remainder() and inline unpacking
arguments. This sped up them by 1.3--2.5 times.

6 years agobpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)
Serhiy Storchaka [Sat, 12 Jan 2019 06:25:41 +0000 (08:25 +0200)]
bpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)

Inline PyArg_UnpackTuple() and _PyArg_UnpackStack() in performance
sensitive code in the builtins and operator modules.

6 years agobpo-34838: Use subclass_of for math.dist. (GH-9659)
Ammar Askar [Sat, 12 Jan 2019 06:23:41 +0000 (01:23 -0500)]
bpo-34838: Use subclass_of for math.dist. (GH-9659)

Argument clinic now generates fast inline code for
positional parsing, so the manually implemented type
check in math.dist can be removed.

6 years agobpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)
Eric Snow [Fri, 11 Jan 2019 21:26:55 +0000 (14:26 -0700)]
bpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)

This change separates the signal handling trigger in the eval loop from the "pending calls" machinery. There is no semantic change and the difference in performance is insignificant.

The change makes both components less confusing. It also eliminates the risk of changes to the pending calls affecting signal handling. This is particularly relevant for some upcoming pending calls changes I have in the works.

6 years agobpo-34569: Fix subinterpreter 32-bit ABI, pystate.c/_new_long_object() (gh-9127)
Michael Felt [Fri, 11 Jan 2019 18:17:03 +0000 (19:17 +0100)]
bpo-34569: Fix subinterpreter 32-bit  ABI, pystate.c/_new_long_object() (gh-9127)

This fixes ShareableTypeTests.test_int() in Lib/test/test__xxsubinterpreters.py.

6 years agobpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)
Serhiy Storchaka [Fri, 11 Jan 2019 16:01:42 +0000 (18:01 +0200)]
bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)

Use _PyArg_CheckPositional() and inlined code instead of
PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters
are positional and use the "object" converter.

6 years agobpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313)
Serhiy Storchaka [Fri, 11 Jan 2019 14:01:14 +0000 (16:01 +0200)]
bpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313)

6 years agobpo-32710: Fix _overlapped.Overlapped memory leaks (GH-11489)
Victor Stinner [Fri, 11 Jan 2019 13:35:14 +0000 (14:35 +0100)]
bpo-32710: Fix _overlapped.Overlapped memory leaks (GH-11489)

Fix memory leaks in asyncio ProactorEventLoop on overlapped operation
failures.

Changes:

* Implement the tp_traverse slot in the _overlapped.Overlapped type
  to help to break reference cycles and identify referrers in the
  garbage collector.
* Always clear overlapped on failure: not only set type to
  TYPE_NOT_STARTED, but release also resources.

6 years agobpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)
Joannah Nanjekye [Fri, 11 Jan 2019 13:19:57 +0000 (16:19 +0300)]
bpo-35716: Update time.CLOCK_MONOTONIC_RAW doc (GH-11517)

Document that the time.CLOCK_MONOTONIC_RAW constant
is now also available on macOS 10.12.

Co-authored-by: Ricardo Fraile <rfraile@rfraile.eu>
6 years agobpo-32146: Add documentation about frozen executables on Unix (GH-5850)
Bo Bayles [Thu, 10 Jan 2019 17:51:28 +0000 (11:51 -0600)]
bpo-32146: Add documentation about frozen executables on Unix (GH-5850)

6 years agobpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)
Joannah Nanjekye [Thu, 10 Jan 2019 16:56:38 +0000 (19:56 +0300)]
bpo-35702: Add new identifier time.CLOCK_UPTIME_RAW for macOS 10.12 (GH-11503)

6 years agobpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH...
Zackery Spytz [Thu, 10 Jan 2019 16:12:31 +0000 (09:12 -0700)]
bpo-35470: Fix a reference counting bug in _PyImport_FindExtensionObjectEx(). (GH-11128)

6 years agobpo-24746: Fix doctest failures when running the testsuite with -R (#11501)
Pablo Galindo [Thu, 10 Jan 2019 14:29:40 +0000 (14:29 +0000)]
bpo-24746: Fix doctest failures when running the testsuite with -R (#11501)

6 years agoasyncio: __del__() keep reference to warnings.warn (GH-11491)
Victor Stinner [Thu, 10 Jan 2019 10:24:40 +0000 (11:24 +0100)]
asyncio: __del__() keep reference to warnings.warn (GH-11491)

* asyncio: __del__() keep reference to warnings.warn

The __del__() methods of asyncio classes now keep a strong reference
to the warnings.warn() to be able to display the ResourceWarning
warning in more cases. Ensure that the function remains available if
instances are destroyed late during Python shutdown (while module
symbols are cleared).

* Rename warn parameter to _warn

"_warn" name is a hint that it's not the regular warnings.warn()
function.

6 years agoIocpProactor: prevent modification if closed (GH-11494)
Victor Stinner [Thu, 10 Jan 2019 10:23:26 +0000 (11:23 +0100)]
IocpProactor: prevent modification if closed (GH-11494)

* _wait_for_handle(), _register() and _unregister() methods of
  IocpProactor now raise an exception if closed
* Add "closed" to IocpProactor.__repr__()
* Simplify IocpProactor.close()

6 years agobpo-34855: Fix EXTERNALS_DIR build variable for Windows (GH-11177)
antektek [Thu, 10 Jan 2019 00:19:29 +0000 (01:19 +0100)]
bpo-34855: Fix EXTERNALS_DIR build variable for Windows (GH-11177)

6 years agoDistutils no longer needs to remain compatible with 2.3 (GH-11423)
Miro Hrončok [Wed, 9 Jan 2019 23:55:03 +0000 (00:55 +0100)]
Distutils no longer needs to remain compatible with 2.3 (GH-11423)

6 years agoUpdate bugs.rst (GH-9648)
Andre Delfino [Wed, 9 Jan 2019 22:54:12 +0000 (19:54 -0300)]
Update bugs.rst (GH-9648)

6 years agobpo-35404: Clarify how to import _structure in email.message doc (GH-10886)
Charles-Axel Dein [Wed, 9 Jan 2019 22:52:10 +0000 (23:52 +0100)]
bpo-35404: Clarify how to import _structure in email.message doc (GH-10886)

6 years agoAdd example to the documentation for calling unittest.mock.patch with create=True...
Pablo Galindo [Wed, 9 Jan 2019 21:43:24 +0000 (21:43 +0000)]
Add example to the documentation for calling unittest.mock.patch with create=True (GH-11056)

6 years agobpo-35641: Move IDLE blurb to IDLE directory (#11479)
Terry Jan Reedy [Wed, 9 Jan 2019 15:44:07 +0000 (10:44 -0500)]
bpo-35641: Move IDLE blurb to IDLE directory (#11479)

6 years agobpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639)
Sanyam Khurana [Wed, 9 Jan 2019 13:38:38 +0000 (19:08 +0530)]
bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639)

6 years agobpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)
Victor Stinner [Tue, 8 Jan 2019 13:23:09 +0000 (14:23 +0100)]
bpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)

Fix a memory leak in asyncio in the ProactorEventLoop when ReadFile()
or WSASend() overlapped operation fail immediately: release the
internal buffer.

6 years agobpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport restrictio...
Steve Dower [Tue, 8 Jan 2019 10:38:01 +0000 (02:38 -0800)]
bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport restrictions (GH-11465)

Also adds extra steps to the CI build for Windows on Azure Pipelines to validate that the various layouts at least execute.

6 years agobpo-35568: add 'raise_signal' function (GH-11335)
Vladimir Matveev [Tue, 8 Jan 2019 09:58:25 +0000 (01:58 -0800)]
bpo-35568: add 'raise_signal' function (GH-11335)

As in title, expose C `raise` function as `raise_function` in `signal` module. Also drop existing `raise_signal` in `_testcapi` module and replace all usages with new function.

https://bugs.python.org/issue35568

6 years agobpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)
chrullrich [Tue, 8 Jan 2019 02:57:29 +0000 (03:57 +0100)]
bpo-35374: Avoid trailing space in hhc file name if found on PATH. (GH-10849)

6 years agoRemove spurious quote in Azure Pipelines script (GH-10763)
Pierre Glaser [Tue, 8 Jan 2019 02:02:26 +0000 (03:02 +0100)]
Remove spurious quote in Azure Pipelines script (GH-10763)

6 years agobpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)
Victor Stinner [Tue, 8 Jan 2019 01:46:59 +0000 (02:46 +0100)]
bpo-35682: Fix _ProactorBasePipeTransport._force_close() (GH-11462)

bpo-32622, bpo-35682: Fix asyncio.ProactorEventLoop.sendfile(): don't
attempt to set the result of an internal future if it's already done.

Fix asyncio _ProactorBasePipeTransport._force_close(): don't set the
result of _empty_waiter if it's already done.

6 years agobpo-35642: Remove asynciomodule.c from pythoncore.vcxproj (GH-11410)
Gregory Szorc [Tue, 8 Jan 2019 01:27:18 +0000 (18:27 -0700)]
bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj (GH-11410)

This module is built by _asyncio.vcxproj and does not need to be included in pythoncore.

6 years agobpo-33717: pythoninfo logs information of all clocks (GH-11460)
Victor Stinner [Tue, 8 Jan 2019 00:27:27 +0000 (01:27 +0100)]
bpo-33717: pythoninfo logs information of all clocks (GH-11460)

test.pythoninfo now logs information of all clocks, not only time.time() and
time.perf_counter().

6 years agobpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)
Victor Stinner [Mon, 7 Jan 2019 22:55:57 +0000 (23:55 +0100)]
bpo-32710: test_asyncio: test_sendfile reset policy (GH-11461)

test_asyncio/test_sendfile.py now resets the event loop policy using
tearDownModule() as done in other tests, to prevent a warning when
running tests on Windows.

6 years agobpo-35664: Optimize operator.itemgetter (GH-11435)
Raymond Hettinger [Mon, 7 Jan 2019 16:38:41 +0000 (09:38 -0700)]
bpo-35664: Optimize operator.itemgetter (GH-11435)

6 years agobpo-35560: Remove assertion from format(float, "n") (GH-11288)
Xtreak [Mon, 7 Jan 2019 15:09:14 +0000 (20:39 +0530)]
bpo-35560: Remove assertion from format(float, "n") (GH-11288)

Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.

6 years agotest_threading_local: add missing "import sys" (GH-8049)
cclauss [Sun, 6 Jan 2019 22:10:55 +0000 (23:10 +0100)]
test_threading_local: add missing "import sys" (GH-8049)

6 years agobpo-35660: Fix imports in idlelib.window (#11434)
Cheryl Sabella [Sun, 6 Jan 2019 20:55:52 +0000 (15:55 -0500)]
bpo-35660: Fix imports in idlelib.window (#11434)

* bpo-35660: IDLE: Remove * import from window.py

* sys was being imported through the *, so also added an import sys.

* Update 2019-01-04-19-14-29.bpo-35660.hMxI7N.rst

Anyone who wants details can check the issue, where I added the point about the sys import bug.

6 years agobpo-35488: Add tests for ** glob matching in pathlib (GH-11171)
Anthony Shaw [Sun, 6 Jan 2019 20:31:29 +0000 (07:31 +1100)]
bpo-35488: Add tests for ** glob matching in pathlib (GH-11171)

6 years agoremove doc-string declaration no longer used after AC conversion (GH-11444)
Tal Einat [Sun, 6 Jan 2019 08:10:34 +0000 (10:10 +0200)]
remove doc-string declaration no longer used after AC conversion (GH-11444)

6 years agobpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)
Vladimir Matveev [Sat, 5 Jan 2019 20:44:59 +0000 (12:44 -0800)]
bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)

6 years agobpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)
Ville Skyttä [Fri, 4 Jan 2019 14:14:32 +0000 (16:14 +0200)]
bpo-35631: Improve typing docs wrt abstract/concrete collection types (GH-11396)

https://bugs.python.org/issue35631

6 years agobpo-31450: Remove documentation mentioning that subprocess's child_traceback is avail...
Harmandeep Singh [Thu, 3 Jan 2019 19:53:56 +0000 (01:23 +0530)]
bpo-31450: Remove documentation mentioning that subprocess's child_traceback is available with the parent process (GH-11422)

6 years agobpo-35641: IDLE - format calltip properly when no docstring (GH-11415)
Emmanuel Arias [Thu, 3 Jan 2019 07:47:58 +0000 (04:47 -0300)]
bpo-35641: IDLE - format calltip properly when no docstring (GH-11415)

6 years agobpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395)
Terry Jan Reedy [Thu, 3 Jan 2019 03:04:06 +0000 (22:04 -0500)]
bpo-33987: IDLE - use ttk Frame for ttk widgets (GH-11395)

6 years agobpo-35525: Correct the argument name for NNTP.starttls() (GH-11310)
Harmandeep Singh [Wed, 2 Jan 2019 21:05:19 +0000 (02:35 +0530)]
bpo-35525: Correct the argument name for NNTP.starttls() (GH-11310)

6 years agocloses bpo-35643: Fix a SyntaxWarning: invalid escape sequence in Modules/_sha3/clean...
Mickaël Schoentgen [Wed, 2 Jan 2019 19:26:57 +0000 (20:26 +0100)]
closes bpo-35643: Fix a SyntaxWarning: invalid escape sequence in Modules/_sha3/cleanup.py (GH-11411)

6 years agoBump copyright years to 2019. (GH-11404)
Benjamin Peterson [Wed, 2 Jan 2019 15:46:53 +0000 (07:46 -0800)]
Bump copyright years to 2019. (GH-11404)