]> granicus.if.org Git - python/log
python
8 years agoImplement finalizer for os.scandir() iterator
Victor Stinner [Tue, 22 Mar 2016 23:43:54 +0000 (00:43 +0100)]
Implement finalizer for os.scandir() iterator

Issue #26603:

* Implement finalizer for os.scandir() iterator
* Set the source parameter when emitting the ResourceWarning warning
* Close the iterator before emitting the warning

8 years agoAdd a source parameter to warnings.warn()
Victor Stinner [Tue, 22 Mar 2016 23:28:08 +0000 (00:28 +0100)]
Add a source parameter to warnings.warn()

Issue #26604:

* Add a new optional source parameter to _warnings.warn() and warnings.warn()
* Modify asyncore, asyncio and _pyio modules to set the source parameter when
  logging a ResourceWarning warning

8 years agoFix macros in hashtable.h
Victor Stinner [Tue, 22 Mar 2016 23:18:36 +0000 (00:18 +0100)]
Fix macros in hashtable.h

Add parenthesis.

8 years agoMerge 3.5
Victor Stinner [Tue, 22 Mar 2016 23:17:54 +0000 (00:17 +0100)]
Merge 3.5

8 years agoEnhance _tracemalloc debug mode
Victor Stinner [Tue, 22 Mar 2016 23:17:04 +0000 (00:17 +0100)]
Enhance _tracemalloc debug mode

Issue #26588: Enhance assertion in set_reentrant()

8 years agoFix _tracemalloc start/stop
Victor Stinner [Tue, 22 Mar 2016 23:10:24 +0000 (00:10 +0100)]
Fix _tracemalloc start/stop

Issue #26588: Fix _tracemalloc start/stop: don't play with the reentrant flag.

set_reentrant(1) fails with an assertion error if tracemalloc_init() is called
first in a thread A and tracemalloc_start() is called second in a thread B. The
tracemalloc is imported in a thread A. Importing the module calls
tracemalloc_init(). tracemalloc.start() is called in a thread B.

8 years agoIssue #26588: remove debug traces from _tracemalloc.
Victor Stinner [Tue, 22 Mar 2016 22:54:42 +0000 (23:54 +0100)]
Issue #26588: remove debug traces from _tracemalloc.

8 years agoIssue #26588: skip test_warnings.test_tracemalloc()
Victor Stinner [Tue, 22 Mar 2016 20:26:31 +0000 (21:26 +0100)]
Issue #26588: skip test_warnings.test_tracemalloc()

8 years agoIssue #26588: more debug traces
Victor Stinner [Tue, 22 Mar 2016 20:06:07 +0000 (21:06 +0100)]
Issue #26588: more debug traces

8 years agoIssue #26588: Don't call tracemalloc_init() at module initilization
Victor Stinner [Tue, 22 Mar 2016 19:56:49 +0000 (20:56 +0100)]
Issue #26588: Don't call tracemalloc_init() at module initilization

So it's possible to get debug messages in test_tracemalloc.

8 years agoIssue #26588: one more assertion
Victor Stinner [Tue, 22 Mar 2016 17:48:50 +0000 (18:48 +0100)]
Issue #26588: one more assertion

8 years agoAdd assertions on tracemalloc_reentrant_key
Victor Stinner [Tue, 22 Mar 2016 16:45:09 +0000 (17:45 +0100)]
Add assertions on tracemalloc_reentrant_key

Issue #26588.

8 years agoIssue #26588: more assertions
Victor Stinner [Tue, 22 Mar 2016 16:40:07 +0000 (17:40 +0100)]
Issue #26588: more assertions

8 years agoIssue #26588: fix compilation on Windows
Victor Stinner [Tue, 22 Mar 2016 15:29:02 +0000 (16:29 +0100)]
Issue #26588: fix compilation on Windows

8 years agoIssue #26588: add debug traces
Victor Stinner [Tue, 22 Mar 2016 15:13:31 +0000 (16:13 +0100)]
Issue #26588: add debug traces

Try to debug random failure on buildbots.

8 years agoregrtest: add time to output
Victor Stinner [Tue, 22 Mar 2016 14:14:09 +0000 (15:14 +0100)]
regrtest: add time to output

Timestamps should help to debug slow buildbots, and timeout and hang on
buildbots.

8 years agoAdd C functions _PyTraceMalloc_Track()
Victor Stinner [Tue, 22 Mar 2016 12:39:05 +0000 (13:39 +0100)]
Add C functions _PyTraceMalloc_Track()

Issue #26530:

* Add C functions _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() to track
  memory blocks using the tracemalloc module.
* Add _PyTraceMalloc_GetTraceback() to get the traceback of an object.

8 years agotracemalloc now supports domains
Victor Stinner [Tue, 22 Mar 2016 11:58:23 +0000 (12:58 +0100)]
tracemalloc now supports domains

Issue #26588:

* The _tracemalloc now supports tracing memory allocations of multiple address
  spaces (domains).
* Add domain parameter to tracemalloc_add_trace() and
  tracemalloc_remove_trace().
* tracemalloc_add_trace() now starts by removing the previous trace, if any.
* _tracemalloc._get_traces() now returns a list of (domain, size,
  traceback_frames): the domain is new.
* Add tracemalloc.DomainFilter
* tracemalloc.Filter: add an optional domain parameter to the constructor and a
  domain attribute
* Sublte change: use Py_uintptr_t rather than void* in the traces key.
* Add tracemalloc_config.use_domain, currently hardcoded to 1

8 years agoRemove _Py_hashtable_delete()
Victor Stinner [Tue, 22 Mar 2016 11:25:04 +0000 (12:25 +0100)]
Remove _Py_hashtable_delete()

Issue #26588: Remove _Py_hashtable_delete() from hashtable.h since the function
is not used. Keep the C code in hashtable.c as commented code if someone needs
it later.

8 years agoSimplify implementation of hashtable.c
Victor Stinner [Tue, 22 Mar 2016 11:13:01 +0000 (12:13 +0100)]
Simplify implementation of hashtable.c

Issue #26588: Remove copy_data, free_data and get_data_size callbacks from
hashtable.h. These callbacks are not used in Python and makes the code more
complex.

Remove also the _Py_HASHTABLE_ENTRY_DATA_AS_VOID_P() macro which uses an unsafe
pointer dereference (can cause memory alignment issue). Replace the macro usage
with _Py_HASHTABLE_ENTRY_READ_DATA() which is implemented with the safe
memcpy() function.

8 years agoIssue #24266: Merge readline Ctrl+C handling from 3.5
Martin Panter [Tue, 22 Mar 2016 09:28:58 +0000 (09:28 +0000)]
Issue #24266: Merge readline Ctrl+C handling from 3.5

8 years agoIssue #24266: Cancel history search mode with Ctrl+C in Readline 7
Martin Panter [Tue, 22 Mar 2016 07:24:05 +0000 (07:24 +0000)]
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7

8 years agomerge 3.5 (#17167)
Benjamin Peterson [Tue, 22 Mar 2016 05:31:31 +0000 (22:31 -0700)]
merge 3.5 (#17167)

8 years agomerge 3.4 (#17167)
Benjamin Peterson [Tue, 22 Mar 2016 05:31:24 +0000 (22:31 -0700)]
merge 3.4 (#17167)

8 years agoremove useless $ keyword (closes #17167)
Benjamin Peterson [Tue, 22 Mar 2016 05:31:02 +0000 (22:31 -0700)]
remove useless $ keyword (closes #17167)

8 years agoIssue #15699: Merge readline fixup from 3.5
Martin Panter [Tue, 22 Mar 2016 02:26:18 +0000 (02:26 +0000)]
Issue #15699: Merge readline fixup from 3.5

8 years agoIssue #15699: Reunite comment with variable
Martin Panter [Tue, 22 Mar 2016 02:19:29 +0000 (02:19 +0000)]
Issue #15699: Reunite comment with variable

8 years agoIssue #26588: Fix compilation warning on Windows
Victor Stinner [Mon, 21 Mar 2016 22:05:08 +0000 (23:05 +0100)]
Issue #26588: Fix compilation warning on Windows

8 years agohashtable.h now supports keys of any size
Victor Stinner [Mon, 21 Mar 2016 21:00:58 +0000 (22:00 +0100)]
hashtable.h now supports keys of any size

Issue #26588: hashtable.h now supports keys of any size, not only
sizeof(void*). It allows to support key larger than sizeof(void*), but also to
use less memory for key smaller than sizeof(void*).

8 years agoIssue #26525: Change ord example from nu to more easily recognized Euro sign.
Terry Jan Reedy [Mon, 21 Mar 2016 01:18:40 +0000 (21:18 -0400)]
Issue #26525: Change ord example from nu to more easily recognized Euro sign.

8 years agoIssue #15660: Further clarify 0 prefix for width specifier in formats.
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.

8 years agoIssue #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.

8 years agoAdded 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.

8 years agoIssue #12813: uuid.uuid4() no longer depends on ctypes
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.

8 years agoIssue #19164: Improve exception message of uuid.UUID()
Berker Peksag [Sun, 20 Mar 2016 14:49:10 +0000 (16:49 +0200)]
Issue #19164: Improve exception message of uuid.UUID()

Patch by jgauthier.

8 years agoIssue #26593: Fix typo in logging HOWTO
Berker Peksag [Sun, 20 Mar 2016 10:50:56 +0000 (12:50 +0200)]
Issue #26593: Fix typo in logging HOWTO

Patch by Andrew Szeto.

8 years agoIssue #19265: Improve test coverage of datetime.tzinfo
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.

8 years agocleanup iobase.c
Victor Stinner [Sat, 19 Mar 2016 09:36:36 +0000 (10:36 +0100)]
cleanup iobase.c

casting iobase_finalize to destructor is not needed

8 years agoFix test_ssl.test_refcycle()
Victor Stinner [Mon, 21 Mar 2016 16:26:04 +0000 (17:26 +0100)]
Fix test_ssl.test_refcycle()

Issue #26590: support.check_warnings() stores warnins, but ResourceWarning now
comes with a reference to the socket object which indirectly keeps the socket
alive.

8 years agoAdd socket finalizer
Victor Stinner [Mon, 21 Mar 2016 15:36:48 +0000 (16:36 +0100)]
Add socket finalizer

Issue #26590: Implement a safe finalizer for the _socket.socket type. It now
releases the GIL to close the socket. Use PyErr_ResourceWarning() to raise the
ResourceWarning to pass the socket object to the warning logger, to get the
traceback where the socket was created (allocated).

8 years agoOoops, revert changeset ea9efa06c137
Victor Stinner [Mon, 21 Mar 2016 13:36:39 +0000 (14:36 +0100)]
Ooops, revert changeset ea9efa06c137

Change pushed by mistake, the patch is still under review :-/

"""
_tracemalloc: add domain to trace keys

* hashtable.h: key has now a variable size
* _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces
"""

8 years agoOptimize bytes.replace(b'', b'.')
Victor Stinner [Mon, 21 Mar 2016 09:38:58 +0000 (10:38 +0100)]
Optimize bytes.replace(b'', b'.')

Issue #26574: Optimize bytes.replace(b'', b'.') and
bytearray.replace(b'', b'.'): up to 80% faster. Patch written by Josh Snider.

8 years agoIssue #26560: Avoid potential ValueError in BaseHandler.start_response
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.

8 years ago_tracemalloc: add domain to trace keys
Victor Stinner [Fri, 18 Mar 2016 20:52:22 +0000 (21:52 +0100)]
_tracemalloc: add domain to trace keys

* hashtable.h: key has now a variable size
* _tracemalloc uses (pointer: void*, domain: unsigned int) as key for traces

8 years agoMerge with 3.5
Terry Jan Reedy [Mon, 21 Mar 2016 01:18:54 +0000 (21:18 -0400)]
Merge with 3.5

8 years agoMerge with 3.5
Terry Jan Reedy [Mon, 21 Mar 2016 01:06:15 +0000 (21:06 -0400)]
Merge with 3.5

8 years agoIssue #26581: Use the first coding cookie on a line, not the last one.
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.

8 years agoIssues #25643, #26581: Added new tests for detecting Python source code encoding.
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.

8 years agoIssue #12813: uuid.uuid4() no longer depends on ctypes
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.

8 years agoIssue #19164: Improve exception message of uuid.UUID()
Berker Peksag [Sun, 20 Mar 2016 14:49:29 +0000 (16:49 +0200)]
Issue #19164: Improve exception message of uuid.UUID()

Patch by jgauthier.

8 years agoIssue #26593: Fix typo in logging HOWTO
Berker Peksag [Sun, 20 Mar 2016 10:51:16 +0000 (12:51 +0200)]
Issue #26593: Fix typo in logging HOWTO

Patch by Andrew Szeto.

8 years agoIssue #19265: Improve test coverage of datetime.tzinfo
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.

8 years agoIssue #18787: spwd.getspnam() now raises a PermissionError if the user
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.

8 years agofix indentation in Py_DECREF()
Victor Stinner [Sat, 19 Mar 2016 09:33:50 +0000 (10:33 +0100)]
fix indentation in Py_DECREF()

8 years agoIssue #26567: enhance ResourceWarning example
Victor Stinner [Sat, 19 Mar 2016 09:33:25 +0000 (10:33 +0100)]
Issue #26567: enhance ResourceWarning example

8 years agoTry again to fix test_warnings on Windows
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.

8 years agoIssue #26560: Avoid potential ValueError in BaseHandler.start_response
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.

8 years agoTry to fix test_warnings on Windows
Victor Stinner [Sat, 19 Mar 2016 01:51:45 +0000 (02:51 +0100)]
Try to fix test_warnings on Windows

Issue #26567.

8 years agoResourceWarning: Revert change on socket and scandir
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.

8 years agoFix test_logging
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.

8 years agoOn ResourceWarning, log traceback where the object was allocated
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.

8 years agoAdd _showwarnmsg() and _formatwarnmsg() to warnings
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.

8 years agoMerge for issue #26095
Brett Cannon [Fri, 18 Mar 2016 20:24:15 +0000 (13:24 -0700)]
Merge for issue #26095

8 years agoSuggest people use feature detection in porting guide
Brett Cannon [Fri, 18 Mar 2016 20:23:58 +0000 (13:23 -0700)]
Suggest people use feature detection in porting guide

8 years agoIssue #26252: Add an example on how to register a finder
Brett Cannon [Fri, 18 Mar 2016 18:54:22 +0000 (11:54 -0700)]
Issue #26252: Add an example on how to register a finder

8 years ago#26250: merge with 3.5.
Ezio Melotti [Fri, 18 Mar 2016 18:11:30 +0000 (20:11 +0200)]
#26250: merge with 3.5.

8 years ago#26250: document the sqlite3.Cursor.connection attribute. Initial patches by Aviv...
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.

8 years agoMerge for issue #26271
Brett Cannon [Fri, 18 Mar 2016 17:30:21 +0000 (10:30 -0700)]
Merge for issue #26271

8 years agoIssue #26271: Fix the Freeze tool to use variables passed in from the
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.

8 years agoDoc: fix typos, patch written by Stefan Behnel
Victor Stinner [Fri, 18 Mar 2016 14:10:43 +0000 (15:10 +0100)]
Doc: fix typos, patch written by Stefan Behnel

8 years agoFixed a typo.
Serhiy Storchaka [Fri, 18 Mar 2016 12:37:53 +0000 (14:37 +0200)]
Fixed a typo.

8 years agoFixed a typo.
Serhiy Storchaka [Fri, 18 Mar 2016 12:36:47 +0000 (14:36 +0200)]
Fixed a typo.

8 years agoIssue #26580: Remove outdated reference to ftpmirror
Berker Peksag [Fri, 18 Mar 2016 12:26:29 +0000 (14:26 +0200)]
Issue #26580: Remove outdated reference to ftpmirror

Patch by SilentGhost.

8 years agoIssue #26580: Remove outdated reference to ftpmirror
Berker Peksag [Fri, 18 Mar 2016 12:26:08 +0000 (14:26 +0200)]
Issue #26580: Remove outdated reference to ftpmirror

Patch by SilentGhost.

8 years agoEnhance documentation on malloc debug hooks
Victor Stinner [Fri, 18 Mar 2016 10:04:31 +0000 (11:04 +0100)]
Enhance documentation on malloc debug hooks

Issue #26564, #26516, #26563.

8 years agoIssue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty...
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.

8 years agoIssue #26313: ssl.py _load_windows_store_certs fails if windows cert store is empty...
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.

8 years agoIssue #26583: merge from 3.5
Ned Deily [Thu, 17 Mar 2016 21:56:42 +0000 (17:56 -0400)]
Issue #26583: merge from 3.5

8 years agoIssue #26583: Skip test_timestamp_overflow in test_import if bytecode
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.

8 years agoMerge 3.5 into default
Donald Stufft [Thu, 17 Mar 2016 15:01:35 +0000 (11:01 -0400)]
Merge 3.5 into default

8 years agoMerge 3.4 into 3.5
Donald Stufft [Thu, 17 Mar 2016 15:01:04 +0000 (11:01 -0400)]
Merge 3.4 into 3.5

8 years agoUpgrade ensurepip._bundled pip to 8.1.1 and setuptools to 20.3
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

8 years agoMerge 3.5
Victor Stinner [Thu, 17 Mar 2016 08:11:54 +0000 (09:11 +0100)]
Merge 3.5

8 years agoIssue #17603: Merge configure.ac fix from 3.5
Martin Panter [Fri, 18 Mar 2016 03:03:10 +0000 (03:03 +0000)]
Issue #17603: Merge configure.ac fix from 3.5

8 years agoIssue #17603: Check for st_blocks field without requiring fileblocks.o
Martin Panter [Fri, 18 Mar 2016 02:36:41 +0000 (02:36 +0000)]
Issue #17603: Check for st_blocks field without requiring fileblocks.o

8 years agoFix pyclbr to support importing packages
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.

8 years agoNull merge 3.5
Victor Stinner [Thu, 17 Mar 2016 00:46:09 +0000 (01:46 +0100)]
Null merge 3.5

8 years agoNull merge 3.5
Victor Stinner [Wed, 16 Mar 2016 22:45:31 +0000 (23:45 +0100)]
Null merge 3.5

8 years agoFix usage of PyMem_Malloc() in overlapped.c
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.

8 years agoFix usage of PyMem_Malloc() in overlapped.c
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.

8 years agoIssue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent Ghost
Martin Panter [Thu, 17 Mar 2016 06:42:48 +0000 (06:42 +0000)]
Issue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent Ghost

8 years agoPy_FatalError: disable faulthandler earlier
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.

8 years agoPy_FatalError: disable faulthandler earlier
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.

8 years agofaulthandler now works in non-Python threads
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

8 years agoFix usage of PyMem_Malloc() in os.stat()
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.

8 years agoFail if PyMem_Malloc() 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.

8 years agoFix compilation error of traceback.c on Windows
Victor Stinner [Wed, 16 Mar 2016 08:43:14 +0000 (09:43 +0100)]
Fix compilation error of traceback.c on Windows

Issue #26564.

8 years agoIssue #21042: Revert Linux find_library() to return just filename
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.

8 years agoIssue #26499: Merge HTTPResponse fix from 3.5
Martin Panter [Thu, 17 Mar 2016 07:05:34 +0000 (07:05 +0000)]
Issue #26499: Merge HTTPResponse fix from 3.5

8 years agoregrtest: Fix module.__path__
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.