]> granicus.if.org Git - python/log
python
5 years agobpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059)
Paul Monson [Thu, 18 Apr 2019 01:09:16 +0000 (18:09 -0700)]
bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059)

5 years agobpo-36638: Fix WindowsLoadTracker exception on some Windows versions (GH-12849)
Paul Monson [Thu, 18 Apr 2019 01:06:06 +0000 (18:06 -0700)]
bpo-36638: Fix WindowsLoadTracker exception on some Windows versions (GH-12849)

5 years agoFix wrong indentation of a paragraph in documentation (GH-12868)
cocoatomo [Thu, 18 Apr 2019 00:54:51 +0000 (09:54 +0900)]
Fix wrong indentation of a paragraph in documentation (GH-12868)

This paragraph doesn't seem to be a part of code, but merged into previous code block.

5 years agobpo-32913: Added re.Match.groupdict example to regex HOWTO (GH-5821)
josh [Wed, 17 Apr 2019 22:43:30 +0000 (22:43 +0000)]
bpo-32913: Added re.Match.groupdict example to regex HOWTO (GH-5821)

5 years agobpo-36649: Remove trailing spaces for registry keys when installed via the Store...
Steve Dower [Wed, 17 Apr 2019 21:31:32 +0000 (14:31 -0700)]
bpo-36649: Remove trailing spaces for registry keys when installed via the Store (GH-12865)

5 years agobpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)
Victor Stinner [Wed, 17 Apr 2019 21:02:26 +0000 (23:02 +0200)]
bpo-36635: Change pyport.h for Py_BUILD_CORE_MODULE define (GH-12853)

Change PyAPI_FUNC(type), PyAPI_DATA(type) and PyMODINIT_FUNC macros
of pyport.h when Py_BUILD_CORE_MODULE is defined.

The Py_BUILD_CORE_MODULE define must be now be used to build a C
extension as a dynamic library accessing Python internals: export the
PyInit_xxx() function in DLL exports on Windows.

Changes:

* Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE now imply
  Py_BUILD_CORE directy in pyport.h.
* ceval.c compilation now fails with an error if Py_BUILD_CORE is not
  defined, just to ensure that Python is build with the correct
  defines.
* setup.py now compiles _pickle.c with Py_BUILD_CORE_MODULE define.
* setup.py compiles _json.c with Py_BUILD_CORE_MODULE define, rather
  than Py_BUILD_CORE_BUILTIN define
* PCbuild/pythoncore.vcxproj: Add Py_BUILD_CORE_BUILTIN define.

5 years agobpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852)
Victor Stinner [Wed, 17 Apr 2019 16:09:12 +0000 (18:09 +0200)]
bpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852)

Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.

5 years agobpo-35755: Don't say "to mimick Unix which command behavior" (GH-12861)
Victor Stinner [Wed, 17 Apr 2019 15:44:06 +0000 (17:44 +0200)]
bpo-35755: Don't say "to mimick Unix which command behavior" (GH-12861)

5 years agobpo-31904: Port test_resource to VxWorks (GH-12719)
Lihua Zhao [Wed, 17 Apr 2019 15:41:33 +0000 (23:41 +0800)]
bpo-31904: Port test_resource to VxWorks (GH-12719)

Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.

5 years agobpo-31904: Port test_cmd_line to VxWorks (#12648)
Lihua Zhao [Wed, 17 Apr 2019 15:33:25 +0000 (23:33 +0800)]
bpo-31904:  Port test_cmd_line to VxWorks (#12648)

subprocess.Popen doesn't support preexec on VxWorks.

5 years agobpo-35755: Remove current directory from posixpath.defpath (GH-11586)
Victor Stinner [Wed, 17 Apr 2019 15:05:30 +0000 (17:05 +0200)]
bpo-35755: Remove current directory from posixpath.defpath (GH-11586)

Document the change in a NEWS entry of the Security category.

5 years agobpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858)
Victor Stinner [Wed, 17 Apr 2019 14:26:36 +0000 (16:26 +0200)]
bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858)

shutil.which() and distutils.spawn.find_executable() now use
os.confstr("CS_PATH") if available instead of os.defpath, if the PATH
environment variable is not set.

Don't use os.confstr("CS_PATH") nor os.defpath if the PATH
environment variable is set to an empty string to mimick Unix 'which'
command behavior.

Changes:

* find_executable() now starts by checking for the executable in the
  current working directly case. Add an explicit
  "if not path: return None".
* Add tests for PATH='' (empty string), PATH=':' and for PATHEXT.

5 years agoClarify file-closing example in tutorial (GH-11652)
Colin Watson [Wed, 17 Apr 2019 12:18:37 +0000 (13:18 +0100)]
Clarify file-closing example in tutorial (GH-11652)

5 years agobpo-31904: Fix test_tabnanny on VxWorks (GH-12646)
Lihua Zhao [Wed, 17 Apr 2019 09:46:50 +0000 (17:46 +0800)]
bpo-31904: Fix test_tabnanny on VxWorks (GH-12646)

 Fix test_tabnanny on VxWorks: adjust ENOENT error message,
use os.strerror().

5 years agobpo-36642: make unicodedata const (GH-12855)
Inada Naoki [Tue, 16 Apr 2019 23:40:34 +0000 (08:40 +0900)]
bpo-36642: make unicodedata const (GH-12855)

5 years agobpo-36641: Add "const" to PyDoc_VAR macro (GH-12854)
Inada Naoki [Tue, 16 Apr 2019 23:39:46 +0000 (08:39 +0900)]
bpo-36641: Add "const" to PyDoc_VAR macro (GH-12854)

It reduces "data" segment in python about 200KB.

5 years agobpo-33783: Use proper class markup for random.Random docs (GHè7817)
Matthias Bussonnier [Tue, 16 Apr 2019 16:47:11 +0000 (09:47 -0700)]
bpo-33783: Use proper class markup for random.Random docs (GHè7817)

Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
5 years agoAdd myself to CODEOWNERS for sqlite3 and urllib.robotparser (GH-12856)
Berker Peksag [Tue, 16 Apr 2019 13:54:56 +0000 (16:54 +0300)]
Add myself to CODEOWNERS for sqlite3 and urllib.robotparser (GH-12856)

5 years agobpo-36345: Update wsgiref example (GH-12562)
Stéphane Wirtel [Tue, 16 Apr 2019 12:52:54 +0000 (14:52 +0200)]
bpo-36345: Update wsgiref example (GH-12562)

Use literalinclude markup to include Tools/scripts/serve.py code.
Tools/scripts/serve.py first argument on the command line is now optional.

5 years agobpo-27860: ipaddress: fix Interface missed some attributes (GH-12836)
Inada Naoki [Mon, 15 Apr 2019 23:32:28 +0000 (08:32 +0900)]
bpo-27860: ipaddress: fix Interface missed some attributes (GH-12836)

IPv4Interface and IPv6Interface did not has netmask and hostmask
attributes when its argument is bytes or int.

This commit extracts method for constructors of Network and Interface,
and ensure Interface class always provides them.

5 years agobpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)
Victor Stinner [Mon, 15 Apr 2019 16:23:20 +0000 (18:23 +0200)]
bpo-36348: IMAP4.logout() doesn't ignore exc (GH-12411)

The imap.IMAP4.logout() method no longer ignores silently arbitrary
exceptions.

Changes:

* The IMAP4.logout() method now expects a "BYE" untagged response,
  rather than relying on _check_bye() which raises a self.abort()
  exception.
* IMAP4.__exit__() now does nothing if the client already logged out.
* Add more debug info if test_logout() tests fail.

5 years agobpo-36389: Cleanup gc.set_threshold() (GH-12844)
Victor Stinner [Mon, 15 Apr 2019 15:54:09 +0000 (17:54 +0200)]
bpo-36389: Cleanup gc.set_threshold() (GH-12844)

Don't assign generations[2].threshold to generations[2].threshold:
useless operation.

5 years agobpo-35134: Add cpython/pymem.h to build system (GH-12842)
Victor Stinner [Mon, 15 Apr 2019 15:29:31 +0000 (17:29 +0200)]
bpo-35134: Add cpython/pymem.h to build system (GH-12842)

5 years agobpo-35134: Add Include/cpython/pymem.h (GH-12840)
Victor Stinner [Mon, 15 Apr 2019 15:00:19 +0000 (17:00 +0200)]
bpo-35134: Add Include/cpython/pymem.h (GH-12840)

Move unstable CPython API from Include/pymem.h into a new
Include/cpython/pymem.h header file.

5 years agoDoc: update PendingDeprecationWarning explanation (GH-12837)
Inada Naoki [Mon, 15 Apr 2019 12:40:23 +0000 (21:40 +0900)]
Doc: update PendingDeprecationWarning explanation (GH-12837)

Keep the nudge towards DeprecationWarning, but remove the
"Note" markup and generally shorten the description.

Ref: https://github.com/python/cpython/pull/12505/files#r273978757

5 years agobpo-36625: Remove obsolete comments from docstrings in fractions module (GH-12822)
Jakub Molinski [Mon, 15 Apr 2019 12:37:04 +0000 (14:37 +0200)]
bpo-36625: Remove obsolete comments from docstrings in fractions module (GH-12822)

Remove left-over references to Python 3.0 as the future in Fraction class docstrings.

5 years agobpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834)
Victor Stinner [Mon, 15 Apr 2019 10:34:53 +0000 (12:34 +0200)]
bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834)

Fix test_imap4_host_default_value() of test_imaplib: catch also
errno.ENETUNREACH error.

5 years agobpo-31904: Port the time module on VxWorks (GH-12305)
pxinwr [Mon, 15 Apr 2019 09:06:21 +0000 (17:06 +0800)]
bpo-31904: Port the time module on VxWorks (GH-12305)

time.clock() is not available on VxWorks.

5 years agobpo-31904: Don't build the _crypt extension on VxWorks (GH-12833)
pxinwr [Mon, 15 Apr 2019 09:02:20 +0000 (17:02 +0800)]
bpo-31904: Don't build the _crypt extension on VxWorks (GH-12833)

5 years agobpo-27860: use cached_property (GH-12832)
Inada Naoki [Mon, 15 Apr 2019 07:01:00 +0000 (16:01 +0900)]
bpo-27860: use cached_property (GH-12832)

* cached_property is more efficient than hand crafted cache.
* In IPv[46]Network, `self.network.prefixlen` is same to `self._prefixlen`.

5 years agobpo-30485: Re-allow empty strings in ElementPath namespace mappings since they might...
Stefan Behnel [Sun, 14 Apr 2019 19:12:34 +0000 (21:12 +0200)]
bpo-30485: Re-allow empty strings in ElementPath namespace mappings since they might actually be harmless and unused (and thus went undetected previously). (#12830)

5 years agobpo-16079: fix duplicate test method name in test_gzip. (GH-12827)
Gregory P. Smith [Sun, 14 Apr 2019 17:32:07 +0000 (10:32 -0700)]
bpo-16079: fix duplicate test method name in test_gzip. (GH-12827)

5 years agobpo-31658: Make xml.sax.parse accepting Path objects (GH-8564)
Mickaël Schoentgen [Sun, 14 Apr 2019 09:16:54 +0000 (09:16 +0000)]
bpo-31658: Make xml.sax.parse accepting Path objects (GH-8564)

5 years agobpo-30485: support a default prefix mapping in ElementPath by passing None as prefix...
Stefan Behnel [Sun, 14 Apr 2019 08:09:09 +0000 (10:09 +0200)]
bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823)

5 years agobpo-36227: ElementTree.tostring() default_namespace and xml_declaration arguments...
Bernt Røskar Brenna [Sun, 14 Apr 2019 08:07:02 +0000 (10:07 +0200)]
bpo-36227: ElementTree.tostring() default_namespace and xml_declaration arguments (GH-12225)

Add new keyword arguments "default_namespace" and "xml_declaration" to functions ET.tostring() and ET.tostringlist(), as known from ElementTree.write().

5 years agobpo-36593: Fix isinstance check for Mock objects with spec executed under tracing...
Xtreak [Sat, 13 Apr 2019 19:12:33 +0000 (00:42 +0530)]
bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790)

In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the __class__ attribute. To avoid this, as a workaround, alias the usage of super .

5 years agobpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can terminate...
Pablo Galindo [Sat, 13 Apr 2019 16:23:24 +0000 (17:23 +0100)]
bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread (GH-12541)

Calling these function from a thread when the runtime is finalizing will terminate
the thread, even if the thread was not created by Python. Users can use
_Py_IsFinalizing or sys.is_finalizing to check if the interpreter is in the process of
being finalized before calling this function to avoid unwanted termination.

5 years agoSkip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
Pablo Galindo [Sat, 13 Apr 2019 16:06:03 +0000 (17:06 +0100)]
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)

5 years agobpo-36623: Clean parser headers and include files (GH-12253)
Pablo Galindo [Sat, 13 Apr 2019 16:05:14 +0000 (17:05 +0100)]
bpo-36623: Clean parser headers and include files (GH-12253)

After the removal of pgen, multiple header and function prototypes that lack implementation or are unused are still lying around.

5 years agobpo-18610: Update wsgiref.validate docstring for wsgi.input read() (GH-11663)
Cheryl Sabella [Sat, 13 Apr 2019 12:01:15 +0000 (08:01 -0400)]
bpo-18610: Update wsgiref.validate docstring for wsgi.input read() (GH-11663)

5 years agobpo-35734: ipaddress: remove unused methods (GH-11591)
Rémi Lapeyre [Sat, 13 Apr 2019 08:49:34 +0000 (10:49 +0200)]
bpo-35734: ipaddress: remove unused methods (GH-11591)

5 years agoDoc: define PY_SSIZE_T_CLEAN always (GH-12794)
Inada Naoki [Sat, 13 Apr 2019 01:46:21 +0000 (10:46 +0900)]
Doc: define PY_SSIZE_T_CLEAN always (GH-12794)

5 years agobpo-36618: Don't add -fmax-type-align flag to old clang (GH-12811)
Victor Stinner [Fri, 12 Apr 2019 22:51:07 +0000 (00:51 +0200)]
bpo-36618: Don't add -fmax-type-align flag to old clang (GH-12811)

5 years agobpo-35581: Document @typing.type_check_only (GH-11312)
Sebastian Rittau [Fri, 12 Apr 2019 22:33:40 +0000 (00:33 +0200)]
bpo-35581: Document @typing.type_check_only (GH-11312)

5 years agobpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)
mrh1997 [Fri, 12 Apr 2019 22:26:47 +0000 (00:26 +0200)]
bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)

Since bpo-30291 it is possible to specify the architecture of Python when using the launcher

5 years agobpo-18748: test_io: silence destructor errors (GH-12805)
Victor Stinner [Fri, 12 Apr 2019 19:58:24 +0000 (21:58 +0200)]
bpo-18748: test_io: silence destructor errors (GH-12805)

5 years agobpo-36611: Disable serialno field of debug memory allocators (#12796)
Victor Stinner [Fri, 12 Apr 2019 19:54:06 +0000 (21:54 +0200)]
bpo-36611: Disable serialno field of debug memory allocators (#12796)

Omit serialno field from debug hooks on Python memory allocators to
reduce the memory footprint by 5%.

Enable tracemalloc to get the traceback where a memory block has been
allocated when a fatal memory error is logged to decide where to put
a breakpoint.

Compile Python with PYMEM_DEBUG_SERIALNO defined to get back the
field.

5 years agobpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)
Victor Stinner [Fri, 12 Apr 2019 19:51:34 +0000 (21:51 +0200)]
bpo-36389: Add _PyObject_CheckConsistency() function (GH-12803)

Add a new _PyObject_CheckConsistency() function which can be used to
help debugging. The function is available in release mode.

Add a 'check_content' parameter to _PyDict_CheckConsistency().

5 years agobpo-36618: Add -fmax-type-align=8 flag for clang (GH-12809)
Victor Stinner [Fri, 12 Apr 2019 19:27:37 +0000 (21:27 +0200)]
bpo-36618: Add -fmax-type-align=8 flag for clang (GH-12809)

Add -fmax-type-align=8 to CFLAGS when clang compiler is detected.

The pymalloc memory allocator aligns memory on 8 bytes. On x86-64,
clang expects alignment on 16 bytes by default and so uses MOVAPS
instruction which can lead to segmentation fault. Instruct clang that
Python is limited to alignemnt on 8 bytes to use MOVUPS instruction
instead: slower but don't trigger a SIGSEGV if the memory is not
aligned on 16 bytes.

Sadly, the flag must be expected to CFLAGS and not just
CFLAGS_NODIST, since third party C extensions can have the same
issue.

5 years agoAllow Windows layout builds to fully skip code signing (GH-12808)
Steve Dower [Fri, 12 Apr 2019 18:24:15 +0000 (11:24 -0700)]
Allow Windows layout builds to fully skip code signing (GH-12808)

5 years agobpo-36509: Add iot layout for Windows IoT containers (GH-12663)
Paul Monson [Fri, 12 Apr 2019 16:55:57 +0000 (09:55 -0700)]
bpo-36509: Add iot layout for Windows IoT containers (GH-12663)

This enables using the `--preset-iot` option with the PC/layout script, but does not enable IoT builds as part of any normal release.

5 years agoEnable building nuget packages for ARM32 (GH-12669)
Paul Monson [Fri, 12 Apr 2019 16:36:38 +0000 (09:36 -0700)]
Enable building nuget packages for ARM32 (GH-12669)

5 years agobpo-33608: Revert "Factor out a private, per-interpreter _Py_AddPendingCall()." ...
Eric Snow [Fri, 12 Apr 2019 16:20:10 +0000 (10:20 -0600)]
bpo-33608: Revert "Factor out a private, per-interpreter _Py_AddPendingCall()." (gh-12806)

This reverts commit f13c5c8b9401a9dc19e95d8b420ee100ac022208 (gh-12360).

5 years agoCorrect grammar in concurrent/futures/process.py docstring (GH-12761)
Thomas Grainger [Fri, 12 Apr 2019 16:17:17 +0000 (17:17 +0100)]
Correct grammar in concurrent/futures/process.py docstring (GH-12761)

5 years agoIndicate that seek and tell are mandatory on BufferedRandom. (GH-11216)
Christopher Head [Fri, 12 Apr 2019 15:50:41 +0000 (08:50 -0700)]
Indicate that seek and tell are mandatory on BufferedRandom. (GH-11216)

For BufferedReader and BufferedWriter, seek and tell operations are
optional (they may or may not exist based on the underlying stream). For
BufferedRandom, they are mandatory: a BufferedRandom should not be
constructed over an unseekable underlying stream. Document this.

5 years agobpo-36549: str.capitalize now titlecases the first character instead of uppercasing...
Kingsley M [Fri, 12 Apr 2019 15:35:39 +0000 (16:35 +0100)]
bpo-36549: str.capitalize now titlecases the first character instead of uppercasing it (GH-12804)

5 years agobpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-12360)
Eric Snow [Fri, 12 Apr 2019 15:18:16 +0000 (09:18 -0600)]
bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (gh-12360)

This is effectively an un-revert of #11617 and #12024 (reverted in #12159). Portions of those were merged in other PRs (with lower risk) and this represents the remainder. Note that I found 3 different bugs in the original PRs and have fixed them here.

5 years agobpo-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786)
Victor Stinner [Fri, 12 Apr 2019 15:06:47 +0000 (17:06 +0200)]
bpo-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786)

In development mode (-X dev) and in debug build, the io.IOBase
destructor now logs close() exceptions. These exceptions are silent
by default in release mode.

5 years agobpo-36588: On AIX, remove major version from sys.platform (GH-12787)
Michael Felt [Fri, 12 Apr 2019 14:15:32 +0000 (16:15 +0200)]
bpo-36588: On AIX, remove major version from sys.platform (GH-12787)

On AIX, sys.platform doesn't contain the major version anymore.
Always return 'aix', instead of 'aix3' .. 'aix7'.  Since
older Python versions include the version number, it is recommended to
always use sys.platform.startswith('aix').

5 years agobpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)
Victor Stinner [Fri, 12 Apr 2019 13:15:04 +0000 (15:15 +0200)]
bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)

Fix test_sys.test_getallocatedblocks() when tracemalloc is enabled.
If the name of Python memory allocators cannot get read, consider
that pymalloc is disabled.

Fix the following error:

./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks

ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest)
------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_sys.py", line 770, in test_getallocatedblocks
    alloc_name = _testcapi.pymem_getallocatorsname()
RuntimeError: cannot get allocators name

5 years agobpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)
Inada Naoki [Fri, 12 Apr 2019 07:11:28 +0000 (16:11 +0900)]
bpo-20180: Use argument clinic for dict.pop() and dict.popitem() (GH-12792)

5 years agobpo-20582: add link for manpage for flags on getnameinfo() (GH-11977)
Emmanuel Arias [Thu, 11 Apr 2019 21:13:37 +0000 (18:13 -0300)]
bpo-20582: add link for manpage for flags on getnameinfo() (GH-11977)

5 years agobpo-36605: make tags: parse Modules/_io directory (GH-12789)
Victor Stinner [Thu, 11 Apr 2019 20:28:12 +0000 (22:28 +0200)]
bpo-36605: make tags: parse Modules/_io directory (GH-12789)

"make tags" and "make TAGS" now also parse Modules/_io/*.c
and Modules/_io/*.h.

5 years agobpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)
Victor Stinner [Thu, 11 Apr 2019 11:01:15 +0000 (13:01 +0200)]
bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)

Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().

5 years agobpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378)
Inada Naoki [Thu, 11 Apr 2019 10:11:46 +0000 (19:11 +0900)]
bpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378)

5 years agobpo-36597: fix weakref example code (GH-12779)
Inada Naoki [Thu, 11 Apr 2019 10:05:32 +0000 (19:05 +0900)]
bpo-36597: fix weakref example code (GH-12779)

Commit 57b1a2862 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.

5 years agobpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)
Victor Stinner [Thu, 11 Apr 2019 09:33:27 +0000 (11:33 +0200)]
bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)

Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.

Add unit tests on _PyObject_IsFreed().

5 years agobpo-36597: fix random doctest failure (GH-12776)
Inada Naoki [Thu, 11 Apr 2019 08:53:49 +0000 (17:53 +0900)]
bpo-36597: fix random doctest failure (GH-12776)

5 years agobpo-36597: Disable Travis CI doctest job (GH-12775)
Victor Stinner [Thu, 11 Apr 2019 07:46:46 +0000 (09:46 +0200)]
bpo-36597: Disable Travis CI doctest job (GH-12775)

Disable the job to unblock the CI until the issue is properly
understood.

5 years agobpo-36416: Correct bytes.rpartition documentation (GH-12543)
pewscorner [Thu, 11 Apr 2019 06:58:43 +0000 (08:58 +0200)]
bpo-36416: Correct bytes.rpartition documentation (GH-12543)

5 years agobetter __init__.py explanation in tutorial (#12763)
Inada Naoki [Thu, 11 Apr 2019 06:10:35 +0000 (15:10 +0900)]
better __init__.py explanation in tutorial (#12763)

* better __init__.py explanation in tutorial

* Update Doc/tutorial/modules.rst

Co-Authored-By: methane <songofacandy@gmail.com>
5 years agoDoc: fix typo in IncrementalDecoder.setstate (GH-12724)
Christopher Thorne [Thu, 11 Apr 2019 06:09:29 +0000 (07:09 +0100)]
Doc: fix typo in IncrementalDecoder.setstate (GH-12724)

5 years agobpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)
Victor Stinner [Wed, 10 Apr 2019 23:38:48 +0000 (01:38 +0200)]
bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)

Set CUSTOMIZED_OSX_COMPILER to True to disable
_osx_support.customize_compiler().

5 years agofix typo in doc (#12686)
Caleb Marchent [Wed, 10 Apr 2019 22:03:02 +0000 (23:03 +0100)]
fix typo in doc (#12686)

5 years agobpo-36559: random module: optimize sha512 import (GH-12742)
Christian Heimes [Wed, 10 Apr 2019 20:18:02 +0000 (22:18 +0200)]
bpo-36559: random module: optimize sha512 import (GH-12742)

The random module now prefers the lean internal _sha512 module over hashlib
for seed(version=2) to optimize import time.

Signed-off-by: Christian Heimes <christian@python.org>
5 years agobpo-34144: Fix of venv acvtivate.bat for win 10 (GH-8321)
Lorenz Mende [Wed, 10 Apr 2019 17:19:16 +0000 (19:19 +0200)]
bpo-34144: Fix of venv acvtivate.bat for win 10 (GH-8321)

The script needs to be updated to support win 10/ 1803 chcp.com command (output has trailing dot)

https://bugs.python.org/issue34144

5 years agobpo-14826: document that URLopener quotes fullurl. (GH-12758)
Gregory P. Smith [Wed, 10 Apr 2019 09:17:48 +0000 (02:17 -0700)]
bpo-14826: document that URLopener quotes fullurl. (GH-12758)

5 years agobpo-12910: update and correct quote docstring (#2568)
Jörn Hees [Wed, 10 Apr 2019 00:31:18 +0000 (02:31 +0200)]
bpo-12910: update and correct quote docstring (#2568)

Fixes some mistakes and misleadings in the quote function docstring:
- reserved chars are never actually used by quote code, unreserved chars are
- reserved chars were wrong and incomplete
- mentioned that use-case is not minimal quoting wrt. RFC, but cautious quoting

5 years agoFix typos in compile.c comments (GH-12752)
Simeon [Tue, 9 Apr 2019 23:36:57 +0000 (19:36 -0400)]
Fix typos in compile.c comments (GH-12752)

5 years agobpo-31512: Add non-elevated symlink support for Windows (GH-3652)
Vidar Tonaas Fauske [Tue, 9 Apr 2019 18:19:46 +0000 (20:19 +0200)]
bpo-31512: Add non-elevated symlink support for Windows (GH-3652)

5 years agobpo-34373: Fix time.mktime() on AIX (GH-12726)
Victor Stinner [Tue, 9 Apr 2019 17:12:26 +0000 (19:12 +0200)]
bpo-34373: Fix time.mktime() on AIX (GH-12726)

Fix time.mktime() error handling on AIX for year before 1970.

Other changes:

* mktime(): rename variable 'buf' to 'tm'.
* _PyTime_localtime():

  * Use "localtime" rather than "ctime" in the error message
    (specific to AIX).
  * Always initialize errno to 0 just in case if localtime_r()
    doesn't set errno on error.
  * On AIX, avoid abs() which is limited to int type.
  * EINVAL constant is now always available.

5 years agobpo-36577: setup.py reports missing OpenSSL again (GH-12746)
Christian Heimes [Tue, 9 Apr 2019 16:40:12 +0000 (18:40 +0200)]
bpo-36577: setup.py reports missing OpenSSL again (GH-12746)

[bpo-36146](https://bugs.python.org/issue36146) introduced another regression. In case of missing OpenSSL
libraries or headers, setup.py no longer reported _hashlib and _ssl to
be missing.

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

5 years agobpo-36560: regrtest: don't collect the GC twice (GH-12747)
Victor Stinner [Tue, 9 Apr 2019 16:26:16 +0000 (18:26 +0200)]
bpo-36560: regrtest: don't collect the GC twice (GH-12747)

dash_R() function of libregrtest doesn't call support.gc_collect()
directly anymore: it's already called by dash_R_cleanup().

Call dash_R_cleanup() before starting the loop.

5 years agobpo-36508: python-config don't export LINKFORSHARED (GH-12661)
Victor Stinner [Tue, 9 Apr 2019 16:12:44 +0000 (18:12 +0200)]
bpo-36508: python-config don't export LINKFORSHARED (GH-12661)

python-config --ldflags no longer includes flags of the LINKFORSHARED
variable. The LINKFORSHARED variable must only be used to build
executables.

5 years agobpo-36544 : Fix regression introduced in bpo-36146 (GH-12708)
xdegaye [Tue, 9 Apr 2019 15:20:08 +0000 (17:20 +0200)]
bpo-36544 : Fix regression introduced in bpo-36146 (GH-12708)

https://bugs.python.org/issue36544

5 years agobpo-34139: Remove unix datagram socket from FS before binding (GH-8323)
Quentin Dawans [Tue, 9 Apr 2019 13:40:59 +0000 (15:40 +0200)]
bpo-34139: Remove unix datagram socket from FS before binding (GH-8323)

https://bugs.python.org/issue34139

5 years agobpo-36560: Fix reference leak hunting in regrtest (GH-12744)
Victor Stinner [Tue, 9 Apr 2019 12:23:47 +0000 (14:23 +0200)]
bpo-36560: Fix reference leak hunting in regrtest (GH-12744)

Fix reference leak hunting in regrtest: compute also deltas (of
reference count, allocated memory blocks, file descriptor count)
during warmup, to ensure that everything is initialized before
starting to hunt reference leaks.

Other changes:

* Replace gc.collect() with support.gc_collect()
* Move calls to read memory statistics from dash_R_cleanup() to
  dash_R()
* Pass regrtest 'ns' to dash_R()
* dash_R() is now more quiet with --quiet option (don't display
  progress).
* Precompute the full range for "for it in range(repcount):" to
  ensure that the iteration doesn't allocate anything new.
* dash_R() now is responsible to call warm_caches().

5 years agobpo-34060: Report system load when running test suite for Windows (GH-8357)
Ammar Askar [Tue, 9 Apr 2019 12:20:41 +0000 (08:20 -0400)]
bpo-34060: Report system load when running test suite for Windows (GH-8357)

While Windows exposes the system processor queue length, the raw value
used for load calculations on Unix systems, it does not provide an API
to access the averaged value. Hence to calculate the load we must track
and average it ourselves. We can't use multiprocessing or a thread to
read it in the background while the tests run since using those would
conflict with test_multiprocessing and test_xxsubprocess.

Thus, we use Window's asynchronous IO API to run the tracker in the
background with it sampling at the correct rate. When we wish to access
the load we check to see if there's new data on the stream, if there is,
we update our load values.

5 years agobpo-33456: site module documentation - fix wrong default for key in pyvenv.cfg (GH...
Lukas Waymann [Tue, 9 Apr 2019 07:27:36 +0000 (15:27 +0800)]
bpo-33456: site module documentation - fix wrong default for key in pyvenv.cfg (GH-6755)

5 years agobpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762)
Matthias Bussonnier [Tue, 9 Apr 2019 07:17:25 +0000 (00:17 -0700)]
bpo-33461: emit DeprecationWarning when json.loads(encoding=...) is used (GH-6762)

5 years agofix code styling (GH-12737)
Inada Naoki [Tue, 9 Apr 2019 05:54:30 +0000 (14:54 +0900)]
fix code styling (GH-12737)

5 years agocloses bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH...
Steve Palmer [Tue, 9 Apr 2019 04:35:27 +0000 (05:35 +0100)]
closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893)

Move all documentation regarding the readinto method into either io.RawIOBase or io.BufferedIOBase.

Corresponding changes to documentation in the _pyio.py module.

5 years agoBPO-17561: set create_server backlog default to None (GH-12735)
Giampaolo Rodola [Tue, 9 Apr 2019 02:42:06 +0000 (04:42 +0200)]
BPO-17561: set create_server backlog default to None (GH-12735)

It turns out doing socket.listen(0) does not equal to "choose a
reasonable default". It actually means "set backlog to 0".
As such set backlog=None as the default for socket.create_server.
Fixes the following BB failures:
https://github.com/python/cpython/pull/11784#issuecomment-481036369
Ref. BPO-1756, GH-11784.

5 years agobpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733)
Victor Stinner [Mon, 8 Apr 2019 23:36:34 +0000 (01:36 +0200)]
bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733)

Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module: fix _get_dump() reimplementation of libregrtest.

5 years agobpo-35934: Add socket.create_server() utility function (GH-11784)
Giampaolo Rodola [Mon, 8 Apr 2019 22:34:02 +0000 (00:34 +0200)]
bpo-35934: Add socket.create_server() utility function (GH-11784)

5 years agobpo-35416: fix potential resource warnings in distutils (GH-10918)
Mickaël Schoentgen [Mon, 8 Apr 2019 13:08:48 +0000 (13:08 +0000)]
bpo-35416: fix potential resource warnings in distutils (GH-10918)

5 years agoAdd a What's New entry for bpo-35459. (GH-12706)
Serhiy Storchaka [Mon, 8 Apr 2019 11:34:04 +0000 (14:34 +0300)]
Add a What's New entry for bpo-35459. (GH-12706)

5 years agoCorrect "inplace" with "in-place" (GH-10480)
Andre Delfino [Mon, 8 Apr 2019 09:14:43 +0000 (06:14 -0300)]
Correct "inplace" with "in-place" (GH-10480)

5 years agoremove duplicate code in biscet (GH-1270)
Chillar Anand [Mon, 8 Apr 2019 08:01:09 +0000 (13:31 +0530)]
remove duplicate code in biscet (GH-1270)

5 years agobpo-36503: remove references to 'aix3' and 'aix4' (GH-12658)
Michael Felt [Mon, 8 Apr 2019 00:51:33 +0000 (02:51 +0200)]
bpo-36503: remove references to 'aix3' and 'aix4' (GH-12658)