Commit graph

9020 commits

Author SHA1 Message Date
Martin Panter
5503d4731e Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() 2016-03-27 05:35:19 +00:00
Victor Stinner
13f0c6166f _pickle: Fix load_counted_tuple(), use Py_ssize_t for size
Fix a warning on Windows 64-bit.
2016-03-14 18:09:39 +01:00
Alexander Belopolsky
1dcf4f9ee5 Issue#26616:Fixed a bug in datetime.astimezone() method. 2016-03-25 15:42:59 -04:00
Victor Stinner
d5871e62dd Enhance _tracemalloc debug mode
Issue #26588: Enhance assertion in set_reentrant()
2016-03-23 00:17:04 +01:00
Victor Stinner
2f49e09110 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.
2016-03-23 00:10:24 +01:00
Martin Panter
d6990d221b Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 2016-03-22 07:24:05 +00:00
Martin Panter
f6e9f47aa7 Issue #15699: Reunite comment with variable 2016-03-22 02:19:29 +00:00
Victor Stinner
6150f31963 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.
2016-03-16 23:25:02 +01:00
Victor Stinner
9528334e16 _tracemalloc: store lineno as unsigned int
Issue #26564. Cleanup the code, lineno is never negative.
2016-03-15 21:57:02 +01:00
Victor Stinner
57003f81ea faulthandler: Test Py_FatalError() with GIL released
Issue #26558.
2016-03-15 17:23:35 +01:00
Ned Deily
adbf8cecbe Issue #26505: Fix typos in getaddrinfo license text.
Patch by Alex Willmer.
2016-03-07 14:51:59 -05:00
Serhiy Storchaka
d55162517d Issue #25718: Fixed pickling and copying the accumulate() iterator with total is None. 2016-03-06 14:00:45 +02:00
Ned Deily
e1d4e58777 Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
current versions of OpenBSD and NetBSD.  Patch by A. Jesse Jiryu Davis.
2016-02-23 22:05:29 +11:00
Benjamin Peterson
1378f7ca68 merge 3.4 (closes #25939) 2016-02-17 22:18:20 -08:00
Benjamin Peterson
9491272751 open the cert store readonly
Patch from Chi Hsuan Yen.
2016-02-17 22:13:19 -08:00
Ned Deily
47299fd39c Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
versions 10.5 or higher.  Original patch by A. Jesse Jiryu Davis.
2016-02-15 16:54:08 +11:00
Martin Panter
c04fb56e36 Issue #26304: Change "allows to <verb>" to "allows <verb>ing" or similar
The original form is incorrect grammar and feels awkward, even though the
meaning is clear.
2016-02-10 05:44:01 +00:00
Serhiy Storchaka
988b9bcd88 Issue #26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
2016-02-08 17:56:36 +02:00
Serhiy Storchaka
3874128519 Issue #25945: Fixed bugs in functools.partial.
Fixed a crash when unpickle the functools.partial object with wrong state.
Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
2016-02-02 18:45:17 +02:00
Martin Panter
567d513b9b Issue #26244: Clarify default zlib compression level in documentation
Based on patch by Aviv Palivoda.
2016-02-03 07:06:33 +00:00
Raymond Hettinger
b00da57561 Issue #26194: Inserting into a full deque to raise an IndexError 2016-02-01 21:19:22 -08:00
Serhiy Storchaka
d5db57396b Issue #19883: Fixed possible integer overflows in zipimport. 2016-01-28 21:30:16 +02:00
Serhiy Storchaka
b49a1edc15 Merge heads 2016-01-28 19:56:40 +02:00
Serhiy Storchaka
c8241fdde7 Issue #26198: Added tests for "es", "et", "es#", "et#" and "C" format units
of PyArg_Parse*() functions.
2016-01-28 19:49:54 +02:00
Victor Stinner
7240030c52 Windows: Decode hostname from ANSI code page
Issue #26227: On Windows, getnameinfo(), gethostbyaddr() and gethostbyname_ex()
functions of the socket module now decode the hostname from the ANSI code page
rather than UTF-8.
2016-01-28 15:41:01 +01:00
Raymond Hettinger
3743432302 Issue #26194: Fix undefined behavior for deque.insert() when len(d) == maxlen 2016-01-26 21:44:16 -08:00
Benjamin Peterson
d52513cb22 merge 3.4 2016-01-21 22:03:55 -08:00
Benjamin Peterson
b1db758061 reject negative data_size 2016-01-21 22:02:46 -08:00
Benjamin Peterson
47b8ba22e3 merge 3.4 (#26171) 2016-01-20 22:25:06 -08:00
Benjamin Peterson
c4032da201 prevent buffer overflow in get_data (closes #26171) 2016-01-20 22:23:44 -08:00
Benjamin Peterson
d4d7737c3f merge 3.4 2016-01-20 22:07:43 -08:00
Benjamin Peterson
ef9cf08352 fix refleak in error condition 2016-01-20 22:06:43 -08:00
Victor Stinner
bfd316e750 Add _PyThreadState_UncheckedGet()
Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which
gets the current thread state, but don't call Py_FatalError() if it is NULL.

Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to
no more expose complex and private atomic types. Atomic types depends on the
compiler or can even depend on compiler options. The new function
_PyThreadState_UncheckedGet() allows to get the variable value without having
to care of the exact implementation of atomic types.

Changes:

* Replace direct usage of the _PyThreadState_Current variable with a call to
  _PyThreadState_UncheckedGet().
* In pystate.c, replace direct usage of the _PyThreadState_Current variable
  with the PyThreadState_GET() macro for readability.
* Document also PyThreadState_Get() in pystate.h
2016-01-20 11:12:38 +01:00
Brett Cannon
56aae8f304 Issue #17633: Improve support for namespace packages with zipimport.
Previously zipimport mistakenly limited namespace support to only the
top-level of the zipfile when it should have supported an arbitrary
depth.

Thanks to Phil Connel for the bug report and initial patch and Mike
Romberg for the final patch.
2016-01-15 11:22:19 -08:00
Brett Cannon
45adb3100b Issue #26114: Remove a reference to 'Numerical Recipes'.
While no copyright violation occurred, the license which
'Numerical Recipes' operates under is not amenable to Python,
so to prevent confusion it's easier to simply remove its mention.
2016-01-15 09:38:24 -08:00
Benjamin Peterson
3b1a8b3bbe enable SSL_MODE_RELEASE_BUFFERS
Patch by Cory Benfield.
2016-01-07 21:37:37 -08:00
Benjamin Peterson
4e3dd51396 merge 3.4 2016-01-01 11:56:16 -06:00
Benjamin Peterson
630329e4ea merge 3.3 2016-01-01 11:55:47 -06:00
Benjamin Peterson
0e617e22f0 remove some copyright notices supserseded by the toplevel ones 2016-01-01 11:53:47 -06:00
Serhiy Storchaka
1ba01615de Fixed formatting comman-line usage message. 2015-12-30 09:28:19 +02:00
Serhiy Storchaka
e4d65e3aab Issue #25447: Copying the lru_cache() wrapper object now always works,
independedly from the type of the wrapped object (by returning the original
object unchanged).
2015-12-28 23:58:07 +02:00
Serhiy Storchaka
191321d11b Issue #20440: More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled
automatically.
2015-12-27 15:41:34 +02:00
Serhiy Storchaka
4a1e70fc31 Issue #20440: Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
2015-12-27 12:36:18 +02:00
Serhiy Storchaka
bc4ded9537 Issue #24103: Fixed possible use after free in ElementTree.XMLPullParser. 2015-12-24 11:51:57 +02:00
Serhiy Storchaka
5a57ade58e Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
2015-12-24 10:35:59 +02:00
Serhiy Storchaka
66c08d90f6 Issue #25902: Fixed various refcount issues in ElementTree iteration. 2015-12-21 11:09:48 +02:00
Serhiy Storchaka
5c4064e8bd Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:05:25 +02:00
Victor Stinner
e847d7170d Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() (new try) 2015-12-14 00:21:50 +01:00
Victor Stinner
ed53782ed5 Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() 2015-12-13 21:40:26 +01:00
Martin Panter
f0c0318cdc Issue #25845: Drop redundant checks leftover from int to long conversion 2015-12-12 06:57:13 +00:00