Terry Jan Reedy [Mon, 21 Mar 2016 01:06:15 +0000 (21:06 -0400)]
Merge with 3.5
Terry Jan Reedy [Mon, 21 Mar 2016 01:05:57 +0000 (21:05 -0400)]
Issue #15660: Further clarify 0 prefix for width specifier in formats.
Serhiy Storchaka [Sun, 20 Mar 2016 21:47:48 +0000 (23:47 +0200)]
Issue #26581: Use the first coding cookie on a line, not the last one.
Serhiy Storchaka [Sun, 20 Mar 2016 21:36:29 +0000 (23:36 +0200)]
Issue #26581: Use the first coding cookie on a line, not the last one.
Serhiy Storchaka [Sun, 20 Mar 2016 21:12:00 +0000 (23:12 +0200)]
Issues #25643, #26581: Added new tests for detecting Python source code encoding.
Serhiy Storchaka [Sun, 20 Mar 2016 20:29:40 +0000 (22:29 +0200)]
Added new tests for detecting Python source code encoding.
Berker Peksag [Sun, 20 Mar 2016 15:30:25 +0000 (17:30 +0200)]
Issue #12813: uuid.uuid4() no longer depends on ctypes
uuid.uuid4() always uses os.urandom() after
756d040aa8e8.
Berker Peksag [Sun, 20 Mar 2016 15:29:56 +0000 (17:29 +0200)]
Issue #12813: uuid.uuid4() no longer depends on ctypes
uuid.uuid4() always uses os.urandom() after
756d040aa8e8.
Berker Peksag [Sun, 20 Mar 2016 14:49:29 +0000 (16:49 +0200)]
Issue #19164: Improve exception message of uuid.UUID()
Patch by jgauthier.
Berker Peksag [Sun, 20 Mar 2016 14:49:10 +0000 (16:49 +0200)]
Issue #19164: Improve exception message of uuid.UUID()
Patch by jgauthier.
Berker Peksag [Sun, 20 Mar 2016 10:51:16 +0000 (12:51 +0200)]
Issue #26593: Fix typo in logging HOWTO
Patch by Andrew Szeto.
Berker Peksag [Sun, 20 Mar 2016 10:50:56 +0000 (12:50 +0200)]
Issue #26593: Fix typo in logging HOWTO
Patch by Andrew Szeto.
Berker Peksag [Sat, 19 Mar 2016 11:16:52 +0000 (13:16 +0200)]
Issue #19265: Improve test coverage of datetime.tzinfo
Without the patch, line 1010 of Lib/datetime.py wasn't covered
by the test suite.
Patch by Colin Williams.
Berker Peksag [Sat, 19 Mar 2016 11:16:32 +0000 (13:16 +0200)]
Issue #19265: Improve test coverage of datetime.tzinfo
Without the patch, line 1010 of Lib/datetime.py wasn't covered
by the test suite.
Patch by Colin Williams.
Berker Peksag [Sat, 19 Mar 2016 09:44:17 +0000 (11:44 +0200)]
Issue #18787: spwd.getspnam() now raises a PermissionError if the user
doesn't have privileges.
Victor Stinner [Sat, 19 Mar 2016 09:33:50 +0000 (10:33 +0100)]
fix indentation in Py_DECREF()
Victor Stinner [Sat, 19 Mar 2016 09:33:25 +0000 (10:33 +0100)]
Issue #26567: enhance ResourceWarning example
Victor Stinner [Sat, 19 Mar 2016 09:00:08 +0000 (10:00 +0100)]
Try again to fix test_warnings on Windows
Issue #26567: normalize newlines in test_tracemalloc.
Berker Peksag [Sat, 19 Mar 2016 07:05:59 +0000 (09:05 +0200)]
Issue #26560: Avoid potential ValueError in BaseHandler.start_response
Initial patch by Peter Inglesby.
Berker Peksag [Sat, 19 Mar 2016 07:04:59 +0000 (09:04 +0200)]
Issue #26560: Avoid potential ValueError in BaseHandler.start_response
Initial patch by Peter Inglesby.
Victor Stinner [Sat, 19 Mar 2016 01:51:45 +0000 (02:51 +0100)]
Try to fix test_warnings on Windows
Issue #26567.
Victor Stinner [Sat, 19 Mar 2016 01:01:48 +0000 (02:01 +0100)]
ResourceWarning: Revert change on socket and scandir
io.FileIO has a safe implementation of destructor, but not socket nor scandir.
Victor Stinner [Sat, 19 Mar 2016 01:11:56 +0000 (02:11 +0100)]
Fix test_logging
Issue #26568: Fix implementation of showwarning() and formatwarning() for
test_logging.
Victor Stinner [Sat, 19 Mar 2016 00:03:51 +0000 (01:03 +0100)]
On ResourceWarning, log traceback where the object was allocated
Issue #26567:
* Add a new function PyErr_ResourceWarning() function to pass the destroyed
object
* Add a source attribute to warnings.WarningMessage
* Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where
source object was allocated.
Victor Stinner [Fri, 18 Mar 2016 23:47:17 +0000 (00:47 +0100)]
Add _showwarnmsg() and _formatwarnmsg() to warnings
Issue #26568: add new _showwarnmsg() and _formatwarnmsg() functions to the
warnings module.
The C function warn_explicit() now calls warnings._showwarnmsg() with a
warnings.WarningMessage as parameter, instead of calling warnings.showwarning()
with multiple parameters.
_showwarnmsg() calls warnings.showwarning() if warnings.showwarning() was
replaced. Same for _formatwarnmsg(): call warnings.formatwarning() if it was
replaced.
Brett Cannon [Fri, 18 Mar 2016 20:24:15 +0000 (13:24 -0700)]
Merge for issue #26095
Brett Cannon [Fri, 18 Mar 2016 20:23:58 +0000 (13:23 -0700)]
Suggest people use feature detection in porting guide
Brett Cannon [Fri, 18 Mar 2016 18:54:22 +0000 (11:54 -0700)]
Issue #26252: Add an example on how to register a finder
Ezio Melotti [Fri, 18 Mar 2016 18:11:30 +0000 (20:11 +0200)]
#26250: merge with 3.5.
Ezio Melotti [Fri, 18 Mar 2016 18:10:36 +0000 (20:10 +0200)]
#26250: document the sqlite3.Cursor.connection attribute. Initial patches by Aviv Palivoda and Varpu Rantala.
Brett Cannon [Fri, 18 Mar 2016 17:30:21 +0000 (10:30 -0700)]
Merge for issue #26271
Brett Cannon [Fri, 18 Mar 2016 17:29:43 +0000 (10:29 -0700)]
Issue #26271: Fix the Freeze tool to use variables passed in from the
configure script related to compiler flags.
Thanks to Daniel Shaulov for the bug report and patch.
Victor Stinner [Fri, 18 Mar 2016 14:10:43 +0000 (15:10 +0100)]
Doc: fix typos, patch written by Stefan Behnel
Serhiy Storchaka [Fri, 18 Mar 2016 12:37:53 +0000 (14:37 +0200)]
Fixed a typo.
Serhiy Storchaka [Fri, 18 Mar 2016 12:36:47 +0000 (14:36 +0200)]
Fixed a typo.
Berker Peksag [Fri, 18 Mar 2016 12:26:29 +0000 (14:26 +0200)]
Issue #26580: Remove outdated reference to ftpmirror
Patch by SilentGhost.
Berker Peksag [Fri, 18 Mar 2016 12:26:08 +0000 (14:26 +0200)]
Issue #26580: Remove outdated reference to ftpmirror
Patch by SilentGhost.
Victor Stinner [Fri, 18 Mar 2016 10:04:31 +0000 (11:04 +0100)]
Enhance documentation on malloc debug hooks
Issue #26564, #26516, #26563.
Steve Dower [Thu, 17 Mar 2016 22:02:53 +0000 (15:02 -0700)]
Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji.
Steve Dower [Thu, 17 Mar 2016 22:02:39 +0000 (15:02 -0700)]
Issue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty. Patch by Baji.
Ned Deily [Thu, 17 Mar 2016 21:56:42 +0000 (17:56 -0400)]
Issue #26583: merge from 3.5
Ned Deily [Thu, 17 Mar 2016 21:53:52 +0000 (17:53 -0400)]
Issue #26583: Skip test_timestamp_overflow in test_import if bytecode
files cannot be written.
Donald Stufft [Thu, 17 Mar 2016 15:01:35 +0000 (11:01 -0400)]
Merge 3.5 into default
Donald Stufft [Thu, 17 Mar 2016 15:01:04 +0000 (11:01 -0400)]
Merge 3.4 into 3.5
Donald Stufft [Thu, 17 Mar 2016 15:00:08 +0000 (11:00 -0400)]
Upgrade ensurepip._bundled pip to 8.1.1 and setuptools to 20.3
Victor Stinner [Thu, 17 Mar 2016 08:11:54 +0000 (09:11 +0100)]
Merge 3.5
Martin Panter [Fri, 18 Mar 2016 03:03:10 +0000 (03:03 +0000)]
Issue #17603: Merge configure.ac fix from 3.5
Martin Panter [Fri, 18 Mar 2016 02:36:41 +0000 (02:36 +0000)]
Issue #17603: Check for st_blocks field without requiring fileblocks.o
Victor Stinner [Thu, 17 Mar 2016 08:06:41 +0000 (09:06 +0100)]
Fix pyclbr to support importing packages
Issue #26569: Fix pyclbr.readmodule() and pyclbr.readmodule_ex() to support
importing packages.
Victor Stinner [Thu, 17 Mar 2016 00:46:09 +0000 (01:46 +0100)]
Null merge 3.5
Victor Stinner [Wed, 16 Mar 2016 22:45:31 +0000 (23:45 +0100)]
Null merge 3.5
Victor Stinner [Wed, 16 Mar 2016 22:25:02 +0000 (23:25 +0100)]
Fix usage of PyMem_Malloc() in overlapped.c
Issue #26563: Replace PyMem_Malloc() with PyMem_RawFree() since
PostToQueueCallback() calls PyMem_RawFree() (previously PyMem_Free()) in a new
C thread which doesn't hold the GIL.
Victor Stinner [Wed, 16 Mar 2016 22:25:02 +0000 (23:25 +0100)]
Fix usage of PyMem_Malloc() in overlapped.c
Issue #26563: Replace PyMem_Malloc() with PyMem_RawFree() since
PostToQueueCallback() calls PyMem_RawFree() (previously PyMem_Free()) in a new
C thread which doesn't hold the GIL.
Martin Panter [Thu, 17 Mar 2016 06:42:48 +0000 (06:42 +0000)]
Issue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent Ghost
Victor Stinner [Wed, 16 Mar 2016 22:19:15 +0000 (23:19 +0100)]
Py_FatalError: disable faulthandler earlier
Issue #26563: Py_FatalError: disable faulthandler before trying to flush
sys.stdout and sys.stderr.
Victor Stinner [Wed, 16 Mar 2016 22:19:15 +0000 (23:19 +0100)]
Py_FatalError: disable faulthandler earlier
Issue #26563: Py_FatalError: disable faulthandler before trying to flush
sys.stdout and sys.stderr.
Victor Stinner [Wed, 16 Mar 2016 21:45:24 +0000 (22:45 +0100)]
faulthandler now works in non-Python threads
Issue #26563:
* Add _PyGILState_GetInterpreterStateUnsafe() function: the single
PyInterpreterState used by this process' GILState implementation.
* Enhance _Py_DumpTracebackThreads() to retrieve the interpreter state from
autoInterpreterState in last resort. The function now accepts NULL for interp
and current_tstate parameters.
* test_faulthandler: fix a ResourceWarning when test is interrupted by CTRL+c
Victor Stinner [Wed, 16 Mar 2016 13:30:16 +0000 (14:30 +0100)]
Fix usage of PyMem_Malloc() in os.stat()
Issue #26563: Replace PyMem_Malloc() with PyMem_RawMalloc() in the Windows
implementation of os.stat(), since the code is called without holding the GIL.
Victor Stinner [Wed, 16 Mar 2016 11:12:53 +0000 (12:12 +0100)]
Fail if PyMem_Malloc() is called without holding the GIL
Issue #26563: Debug hooks on Python memory allocators now raise a fatal error
if functions of the PyMem_Malloc() family are called without holding the GIL.
Victor Stinner [Wed, 16 Mar 2016 08:43:14 +0000 (09:43 +0100)]
Fix compilation error of traceback.c on Windows
Issue #26564.
Martin Panter [Thu, 17 Mar 2016 07:50:22 +0000 (07:50 +0000)]
Issue #21042: Revert Linux find_library() to return just filename
This reverts most of revision
3092cf163eb4. The change worked on x86
architectures, but did not work on ARM, probably due to extra ABI flags in
the ldconfig output.
Martin Panter [Thu, 17 Mar 2016 07:05:34 +0000 (07:05 +0000)]
Issue #26499: Merge HTTPResponse fix from 3.5
Victor Stinner [Tue, 15 Mar 2016 22:08:44 +0000 (23:08 +0100)]
regrtest: Fix module.__path__
Issue #26538: libregrtest: Fix setup_tests() to keep module.__path__ type
(_NamespacePath), don't convert to a list.
Add _NamespacePath.__setitem__() method to importlib._bootstrap_external.
Victor Stinner [Tue, 15 Mar 2016 22:36:28 +0000 (23:36 +0100)]
Issue #26564: Fix test_capi
Victor Stinner [Tue, 15 Mar 2016 21:49:40 +0000 (22:49 +0100)]
Oops, revert unwanted change used to create an example
Issue #26564.
Victor Stinner [Tue, 15 Mar 2016 21:22:13 +0000 (22:22 +0100)]
On memory error, dump the memory block traceback
Issue #26564: _PyObject_DebugDumpAddress() now dumps the traceback where a
memory block was allocated on memory block. Use the tracemalloc module to get
the traceback.
Victor Stinner [Tue, 15 Mar 2016 20:57:23 +0000 (21:57 +0100)]
Merge 3.5 (_tracemalloc)
Victor Stinner [Tue, 15 Mar 2016 20:57:02 +0000 (21:57 +0100)]
_tracemalloc: store lineno as unsigned int
Issue #26564. Cleanup the code, lineno is never negative.
Victor Stinner [Tue, 15 Mar 2016 20:49:37 +0000 (21:49 +0100)]
Enhance and rewrite traceback dump C functions
Issue #26564:
* Expose _Py_DumpASCII() and _Py_DumpDecimal() in traceback.h
* Change the type of the second _Py_DumpASCII() parameter from int to unsigned
long
* Rewrite _Py_DumpDecimal() and dump_hexadecimal() to write directly characters
in the expected order, avoid the need of reversing the string.
* dump_hexadecimal() limits width to the size of the buffer
* _Py_DumpASCII() does nothing if the object is not a Unicode string
* dump_frame() wrtites "???" as the line number if the line number is negative
Victor Stinner [Tue, 15 Mar 2016 16:24:13 +0000 (17:24 +0100)]
Merge 3.5 (test_faulthandler)
Victor Stinner [Tue, 15 Mar 2016 16:23:35 +0000 (17:23 +0100)]
faulthandler: Test Py_FatalError() with GIL released
Issue #26558.
Victor Stinner [Tue, 15 Mar 2016 13:28:04 +0000 (14:28 +0100)]
_tracemalloc: filename cannot be NULL
Victor Stinner [Tue, 15 Mar 2016 10:12:35 +0000 (11:12 +0100)]
Issue #26566: Rewrite test_signal.InterProcessSignalTests
* Add Lib/test/signalinterproctester.py
* Don't disable the garbage collector anymore
* Don't use os.fork() with a subprocess to not inherit existing signal handlers
or threads: start from a fresh process
* Don't use UNIX kill command to send a signal but Python os.kill()
* Use a timeout of 10 seconds to wait for the signal instead of 1 second
* Always use signal.pause(), instead of time.wait(1), to wait for a signal
* Use context manager on subprocess.Popen
* remove code to retry on EINTR: it's no more needed since the PEP 475
* remove unused function exit_subprocess()
* Cleanup the code
Antoine Pitrou [Tue, 15 Mar 2016 09:52:51 +0000 (10:52 +0100)]
Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested.
Antoine Pitrou [Tue, 15 Mar 2016 09:48:28 +0000 (10:48 +0100)]
Issue #26523: The multiprocessing thread pool (multiprocessing.dummy.Pool) was untested.
Robert Collins [Tue, 15 Mar 2016 00:33:28 +0000 (13:33 +1300)]
#25320: Handle sockets in directories unittest discovery is scanning.
Patch from Victor van den Elzen.
Robert Collins [Tue, 15 Mar 2016 00:29:17 +0000 (13:29 +1300)]
#25320: Handle sockets in directories unittest discovery is scanning.
Patch from Victor van den Elzen.
Victor Stinner [Mon, 14 Mar 2016 21:26:53 +0000 (22:26 +0100)]
Check the GIL in PyObject_Malloc()
Issue #26558: The debug hook of PyObject_Malloc() now checks that the GIL is
held when the function is called.
Victor Stinner [Mon, 14 Mar 2016 21:07:55 +0000 (22:07 +0100)]
Add more checks on the GIL
Issue #10915, #15751, #26558:
* PyGILState_Check() now returns 1 (success) before the creation of the GIL and
after the destruction of the GIL. It allows to use the function early in
Python initialization and late in Python finalization.
* Add a flag to disable PyGILState_Check(). Disable PyGILState_Check() when
Py_NewInterpreter() is called
* Add assert(PyGILState_Check()) to: _Py_dup(), _Py_fstat(), _Py_read()
and _Py_write()
Victor Stinner [Mon, 14 Mar 2016 20:55:43 +0000 (21:55 +0100)]
Issue #26516: Fix test_capi on AIX
Fix regex for parse a pointer address.
Victor Stinner [Mon, 14 Mar 2016 17:22:12 +0000 (18:22 +0100)]
Merge 3.5 (test_venv)
Victor Stinner [Mon, 14 Mar 2016 17:21:58 +0000 (18:21 +0100)]
Fix test_venv on FreeBSD buildbot
Ignore pip warning in test_venv.test_with_venv().
Victor Stinner [Mon, 14 Mar 2016 17:09:39 +0000 (18:09 +0100)]
_pickle: Fix load_counted_tuple(), use Py_ssize_t for size
Fix a warning on Windows 64-bit.
Victor Stinner [Mon, 14 Mar 2016 17:07:53 +0000 (18:07 +0100)]
posix_getcwd(): limit to INT_MAX on Windows
It's more to fix a conversion warning during compilation, I don't think that
Windows support current working directory larger than 2 GB ...
Victor Stinner [Mon, 14 Mar 2016 16:47:30 +0000 (17:47 +0100)]
Merge 3.5 (test_site)
Victor Stinner [Mon, 14 Mar 2016 16:47:03 +0000 (17:47 +0100)]
Skip test_site if USER_SITE cannot be created
Issue #17758: Skip test_site if site.USER_SITE directory doesn't exist and
cannot be created.
Victor Stinner [Mon, 14 Mar 2016 16:40:09 +0000 (17:40 +0100)]
Issue #26516: Fix test_capi on 32-bit system
On 32-bit system, only 4 bytes after dumped for the tail.
Victor Stinner [Mon, 14 Mar 2016 16:10:36 +0000 (17:10 +0100)]
Issue #26516: Fix test_capi on Windows
Pointers are formatted differently.
Victor Stinner [Mon, 14 Mar 2016 16:01:32 +0000 (17:01 +0100)]
Issue #26558: Remove useless check in tracemalloc
The first instruction of tracemalloc_add_trace() is traceback_new() which
already checks the GIL.
Victor Stinner [Mon, 14 Mar 2016 15:53:12 +0000 (16:53 +0100)]
Fix Py_FatalError() if called without the GIL
Issue #26558: If Py_FatalError() is called without the GIL, don't try to print
the current exception, nor try to flush stdout and stderr: only dump the
traceback of Python threads.
Victor Stinner [Mon, 14 Mar 2016 15:53:12 +0000 (16:53 +0100)]
Fix Py_FatalError() if called without the GIL
Issue #26558: If Py_FatalError() is called without the GIL, don't try to print
the current exception, nor try to flush stdout and stderr: only dump the
traceback of Python threads.
Victor Stinner [Mon, 14 Mar 2016 11:04:26 +0000 (12:04 +0100)]
Add PYTHONMALLOC env var
Issue #26516:
* Add PYTHONMALLOC environment variable to set the Python memory
allocators and/or install debug hooks.
* PyMem_SetupDebugHooks() can now also be used on Python compiled in release
mode.
* The PYTHONMALLOCSTATS environment variable can now also be used on Python
compiled in release mode. It now has no effect if set to an empty string.
* In debug mode, debug hooks are now also installed on Python memory allocators
when Python is configured without pymalloc.
Serhiy Storchaka [Mon, 14 Mar 2016 08:40:14 +0000 (10:40 +0200)]
Issue #20556: Used specific assert methods in threading tests.
Serhiy Storchaka [Mon, 14 Mar 2016 08:28:59 +0000 (10:28 +0200)]
Issue #20556: Used specific assert methods in threading tests.
Berker Peksag [Mon, 14 Mar 2016 04:06:03 +0000 (06:06 +0200)]
Issue #747320: Use email.utils.formatdate() to avoid code duplication
in BaseHTTPRequestHandler
Initial patch by karlcow.
Berker Peksag [Mon, 14 Mar 2016 03:48:28 +0000 (05:48 +0200)]
Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR
Berker Peksag [Mon, 14 Mar 2016 03:48:02 +0000 (05:48 +0200)]
Issue #16181: cookiejar.http2time() now returns None if year is higher than datetime.MAXYEAR
Ezio Melotti [Sun, 13 Mar 2016 09:41:45 +0000 (11:41 +0200)]
#24918: merge with 3.5.
Ezio Melotti [Sun, 13 Mar 2016 09:41:05 +0000 (11:41 +0200)]
#24918: fix CSS for code blocks when a side box is present. Patch by Manvi B.
Raymond Hettinger [Sun, 13 Mar 2016 08:12:49 +0000 (00:12 -0800)]
merge