Commit Graph

7729 Commits

Author SHA1 Message Date
Victor Stinner bf2e2f9bdf Issue #18408: Fix zlib.compressobj() to handle PyThread_allocate_lock() failure
(MemoryError).
2013-07-09 00:29:03 +02:00
Victor Stinner 3f15cf0961 Issue #18408: Fix ConvParam() of the ctypes module to handle paramfunc failure
(MemoryError).
2013-07-09 00:27:12 +02:00
Victor Stinner 064bbdc79b fix indentation 2013-07-08 22:28:27 +02:00
Victor Stinner 5d1866c78a Issue #18408: PyObject_GC_NewVar() now raises SystemError exception if nitems
is negative
2013-07-08 22:17:52 +02:00
Victor Stinner c1eb26cd2f gcmodule.c: strip trailing spaces 2013-07-08 22:15:05 +02:00
Victor Stinner 49fc8ece81 Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()
Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the
GIL is held or not.
2013-07-07 23:30:24 +02:00
Christian Heimes fa535f5220 Issue #18227: pyexpat now uses a static XML_Memory_Handling_Suite. cElementTree uses the same approach since at least Python 2.6 2013-07-07 17:35:11 +02:00
Victor Stinner b7f1f65f1c Issue #18227: "Free" function of bz2, lzma and zlib modules has no return value (void) 2013-07-07 17:10:34 +02:00
Victor Stinner 11ebff2757 Issue #18203: Replace malloc() with PyMem_Malloc() in _ssl for the password 2013-07-07 17:07:52 +02:00
Victor Stinner 5064a52bcb Issue #18227: Use PyMem_RawAlloc() in bz2, lzma and zlib modules 2013-07-07 16:50:27 +02:00
Victor Stinner 6ce0dbf460 Fix a compiler warning in posix_sendfile() on FreeBSD:
Modules/posixmodule.c: In function 'posix_sendfile':
Modules/posixmodule.c:7700: warning: ISO C90 forbids mixed declarations and code
2013-07-07 16:32:36 +02:00
Victor Stinner b64049183c Issue #18203: Replace malloc() with PyMem_Malloc() in Python modules
Replace malloc() with PyMem_Malloc() when the GIL is held, or with
PyMem_RawMalloc() otherwise.
2013-07-07 16:21:41 +02:00
Victor Stinner 1a7425f67a Issue #18203: Replace malloc() with PyMem_RawMalloc() at Python initialization
* Replace malloc() with PyMem_RawMalloc()
* Replace PyMem_Malloc() with PyMem_RawMalloc() where the GIL is not held.
* _Py_char2wchar() now returns a buffer allocated by PyMem_RawMalloc(), instead
  of PyMem_Malloc()
2013-07-07 16:25:15 +02:00
Raymond Hettinger b385529ddf Fix #ifdef 2013-07-07 02:07:23 -10:00
Raymond Hettinger 82df925451 Use macros for marking and checking endpoints in the doubly-linked list of blocks.
* Add comment explaining the endpoint checks
* Only do the checks in a debug build
* Simplify newblock() to only require a length argument
  and leave the link updates to the calling code.
* Also add comment for the freelisting logic.
2013-07-07 01:43:42 -10:00
Raymond Hettinger ef9b47f0b8 merge 2013-07-06 17:50:01 -10:00
Raymond Hettinger f3a67b7e57 Improve variable names in deque_count() 2013-07-06 17:49:06 -10:00
Victor Stinner 0507bf56f0 Issue #3329: Implement the PEP 445
Add new enum:

* PyMemAllocatorDomain

Add new structures:

* PyMemAllocator
* PyObjectArenaAllocator

Add new functions:

* PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
* PyMem_GetAllocator(), PyMem_SetAllocator()
* PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator()
* PyMem_SetupDebugHooks()

Changes:

* PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead
  of calling PyObject_Malloc()/PyObject_Realloc() in debug mode.
* PyObject_Malloc()/PyObject_Realloc() now falls back to
  PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes.
* Redesign debug checks on memory block allocators as hooks, instead of using C
  macros
2013-07-07 02:05:46 +02:00
Raymond Hettinger df715ba54d Apply the PyObject_VAR_HEAD and Py_SIZE macros
to be consistent with practices in other modules.
2013-07-06 13:01:13 -10:00
Raymond Hettinger 5bfa8671bc Refactor deque_traverse().
Hoist conditional expression out of the loop.
Use rightblock as the guard instead of checking for NULL.
2013-07-06 11:58:09 -10:00
Raymond Hettinger 98054b4c1b Remove unnecessary branches from count() and reverse(). 2013-07-06 09:07:06 -10:00
Raymond Hettinger de68e0cf0e Speed-up deque indexing by changing the deque block length to a power of two.
The division and modulo calculation in deque_item() can be compiled
to fast bitwise operations when the BLOCKLEN is a power of two.

Timing before:

 ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0627 usec per loop

Timing after:

~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0581 usec per loop
2013-07-05 18:05:29 -10:00
Victor Stinner 0857ab4c77 (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signal
handler when the function is called twice, so faulthandler.unregister()
restores correctly the original signal handler.
2013-07-02 00:17:14 +02:00
Victor Stinner 8d3795474e Issue #18343: faulthandler.register() now keeps the previous signal handler
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
2013-07-02 00:14:56 +02:00
Christian Heimes 54882bfc18 Singular form just like the other error message. 2013-07-01 15:23:48 +02:00
Christian Heimes 8087879349 Singular form just like the other error message. 2013-07-01 15:23:39 +02:00
Christian Heimes bfafab1849 Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
segfault inside the _pickle C extension.
2013-07-01 15:18:49 +02:00
Christian Heimes a24b4d260b Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
segfault inside the _pickle C extension.
2013-07-01 15:17:45 +02:00
Christian Heimes 721724270d Fix segfault in pyexpat.c caused by 84375
u can be NULL, use XDECREF
2013-06-29 21:49:27 +02:00
Christian Heimes 82e6b94b95 Fix resource leak in pickle module
CID 983309 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable unicode_str going out of scope leaks the storage it points to.
2013-06-29 21:37:34 +02:00
Christian Heimes b91ffaa1d8 Fix NULL ptr dereferencing in local_timezone(). nameo can be NULL
CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
var_deref_op: Dereferencing null pointer _py_decref_tmp.
2013-06-29 20:52:33 +02:00
Christian Heimes b582155789 Fix memory leak in pyexpat PyUnknownEncodingHandler
CID 1040367 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable u going out of scope leaks the storage it points to.
2013-06-29 20:43:13 +02:00
Victor Stinner dd3a6a5533 Fix os.confstr(): the result type of the C function is size_t, not int 2013-06-25 23:13:47 +02:00
Victor Stinner 93037498d1 Fix time.mktime() and datetime.datetime.timestamp() on AIX
On AIX, the C function mktime() alwaysd sets tm_wday, even on error. So tm_wday
cannot be used as a sentinel to detect an error, we can only check if the
result is (time_t)-1.
2013-06-25 22:54:35 +02:00
Victor Stinner d7a034bd75 (Merge 3.3) Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999
time.strtime("%Y") returned "2345" when formatting year 12345.
2013-06-25 02:34:13 +02:00
Victor Stinner 36b82d85a3 Fix time.strftime("%Y") on AIX: raise a ValueError for year > 9999
time.strtime("%Y") returned "2345" when formatting year 12345.
2013-06-25 02:33:53 +02:00
Victor Stinner 7e00151e1f _ssl.c: strip trailing spaces 2013-06-25 00:44:31 +02:00
Victor Stinner 86073dc3c2 (Merge 3.3) Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if
the input string in longer than 2 gigabytes, and
ssl.SSLContext.load_cert_chain() raises a ValueError if the password is longer
than 2 gigabytes. The ssl module does not support partial write.
2013-06-25 00:43:47 +02:00
Victor Stinner 6efa965a27 Issue #18135: ssl.SSLSocket.write() now raises an OverflowError if the input
string in longer than 2 gigabytes, and ssl.SSLContext.load_cert_chain() raises
a ValueError if the password is longer than 2 gigabytes. The ssl module does
not support partial write.
2013-06-25 00:42:31 +02:00
Victor Stinner 14b9b11098 If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified. 2013-06-25 00:37:25 +02:00
Victor Stinner 9a644b23cc Issue #9566: recv(), recvfrom(), send(), sendall() and sendto() methods
of socket.socket objects now truncate the input buffer to INT_MAX bytes on
Windows to avoid an integer overflow.

(sendall() still send the whole buffer.)
2013-06-24 23:47:41 +02:00
Victor Stinner 71765770a4 Issue #9566: _winapi.WriteFile() now truncates length to DWORD_MAX (4294967295) 2013-06-24 23:13:24 +02:00
Victor Stinner bc8ccce729 Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning on Windows x64 2013-06-24 23:02:51 +02:00
Victor Stinner 9a282975ef Issue #9566: _io: Use Py_SAFE_DOWNCAST for fix a compiler warning on Windows x64 2013-06-24 23:01:33 +02:00
Raymond Hettinger b4f39eea49 merge 2013-06-23 15:47:03 -07:00
Raymond Hettinger 20b0f87e1d Misc improvements to collections.deque()
* Clarified comment on the impact of BLOCKLEN on deque_index
  (with a power-of-two, the division and modulo
   computations are done with a right-shift and bitwise-and).

* Clarified comment on the overflow check to note that
  it is general and not just applicable the 64-bit builds.

* In deque._rotate(), the "deque->" indirections are
  factored-out of the loop (loop invariant code motion),
  leaving the code cleaner looking and slightly faster.

* In deque._rotate(), replaced the memcpy() with an
  equivalent loop.  That saved the memcpy setup time
  and allowed the pointers to move in their natural
  leftward and rightward directions.

See comparative timings at:  http://pastebin.com/p0RJnT5N
2013-06-23 15:44:33 -07:00
Christian Heimes 5b2f18411b Issue #11016: Don't define macros and constants that are already set by pyport.h 2013-06-24 00:13:14 +02:00
Christian Heimes 99d6135a15 Define S_IFMT and S_IFLNK in pyport.h so posixmodule.c can use named constants instead
of arbitrary looking numbers.
2013-06-23 23:56:05 +02:00
Christian Heimes 9975877f46 Check for correct macro, code uses S_ISDIR(). 2013-06-23 23:52:40 +02:00
Christian Heimes 91e8b8180d Check for correct macro, code uses S_ISDIR(). 2013-06-23 23:51:44 +02:00
Victor Stinner 1ce46d99db Issue #11016: Detect integer conversion on conversion from Python int to C mode_t 2013-06-23 22:57:43 +02:00
Christian Heimes 858c947155 Fix a typo in S_ISDIR, S_ISCHR, S_ISBLK and S_ISREG.
Add extra braces to S_IS*() macros
2013-06-23 22:57:02 +02:00
Victor Stinner 8cfd67cfe7 (Merge 3.3) Issue #18135: Fix a possible integer overflow in
ssl.SSLSocket.write() and in ssl.SSLContext.load_cert_chain() for strings and
passwords longer than 2 gigabytes.
2013-06-23 15:09:26 +02:00
Victor Stinner 9ee0203057 Issue #18135: Fix a possible integer overflow in ssl.SSLSocket.write()
and in ssl.SSLContext.load_cert_chain() for strings and passwords longer
than 2 gigabytes.
2013-06-23 15:08:23 +02:00
Victor Stinner 4569cd5eab _ssl.c: strip trailing spaces 2013-06-23 14:58:43 +02:00
Victor Stinner c6ebd16a20 Issue #11016: Try to fix compilaton of the new _stat.c module on Windows 2013-06-23 01:49:42 +02:00
Andrew Kuchling 0e03d6f2e9 Merge from 3.3 2013-06-22 19:27:59 -04:00
Andrew Kuchling da30acf50b Closes #18220: expand itertools.islice docstring to 2 lines 2013-06-22 19:20:54 -04:00
Andrew Kuchling 446a39f78f Close #18285: add 'repeat' parameter to docstring for product 2013-06-22 19:04:11 -04:00
Christian Heimes c77d9f38c2 Issue #11016: Add C implementation of the stat module as _stat 2013-06-22 21:05:02 +02:00
Andrew Kuchling 6ce8d17d02 Merge from 3.3 2013-06-22 14:57:45 -04:00
Andrew Kuchling 9290dd14b0 #18113: avoid segfault if Py_XDECREF triggers code that calls set_panel_userptr again
Problem noted & original patch by Serhiy Storchaka; I tweaked the patch a bit.
2013-06-22 14:50:56 -04:00
Andrew Kuchling 3468d25a80 Merge from 3.3 2013-06-21 08:07:35 -04:00
Andrew Kuchling b003ffa0ab Closes #18239: correct description of count() in module docstring 2013-06-21 07:58:35 -04:00
Brett Cannon 83358c9f13 Grammatical mistake in a comment 2013-06-20 21:30:32 -04:00
Benjamin Peterson 15a7d2e8d6 merge 3.3 (#18248) 2013-06-19 09:01:58 -07:00
Benjamin Peterson 19886b8adc fix libffi build on AIX (closes #18248) 2013-06-19 09:01:42 -07:00
Christian Heimes 262e7f389c fixed libffi on PPC without __NO_FPRS__
ISO C90 forbids mixed declarations and code
2013-06-19 02:43:19 +02:00
Christian Heimes 2f13f546e6 fixed libffi on PPC without __NO_FPRS__
ISO C90 forbids mixed declarations and code
2013-06-19 02:40:38 +02:00
Christian Heimes 71515510d8 Issue #18259: Declare sethostname in socketmodule.c for AIX 2013-06-19 02:07:20 +02:00
Christian Heimes d2774c7d09 Issue #18259: Declare sethostname in socketmodule.c for AIX 2013-06-19 02:06:29 +02:00
Christian Heimes 360b89ca5e Fix for r84195: add HAVE_ALLOCA_H to configure and only include alloca.h if it's available 2013-06-18 13:22:37 +02:00
Christian Heimes f0400baba8 Fix for r84195: add HAVE_ALLOCA_H to configure and only include alloca.h if it's available 2013-06-18 13:22:17 +02:00
Victor Stinner 8f0aae54ba (Merge 3.3) ctypes: AIX needs an explicit #include <alloca.h> to get alloca() 2013-06-17 22:02:14 +02:00
Victor Stinner 43b2639fe2 ctypes: AIX needs an explicit #include <alloca.h> to get alloca() 2013-06-17 22:01:53 +02:00
Christian Heimes 9a5395ae2b Issue #18147: Add diagnostic functions to ssl.SSLContext().
get_ca_list() lists all loaded CA certificates and cert_store_stats() returns
amount of loaded X.509 certs, X.509 CA certs and CRLs.
2013-06-17 15:44:12 +02:00
Andrew Kuchling f567727abc Merge with 3.3 2013-06-16 13:02:55 -04:00
Andrew Kuchling c7b6c50f29 Describe 'surrogateescape' in the documentation.
Also, improve some docstring descriptions of the 'errors' parameter.

Closes #14015.
2013-06-16 12:58:48 -04:00
Andrew Kuchling 8a2a902f88 Merge with 3.3 2013-06-15 15:10:08 -04:00
Andrew Kuchling 53e5ea7951 #18113: Objects associated to a curses.panel object with set_userptr() were leaked.
Reported by Atsuo Ishimoto.
2013-06-15 14:04:04 -04:00
Victor Stinner 36f01ad9ac Revert changeset 6661a8154eb3: Issue #3329: Add new APIs to customize memory allocators
The new API require more discussion.
2013-06-15 03:37:01 +02:00
Victor Stinner 4d7056258b Issue #3329: Add new APIs to customize memory allocators
* Add a new PyMemAllocators structure
* New functions:

  - PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree(): GIL-free memory
    allocator functions
  - PyMem_GetRawAllocators(), PyMem_SetRawAllocators()
  - PyMem_GetAllocators(), PyMem_SetAllocators()
  - PyMem_SetupDebugHooks()
  - _PyObject_GetArenaAllocators(), _PyObject_SetArenaAllocators()

* Add unit test for PyMem_Malloc(0) and PyObject_Malloc(0)
* Add unit test for new get/set allocators functions
* PyObject_Malloc() now falls back on PyMem_Malloc() instead of malloc() if
  size is bigger than SMALL_REQUEST_THRESHOLD, and PyObject_Realloc() falls
  back on PyMem_Realloc() instead of realloc()
* PyMem_Malloc() and PyMem_Realloc() now always call malloc() and realloc(),
  instead of calling PyObject_Malloc() and PyObject_Realloc() in debug mode
2013-06-15 00:37:46 +02:00
Christian Heimes 200bb1b08c Simplify return value of ssl.get_default_verify_paths
prefix function with PySSL_, too. Other module level functions have a prefix, too.
2013-06-14 15:14:29 +02:00
Christian Heimes 75b8426698 fixd refleak 2013-06-10 10:47:22 +02:00
Ronald Oussoren 36451f076b (3.3->default) Ensure that the fix for #17269 also works on OSX 10.4
AI_NUMERICSERV isn't defined on OSX 10.4.
2013-06-10 10:37:12 +02:00
Ronald Oussoren a822d36675 Ensure that the fix for #17269 also works on OSX 10.4
AI_NUMERICSERV isn't defined on OSX 10.4.
2013-06-10 10:36:28 +02:00
Christian Heimes 46bebee25f Issue #17134: Add ssl.enum_cert_store() as interface to Windows' cert store. 2013-06-09 19:03:31 +02:00
Christian Heimes 142ec2c014 get_default_verify_paths doesn't belong inside the ifdef block 2013-06-09 18:29:54 +02:00
Christian Heimes 6d7ad13a45 Issue #18143: Implement ssl.get_default_verify_paths() in order to debug
the default locations for cafile and capath.
2013-06-09 18:02:55 +02:00
Richard Oudkerk ac0ad884d1 Issue #17931: Resolve confusion on Windows between pids and process handles. 2013-06-05 23:29:30 +01:00
Łukasz Langa 6f69251980 Add reference implementation for PEP 443
PEP accepted: http://mail.python.org/pipermail/python-dev/2013-June/126734.html
2013-06-05 12:20:24 +02:00
Victor Stinner 072318b178 Issue #13772: Use syntax for literal wchar_t character 2013-06-05 02:07:46 +02:00
Victor Stinner 31b3b92f7a Issue #13772: Mark helper functions as private (static)
Cleanup also the code to follow the Python coding style (PEP 7).
2013-06-05 01:49:17 +02:00
Victor Stinner e87267dc6e Issue #13772: Fix a compiler warning on Windows 2013-06-05 01:30:25 +02:00
Victor Stinner 5a4367600f Issue #13772: fix _check_dirA(): call *A() functions, not *W() functions 2013-06-05 00:37:12 +02:00
Victor Stinner e7e7eba108 Issue #13772: Fix compiler warnings on Windows 2013-06-05 00:35:54 +02:00
Victor Stinner fbf50d43da Issue #9566: Fix compiler warning on Windows 64-bit in _bz2module.c 2013-06-04 23:18:48 +02:00
Victor Stinner 640c35ce13 Reuse Py_MIN and Py_MAX macros: remove duplicate MIN/MAX macros
multiprocessing.h: remove unused MIN and MAX macros
2013-06-04 23:14:37 +02:00
Victor Stinner 0b81111b18 (Merge 3.3) Close #18109: os.uname() now decodes fields from the locale
encoding, and socket.gethostname() now decodes the hostname from the locale
encoding, instead of using the UTF-8 encoding in strict mode.
2013-06-03 22:09:14 +02:00
Victor Stinner a534fc4b3b Close #18109: os.uname() now decodes fields from the locale encoding, and
socket.gethostname() now decodes the hostname from the locale encoding, instead
of using the UTF-8 encoding in strict mode.
2013-06-03 22:07:27 +02:00
Stefan Krah 04754b0fd4 Support multiarch build in tests. 2013-05-29 20:58:19 +02:00
Stefan Krah 891ca9e06a Backport bff16086f03b and bcaaaa00425b. 2013-05-29 19:14:17 +02:00
Stefan Krah 6edda14b29 Issue #17768: Support newline fill character in decimal.py and NUL fill
character in _decimal.c.
2013-05-29 15:45:38 +02:00
Serhiy Storchaka 37a79a12d1 Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
stream's read() returns more bytes than requested.
2013-05-28 16:24:45 +03:00
Jason R. Coombs 3a09286790 Issue #13772: Restored directory detection of targets in `os.symlink` on Windows, which was temporarily removed in Python 3.2.3 due to an incomplete implementation. The implementation now works even if the symlink is created in a location other than the current directory. 2013-05-27 23:21:28 -04:00
Eli Bendersky 6dc32b34dd Issue #13612: handle unknown encodings without a buffer overflow.
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.

Based on a patch by Serhiy Storchaka.
2013-05-25 05:25:48 -07:00
Benjamin Peterson 3b08a2978e indicate that read/write work with bytes (closes #18009) 2013-05-24 14:35:57 -07:00
Ronald Oussoren 27a4ac535f Issue #17269: Workaround for a platform bug in getaddrinfo on OSX
Without this patch socket.getaddrinfo crashed when called
with some unusual argument combinations.
2013-05-24 13:47:37 +02:00
Serhiy Storchaka 66d53fa9ad Issue #16986: ElementTree now correctly parses a string input not only when
an internal XML encoding is UTF-8 or US-ASCII.
2013-05-22 17:07:51 +03:00
Eli Bendersky 6a55dc3b4a Issue #17989: fix typo in error message 2013-05-19 16:59:59 -07:00
Eli Bendersky 08231a9c6a Issue #17901: fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
2013-05-18 15:47:16 -07:00
Eli Bendersky ef9683b73f Issue #17989: element_setattro returned incorrect error value.
This caused an exception to be raised later than expected.
2013-05-18 07:52:34 -07:00
Victor Stinner 725e421222 Fix compilater warnings on Windows 64-bit 2013-05-17 00:19:59 +02:00
Stefan Krah b6cc0aad4b Merge 3.3. 2013-05-29 21:12:46 +02:00
Stefan Krah a0547b8ac4 Mark untestable lines for gcov. 2013-05-29 19:08:34 +02:00
Stefan Krah 8d90e383a3 Merge 3.3. 2013-05-29 15:47:24 +02:00
Serhiy Storchaka 281945f427 Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
stream's read() returns more bytes than requested.
2013-05-28 16:27:08 +03:00
Jason R. Coombs 8f1a8e32b1 Merge with 3.3 2013-05-27 23:26:36 -04:00
Benjamin Peterson da5eb5a31c don't expand the operand to Py_XINCREF/XDECREF/CLEAR/DECREF multiple times (closes #17206)
A patch from Illia Polosukhin.
2013-05-27 14:46:14 -07:00
Eli Bendersky 7b3022f24f Issue #13612: handle unknown encodings without a buffer overflow.
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.

Based on a patch by Serhiy Storchaka.
2013-05-25 05:27:10 -07:00
Antoine Pitrou 19fef69b75 Fix compilation under MSVC: ssl_set_mode() is a macro, and the MSVC preprocessor doesn't process #ifdef's inside a macro argument list.
(found explanation at http://www.tech-archive.net/Archive/VC/microsoft.public.vc.language/2007-05/msg00385.html)
2013-05-25 13:23:03 +02:00
Antoine Pitrou 3a65ad7f08 Issue #8240: Set the SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag on SSL sockets. 2013-05-25 13:02:32 +02:00
Benjamin Peterson e08b583d88 merge 3.3 2013-05-24 14:36:04 -07:00
Ronald Oussoren dc3e6cc452 (3.3->default) Issue #17269: Workaround for a platform bug in getaddrinfo on OSX
Without this patch socket.getaddrinfo crashed when called
with some unusual argument combinations.
2013-05-24 13:51:21 +02:00
Serhiy Storchaka 447b6e3c6e Issue #16986: ElementTree now correctly parses a string input not only when
an internal XML encoding is UTF-8 or US-ASCII.
2013-05-22 17:21:06 +03:00
Giampaolo Rodola' 80e1c43ddf Fix issue #17996: expose socket.AF_LINK constant on BSD and OSX. 2013-05-21 21:02:04 +02:00
Charles-François Natali b10c71daa2 Backed out changeset c0f2b038fc12 2013-05-21 10:45:46 +02:00
Charles-François Natali c7c333d25d Issue #17683: socket module: return AF_UNIX addresses in Linux abstract
namespace as string.
2013-05-21 09:49:18 +02:00
Charles-Francois Natali 74ca886788 Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()
when applicable.
2013-05-20 19:13:19 +02:00
Charles-Francois Natali 7c4f8dacf4 Issue #17914: We can now inline _bsd_cpu_count(). 2013-05-20 17:40:32 +02:00
Charles-Francois Natali d59087de5b Issue #17914: Remove OS-X special-case, and use the correct int type. 2013-05-20 17:31:06 +02:00
Charles-Francois Natali 44feda3cd0 Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
initial patch by Trent Nelson.
2013-05-20 14:40:46 +02:00
Eli Bendersky a369923cab Get rid of ugly code duplication for ElementTree.parse when the accelerator
is imported. Instead, ElementTree.parse can look for a special internal method
defined by the accelerator.
2013-05-19 18:47:23 -07:00
Eli Bendersky 3a36756ba1 Issue #17989: fix typo in error message 2013-05-19 17:00:28 -07:00
Eli Bendersky 3a4fbd8241 _elementtree.XMLParser._setevents should support any sequence, not just tuples
Also clean up some code around this
2013-05-19 09:01:49 -07:00
Antoine Pitrou fef34e3186 Issue #17937: Try harder to collect cyclic garbage at shutdown. 2013-05-19 01:11:58 +02:00
Eli Bendersky 20c1cdd64a Issue #17901: fix TreeBuilder construction for an explicit element_factory=None
Based on report and patch by Aaron Oakley.
2013-05-18 15:47:58 -07:00
Eli Bendersky 1a8c3e247a Issue #17989: element_setattro returned incorrect error value.
This caused an exception to be raised later than expected.
2013-05-18 07:53:47 -07:00
Victor Stinner 3e269397e3 FileIO.readall(): remove trailing space from an exception message 2013-05-18 00:38:43 +02:00
Richard Oudkerk af7260e81a Issue #15758: Fix FileIO.readall() so it no longer has O(n**2) complexity. 2013-05-17 23:34:42 +01:00
Serhiy Storchaka fff61f2cd3 Issue #14596: The struct.Struct() objects now use more compact implementation. 2013-05-17 10:49:44 +03:00
Benjamin Peterson aa96588399 merge 3.3 2013-05-16 15:30:09 -05:00
Benjamin Peterson 18b7191653 C89 declaration compliance 2013-05-16 15:29:44 -05:00
Victor Stinner 6fdd7b81fa Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
is long, not int.
2013-05-16 22:26:29 +02:00
doko@ubuntu.com 94fd53ba4e - Fix typos in the multiprocessing module. 2013-05-15 18:08:03 +02:00
doko@ubuntu.com 9df891ca41 - Fix typos in the multiprocessing module. 2013-05-15 18:06:56 +02:00
Antoine Pitrou 9396356948 Backout c89febab4648 following private feedback by Guido.
(Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
2013-05-14 20:37:52 +02:00
Benjamin Peterson cde88dcf10 merge 3.3 (#17968) 2013-05-13 19:56:35 -05:00
Benjamin Peterson dedac52731 prevent double free in cleanup code (#17968) 2013-05-13 19:55:40 -05:00
Antoine Pitrou 5f18791902 Issue #17968: Fix memory leak in os.listxattr(). 2013-05-13 19:48:46 +02:00
Antoine Pitrou 7f987398b7 Issue #17968: Fix memory leak in os.listxattr(). 2013-05-13 19:46:29 +02:00
Antoine Pitrou 04e70d19e7 Issue #17807: Generators can now be finalized even when they are part of a reference cycle. 2013-05-08 18:12:35 +02:00
Antoine Pitrou 070cb3c9be Issue #1545463: At shutdown, defer finalization of codec modules so that stderr remains usable.
(should fix Windows buildbot failures on test_gc)
2013-05-08 13:23:25 +02:00
Ezio Melotti 0fbdf26158 #16523: merge with 3.3. 2013-05-08 10:56:32 +03:00
Ezio Melotti babc8227cc #16523: improve attrgetter/itemgetter/methodcaller documentation. 2013-05-08 10:53:11 +03:00
Victor Stinner 70792d268e Fix compiler warnings: explicit cast to int in sha256/sha512 modules 2013-05-08 00:00:44 +02:00
Victor Stinner e8289618bf zlib: Explicit cast to fix a compiler warning 2013-05-07 23:50:21 +02:00
Victor Stinner f2b9a340ef audioop: explicit cast to fix a compiler warning 2013-05-07 23:49:15 +02:00
Antoine Pitrou 9b5d4d8cef Issue #17289: The readline module now plays nicer with external modules or applications changing the rl_completer_word_break_characters global variable.
Initial patch by Bradley Froehle.
2013-05-06 21:54:07 +02:00
Antoine Pitrou a7f7deb6ed Issue #17289: The readline module now plays nicer with external modules or applications changing the rl_completer_word_break_characters global variable.
Initial patch by Bradley Froehle.
2013-05-06 21:51:03 +02:00
Charles-Francois Natali b1294fa9f4 Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
platforms. Patch by Federico Schwindt.
2013-05-06 21:26:05 +02:00
Charles-Francois Natali 002a77d2f7 Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
platforms. Patch by Federico Schwindt.
2013-05-06 21:24:31 +02:00
Antoine Pitrou 5f454a07a0 Issue #1545463: Global variables caught in reference cycles are now garbage-collected at shutdown. 2013-05-06 21:15:57 +02:00
Antoine Pitrou 52c5f85cf9 Issue #14173: Avoid crashing when reading a signal handler during interpreter shutdown. 2013-05-04 23:21:09 +02:00
Antoine Pitrou c8c952ce2a Issue #14173: Avoid crashing when reading a signal handler during interpreter shutdown. 2013-05-04 23:16:59 +02:00
Antoine Pitrou 1a6cb30a34 Issue #5845: Enable tab-completion in the interactive interpreter by default, thanks to a new sys.__interactivehook__.
(original patch by Éric Araujo)
2013-05-04 20:08:35 +02:00
Gregory P. Smith d8fe1f7881 * Fix remaining bits of issue 17192 for 3.4 - these changes
were missing from a messed up merge during the libffi 3.0.13
  import.  the diffs from upstream libffi 3.0.13 are now small.
2013-04-30 00:03:30 -07:00
Gregory P. Smith 5dc268ed26 * Fix remaining bits of issue 17192 for 3.3 - these changes
were missing from a messed up merge during the libffi 3.0.13
  import.  the diffs from upstream libffi 3.0.13 are now small.
2013-04-30 00:03:01 -07:00
Gregory P. Smith 6897267759 * Fix PART of issue 17192 for 3.4 - reapply the issue11729 patch
that was undone in the merge fun from upstream which already
  had it in 3.0.13.
* Add the missing update to libffi.info.
2013-04-29 23:48:03 -07:00
Gregory P. Smith e9d0633d36 * Fix PART of issue 17192 for 3.3 - reapply the issue11729 patch
that was undone in the merge fun from upstream which already
  had it in 3.0.13.
* Add the missing update to libffi.info.
2013-04-29 23:47:17 -07:00
Gregory P. Smith 933059710c * Fix issue 17192 for 3.2 - reapply the issue11729 patch that was undone
in the merge fun from upstream which already had it in 3.0.13.
* Add the missing update to libffi.info.
2013-04-29 23:45:38 -07:00
Serhiy Storchaka 5f99fa7287 Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
such as was shipped with Centos 5 and Mac OS X 10.4.
2013-04-28 14:11:55 +03:00
Serhiy Storchaka d160b12292 Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
such as was shipped with Centos 5 and Mac OS X 10.4.
2013-04-28 14:10:27 +03:00
Antoine Pitrou 9f14681959 Issue #17804: New function ``struct.iter_unpack`` allows for streaming struct unpacking. 2013-04-27 00:20:04 +02:00
Eli Bendersky 45f3d2fff0 Revert c9674421d78e, leaving an additional comment 2013-04-24 05:34:07 -07:00
Eli Bendersky 1859fe80c4 Simplify the code of get_attrib_from_keywords somewhat. 2013-04-22 05:52:16 -07:00
Eli Bendersky ed8b86d323 Issue #17736: fix misleading comment in _elementtree.c
Patch by Jonas Wagner
2013-04-22 05:29:09 -07:00
Eli Bendersky d4cb4b7451 Issue #17736: fix misleading comment in _elementtree.c
Patch by Jonas Wagner
2013-04-22 05:25:25 -07:00
Alexandre Vassalotti 4fe2184a0f Merge 3.3 2013-04-20 21:28:49 -07:00
Alexandre Vassalotti 637c7c475a Fix reference leak in _pickle. 2013-04-20 21:28:21 -07:00
Antoine Pitrou a85017fbe3 Issue #16694: Add a pure Python implementation of the operator module.
Patch by Zachary Ware.
2013-04-20 19:21:44 +02:00
Eli Bendersky ddcc6798f6 Remove useless #define and #ifdefs 2013-04-20 06:36:43 -07:00
Eli Bendersky bf05df2396 Make license notices more consistent and remove old changelog.
Also remove unused macro.
2013-04-20 05:44:01 -07:00
Victor Stinner 8f674ccd64 Close #17694: Add minimum length to _PyUnicodeWriter
* Add also min_char attribute to _PyUnicodeWriter structure (currently unused)
 * _PyUnicodeWriter_Init() has no more argument (except the writer itself):
   min_length and overallocate must be set explicitly
 * In error handlers, only enable overallocation if the replacement string
   is longer than 1 character
 * CJK decoders don't use overallocation anymore
 * Set min_length, instead of preallocating memory using
   _PyUnicodeWriter_Prepare(), in many decoders
 * _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
2013-04-17 23:02:17 +02:00
Richard Oudkerk 245bbee0d5 Merge. 2013-04-17 21:24:58 +01:00
Antoine Pitrou cf8a1e51ec - Issue #17782: Fix undefined behaviour on platforms where ``struct timespec``'s "tv_nsec" member is not a C long. 2013-04-17 22:06:44 +02:00
Alexandre Vassalotti 7c5e094cbf Make C and Python implementations of pickle load STRING opcodes the same way.
The C version tried to remove trailing whitespace between the last quote and
the newline character. I am not sure why it had this because pickle never
generated such pickles---for this to happen repr(some_string) would need to
return trailing whitespace. It was maybe there to make it easier for people
to write pickles in text editors. Anyhow, the Python version doesn't do this
so there is no point keeping this around anymore.

Also, I've changed the exception raised when a bad pickle is encountered.
Again this unlikely to make much difference to anyone though it does make
testing slightly nicer for us.
2013-04-15 23:14:55 -07:00
Benjamin Peterson 48a2e7c357 merge 3.3 2013-04-15 21:38:33 -04:00
Benjamin Peterson 51ce29c530 remove pointless code (closes #17738) 2013-04-15 21:38:25 -04:00
Antoine Pitrou af94051a93 Issue #17710: Fix pickle raising a SystemError on bogus input. 2013-04-15 21:55:14 +02:00
Antoine Pitrou 3034efdd29 Issue #17710: Fix pickle raising a SystemError on bogus input. 2013-04-15 21:51:09 +02:00
Victor Stinner 322cc7438c Issue #17693: Fix memory/reference leaks 2013-04-14 18:11:41 +02:00
Alexandre Vassalotti cc7571727f Style cleanups for pickle.py and _pickle. 2013-04-14 02:25:10 -07:00
Alexandre Vassalotti 6d9e14593e Merge 3.3 2013-04-14 02:11:16 -07:00
Alexandre Vassalotti 00d83f2d05 Clean up error messages raised by save_reduce in _pickle. 2013-04-14 01:28:01 -07:00
Victor Stinner d949126995 Issue #17693: CJK encoders now use the new Unicode API (PEP 393) 2013-04-14 02:06:32 +02:00
Serhiy Storchaka 6d80046628 Issue #17016: Get rid of possible pointer wraparounds and integer overflows
in the re module.  Patch by Nickolai Zeldovich.
2013-04-13 21:16:40 +03:00
Serhiy Storchaka 4bb17348f5 Issue #17016: Get rid of possible pointer wraparounds and integer overflows
in the re module.  Patch by Nickolai Zeldovich.
2013-04-13 21:15:47 +03:00
Victor Stinner a0dd0213cc Close #17693: Rewrite CJK decoders to use the _PyUnicodeWriter API instead of
the legacy Py_UNICODE API.

Add also a new _PyUnicodeWriter_WriteChar() function.
2013-04-11 22:09:04 +02:00
Antoine Pitrou 50b24d0d7c Fix a crash when setting a servername callback on a SSL server socket and the client doesn't send a server name.
Patch by Kazuhiro Yoshida.
(originally issue #8109)
2013-04-11 20:48:42 +02:00
Victor Stinner 7d36e4f074 Close #14439: Python now prints the traceback on runpy failure at startup. 2013-04-10 00:27:23 +02:00
Antoine Pitrou 4b7b0f06b4 gibibytes (Arfrever) 2013-04-07 23:46:52 +02:00
Antoine Pitrou 299978dfe3 Issue #15596: Faster pickling of unicode strings. 2013-04-07 17:38:11 +02:00
Serhiy Storchaka ee57f159af Revert a premature patch for issue #14010 (changeset 846bd418aee5). 2013-04-06 22:55:12 +03:00
Serhiy Storchaka 278d03bd66 Revert a premature patch for issue #14010 (changeset aaaf36026511). 2013-04-06 22:52:34 +03:00
Serhiy Storchaka aac81e2780 Issue #14010: Fix a crash when iterating or deleting deeply nested filters
(builting and in itertools module, i.e. map(), itertools.chain(), etc).
2013-04-06 21:20:30 +03:00
Serhiy Storchaka e8f706eda7 Issue #14010: Fix a crash when iterating or deleting deeply nested filters
(builting and in itertools module, i.e. map(), itertools.chain(), etc).
2013-04-06 21:14:43 +03:00
Antoine Pitrou 7faf70512a Issue #17591: Use lowercase filenames when including Windows header files.
Patch by Roumen Petrov.
2013-03-31 22:48:04 +02:00
Antoine Pitrou ce852cb8b9 Fix comment about the OpenSSL version in which SNI version was introduced. 2013-03-30 16:45:04 +01:00
Antoine Pitrou edbc18e9d0 Improve set_servername_callback docstring. 2013-03-30 16:40:27 +01:00
Antoine Pitrou a596338bb8 Fix previous fix (the cause was actually a misplaced #endif, or so it seems) 2013-03-30 16:39:00 +01:00
Antoine Pitrou 41f8c4f5e4 Further compiling fixes (issue #17581) 2013-03-30 16:36:54 +01:00
Antoine Pitrou 912fbff105 Issue #17581: try to fix building on old OpenSSL versions 2013-03-30 16:29:32 +01:00
Antoine Pitrou 2463e5fee4 Issue #16692: The ssl module now supports TLS 1.1 and TLS 1.2. Initial patch by Michele Orrù. 2013-03-28 22:24:43 +01:00
Victor Stinner d06b35c1b6 (Merge 3.3) Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c) 2013-03-21 12:21:43 +01:00
Victor Stinner bd2d30cf31 Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c) 2013-03-21 12:21:06 +01:00
Gregory P. Smith 40a2160a09 Refactor the common code out of the posix and windows listdir
implementations from my previous commit into the higher level
function.
2013-03-20 20:52:50 -07:00
Gregory P. Smith 16ea14a690 Refactor the Windows specific and POSIX specific implementations of
listdir into two separate coherent functions rather than interleaved
#ifdef's.
2013-03-20 18:51:33 -07:00
R David Murray 9a7d3768a3 Use logic operator, not bitwise operator, for conditional. 2013-03-20 00:15:20 -04:00
R David Murray c7c42efb16 #15927: Fix cvs.reader parsing of escaped \r\n with quoting off.
This fix means that such values are correctly roundtripped, since
cvs.writer already does the correct escaping.

Patch by Michael Johnson.
2013-03-19 22:41:47 -04:00
Kristján Valur Jónsson d6e9f32b79 Merge 2013-03-19 16:00:01 -07:00
Kristján Valur Jónsson ece12222ce Merge 2013-03-19 15:57:19 -07:00
Kristján Valur Jónsson 23f854ca68 Issue #10296: Merge to default 2013-03-19 15:38:32 -07:00
Kristján Valur Jónsson a251b37179 #10296: Merge to 3.3 2013-03-19 15:35:28 -07:00
Gregory P. Smith c70e53aca8 Fixes Issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues
on some more recent platforms.
2013-03-19 15:24:46 -07:00
Kristján Valur Jónsson 5aed330e37 Issue #10296 : Don't handle BreakPoint exceptions using
Structured Exception Handling on windows.
2013-03-19 15:24:10 -07:00
Gregory P. Smith cca8507758 merge heads in 3.3 2013-03-19 15:05:52 -07:00
Gregory P. Smith dd35162894 merge heads in 3.2 2013-03-19 15:03:26 -07:00
Gregory P. Smith 0408bf9cfb Fixes Issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues
on some more recent platforms.
2013-03-19 14:59:02 -07:00
R David Murray af3ba4873a Merge: #8862: Fix curses cleanup with getchar is interrupted by a signal.
I have no idea how one would write a test for this.

Patch by July Tikhonov.
2013-03-19 16:26:19 -04:00
R David Murray 779dab9447 Merge: #8862: Fix curses cleanup with getchar is interrupted by a signal.
I have no idea how one would write a test for this.

Patch by July Tikhonov.
2013-03-19 16:24:35 -04:00
R David Murray f5d7cc239e #8862: Fix curses cleanup with getchar is interrupted by a signal.
I have no idea how one would write a test for this.

Patch by July Tikhonov.
2013-03-19 16:23:09 -04:00
Gregory P. Smith 029273fc90 Fixes issue #17192: Update the ctypes module's libffi to v3.0.13. This
specifically addresses a stack misalignment issue on x86 and issues on
some more recent platforms.
2013-03-18 17:11:20 -07:00
Benjamin Peterson 7701e6ef93 make some freezing related stuff const 2013-03-13 14:06:39 -05:00
Benjamin Peterson 3b965a237c expose O_PATH if possible 2013-03-13 10:27:41 -05:00
Terry Jan Reedy 8b53559a89 Merge with 3.3, issue #17047: remove doubled words added in 3.3,
as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 18:36:38 -04:00
Terry Jan Reedy 0f84764a09 Issue #17047: remove doubled words added in 3.3
as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 18:34:00 -04:00
Terry Jan Reedy 16c41d8520 Merge 3.3, issue #17047: remove doubled words found in 2.7 to 3.4
Modules/*, as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 17:46:07 -04:00
Terry Jan Reedy 09b7503bc9 Merge 3.2, Issue #17047: remove doubled words found in 2.7 to 3.4
Modules/*, as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 17:45:12 -04:00
Terry Jan Reedy 0158af38b7 Issue #17047: remove doubled words found in 2.7 to 3.4 Modules/*,
as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 17:42:46 -04:00
Ezio Melotti 03e667d15a Fix memory leak introduced in 15190138d3f3. 2013-03-07 21:18:45 +02:00
Eli Bendersky ca83233216 Fix formatting changes that led to compilation errors 2013-03-06 06:30:23 -08:00
Eli Bendersky 3612da6b2b call_commethod was only used in samples/Windows, which no longer exists.
This method is dead code - not documented, not tested. As far as we know, it
can be horribly broken.
2013-03-06 06:21:46 -08:00
Eli Bendersky d867bad0fc Fix some formatting 2013-03-06 05:45:57 -08:00
Victor Stinner e5c0533b58 Issue #17223: Add another test to check that _PyUnicode_Ready() rejects
code points bigger than U+10ffff
2013-03-06 00:39:03 +01:00
Antoine Pitrou 221760a3aa Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. 2013-03-04 20:35:55 +01:00
Antoine Pitrou 31584e30ab Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. 2013-03-04 20:33:36 +01:00
Antoine Pitrou 44d5214927 Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when the list is being resized concurrently. 2013-03-04 20:30:01 +01:00
Gregory P. Smith b394c1dac8 Fixes Issue #16962: Use getdents64 instead of the obsolete getdents syscall
in the subprocess module on Linux.
2013-03-03 10:53:27 -08:00
Gregory P. Smith 255bf5b9ec Issue #16962: Use getdents64 instead of the obsolete getdents syscall in
the subprocess module on Linux.
2013-03-03 10:45:05 -08:00
Victor Stinner 25c3053a4f (Merge 3.3) Issue #17223: array module: Fix a crasher when converting an array
containing invalid characters (outside range [U+0000; U+10ffff]) to Unicode:
repr(array), str(array) and array.tounicode(). Patch written by Manuel Jacob.
2013-02-26 00:27:56 +01:00
Victor Stinner 29ec595c6a Issue #17223: array module: Fix a crasher when converting an array containing
invalid characters (outside range [U+0000; U+10ffff]) to Unicode: repr(array),
str(array) and array.tounicode(). Patch written by Manuel Jacob.
2013-02-26 00:27:38 +01:00
R David Murray d7c59e101f Merge #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 22:21:48 -05:00
R David Murray 9f10f56d13 Merge #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 22:07:55 -05:00
R David Murray 67bfe80758 #17275: Fix class name in init errors in C bufferedio classes.
This fixes an apparent copy-and-paste error.

Patch by Manuel Jacob.
2013-02-23 21:51:05 -05:00
Serhiy Storchaka 2cca36ed3c Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
2013-02-18 13:03:07 +02:00
Serhiy Storchaka df4aa642a5 Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
2013-02-18 13:02:41 +02:00
Serhiy Storchaka 59f5dee3d6 Issue #13153: Tkinter functions now raise TclError instead of ValueError when
a string argument contains non-BMP character.
2013-02-18 13:01:52 +02:00
Serhiy Storchaka e924ddb23e Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat.  Patch by Matthew Barnett.
2013-02-16 21:25:40 +02:00
Serhiy Storchaka b0c75a7dec Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat.  Patch by Matthew Barnett.
2013-02-16 21:25:05 +02:00
Serhiy Storchaka fa46816915 Issue #9669: Protect re against infinite loops on zero-width matching in
non-greedy repeat.  Patch by Matthew Barnett.
2013-02-16 21:23:53 +02:00
Serhiy Storchaka 0e6b7b5cd2 Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob. 2013-02-16 17:43:45 +02:00
Serhiy Storchaka 0cad7eca45 Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units. 2013-02-16 17:30:31 +02:00
Serhiy Storchaka f8def28ff0 Issue #17193: Use binary prefixes (KiB, MiB, GiB) for memory units. 2013-02-16 17:29:56 +02:00
Serhiy Storchaka 165ee9645b Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
2013-02-16 16:55:54 +02:00
Serhiy Storchaka a0eb809995 Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
2013-02-16 16:54:33 +02:00
Serhiy Storchaka 70ca0210e8 Issue #13169: The maximal repetition number in a regular expression has been
increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
2013-02-16 16:47:47 +02:00
Richard Oudkerk 76450e6a84 Merge 2013-02-13 12:33:53 +00:00
Richard Oudkerk 6d40134eba Merge 2013-02-13 12:32:32 +00:00
Richard Oudkerk 0d09ba8e0b Issue #16743: Fix mmap overflow check on 32 bit Windows 2013-02-13 12:18:03 +00:00
doko@ubuntu.com 38e2a2afbd - Issue #17192: Import libffi-3.0.12. 2013-02-12 15:33:16 +01:00
Serhiy Storchaka e4ad8aacd1 Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-12 09:24:16 +02:00
Serhiy Storchaka fd6e6cfa29 Raise KeyError instead of OverflowError when getpwuid's argument is out of
uid_t range.
2013-02-11 20:33:24 +02:00
Serhiy Storchaka 55e2238272 Raise KeyError instead of OverflowError when getpwuid's argument is out of
uid_t range.
2013-02-11 20:32:47 +02:00
Serhiy Storchaka a7b5e82ff0 Reject float as uid or gid.
A regression was introduced in the commit for issue #4591.
2013-02-10 23:28:33 +02:00
Serhiy Storchaka b462189921 Reject float as uid or gid.
A regression was introduced in the commit for issue issue #4591.
2013-02-10 23:28:02 +02:00
Serhiy Storchaka c2d020090b Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-10 22:03:08 +02:00
Serhiy Storchaka 7cf5599346 Issue #4591: Uid and gid values larger than 2**31 are supported now. 2013-02-10 21:56:49 +02:00
Raymond Hettinger 986bbfc079 Backport deque.rotate() improvements. 2013-02-09 20:00:55 -05:00
Antoine Pitrou 902fc8b5a0 Issue #13773: sqlite3.connect() gets a new `uri` parameter to pass the filename as a URI, allowing to pass custom options. 2013-02-10 00:02:44 +01:00
Antoine Pitrou 8ad5b07ccb Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
2013-02-09 23:16:51 +01:00
Antoine Pitrou c73c561181 Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag), mpdecimal (needs to build without Python.h).
2013-02-09 23:14:42 +01:00
Antoine Pitrou 4de7457009 Issue #17173: Remove uses of locale-dependent C functions (isalpha() etc.) in the interpreter.
I've left a couple of them in: zlib (third-party lib), getaddrinfo.c
(doesn't include Python.h, and probably obsolete), _sre.c (legitimate
use for the re.LOCALE flag).
2013-02-09 23:11:27 +01:00
Serhiy Storchaka 7611d9a8cf Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
2013-02-09 11:13:46 +02:00
Serhiy Storchaka 8135de80f7 Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
2013-02-09 11:12:36 +02:00
Serhiy Storchaka 01ad622a2c Issue #16686: Fixed a lot of bugs in audioop module.
* avgpp() and maxpp() no more crash on empty and 1-samples input fragment. They now work when peak-peak values are greater INT_MAX.
* ratecv() no more crashes on empty input fragment.
* Fixed an integer overflow in ratecv().
* Fixed an integer overflow in add() and bias() for 32-bit samples.
* reverse(), lin2lin() and ratecv() no more lose precision for 32-bit samples.
* max() and rms() no more returns negative result for 32-bit sample -0x80000000.
* minmax() now returns correct max value for 32-bit sample -0x80000000.
* avg(), mul(), tomono() and tostereo() now round negative result down and can return 32-bit sample -0x80000000.
* add() now can return 32-bit sample -0x80000000.
2013-02-09 11:10:53 +02:00
Serhiy Storchaka eae3b33316 Issue #17073: Fix some integer overflows in sqlite3 module. 2013-02-07 17:05:32 +02:00
Serhiy Storchaka 2efdc90b0f Issue #17073: Fix some integer overflows in sqlite3 module. 2013-02-07 17:03:46 +02:00
Serhiy Storchaka 3cf96ac248 Issue #17073: Fix some integer overflows in sqlite3 module. 2013-02-07 17:01:47 +02:00
Raymond Hettinger 59cf23ab07 Minor tweaks to varnames, declarations, and comments. 2013-02-07 00:57:19 -05:00
Charles-François Natali 773e42dff8 Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by Brian
Thorne.
2013-02-05 19:42:01 +01:00
Raymond Hettinger 1f0044c473 Minor variable access clean-ups for deque.rotate(). 2013-02-05 01:30:46 -05:00
Serhiy Storchaka 88eea543d6 Issue #17089: Expat parser now correctly works with string input not only when
an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
strings larger than 2 GiB.
2013-02-04 18:29:47 +02:00
Serhiy Storchaka 36b365ccff Issue #17089: Expat parser now correctly works with string input not only when
an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
strings larger than 2 GiB.
2013-02-04 18:28:01 +02:00
Serhiy Storchaka 43536e9e37 Issue #17089: Expat parser now correctly works with string input not only when
an internal XML encoding is UTF-8 or US-ASCII.  It now accepts bytes and
strings larger than 2 GiB.
2013-02-04 18:26:15 +02:00
R David Murray 811724ce7f merge #17091: update docstring for _thread.Lock.acquire. 2013-02-04 10:25:51 -05:00
R David Murray b7be42b1f9 merge #17091: update docstring for _thread.Lock.acquire. 2013-02-04 10:22:39 -05:00
R David Murray 95b7110a11 #17091: update docstring for _thread.Lock.acquire.
The main docs were fixed to remove mention of None long ago,
but the docstring was not.  Reported by Armin Rigo, patch
by Ian Cordasco.
2013-02-04 10:15:58 -05:00
Serhiy Storchaka b6a53404b7 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:57:16 +02:00
Serhiy Storchaka 1d0bb9c8f9 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:54:04 +02:00
Serhiy Storchaka 19c4e0df29 Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
parses nested mutating sequence.
2013-02-04 12:47:24 +02:00
Raymond Hettinger a4409c18eb Minor edits: Tighten-up the halflen logic and touch-up the assertions and comments. 2013-02-04 00:08:12 -05:00
Serhiy Storchaka cce1b8eda8 Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
2013-02-03 17:09:17 +02:00
Serhiy Storchaka d03ce4ae3d Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
2013-02-03 17:07:32 +02:00
Serhiy Storchaka 94dc6736bd Issue #17106: Fix a segmentation fault in io.TextIOWrapper when an underlying
stream or a decoder produces data of an unexpected type (i.e. when
io.TextIOWrapper initialized with text stream or use bytes-to-bytes codec).
2013-02-03 17:03:31 +02:00
Raymond Hettinger 3a9ae7fd98 Issue 16398: One more assertion for good measure. 2013-02-02 12:26:37 -08:00
Nadeem Vawda 56265564ff Back out fix for issue #13886; it introduced a new bug in interactive readline use. 2013-02-02 20:29:39 +01:00
Nadeem Vawda c27bcbf863 Back out fix for issue #13886; it introduced a new bug in interactive readline use. 2013-02-02 20:25:19 +01:00
Raymond Hettinger 231ee4dc9d Issue 16398: Add assertions to show why memcmp is safe. 2013-02-02 11:24:43 -08:00
Nadeem Vawda 6375257188 Back out fix for issue #13886; it introduced a new bug in interactive readline use. 2013-02-02 20:05:11 +01:00
Raymond Hettinger 21777acd68 Issue 16398: Use memcpy() in deque.rotate(). 2013-02-02 09:56:08 -08:00
Gregory P. Smith a5042671c3 In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
2013-02-01 17:07:56 -08:00
Gregory P. Smith 90fa9508a6 In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
2013-02-01 17:07:39 -08:00
Gregory P. Smith aded2e5e59 In the _hashlib module, only initialize the static data for OpenSSL's
constructors once, to avoid memory leaks when finalizing and re-initializing
the Python interpreter.
2013-02-01 17:05:29 -08:00
Gregory P. Smith 84d0bf94b0 Additional fix for issue #12268: The io module file object write methods no
longer abort early when a write system call is interrupted (EINTR).
2013-02-01 13:10:33 -08:00
Gregory P. Smith 99ec7f6f3e Additional fix for issue #12268: The io module file object write methods no
longer abort early when a write system call is interrupted (EINTR).
2013-02-01 13:08:23 -08:00
Gregory P. Smith b9817b01ed Additional fix for Issue #12268: The io module file object writelines() methods no longer abort early when one of its write system calls is interrupted (EINTR). 2013-02-01 13:03:39 -08:00
Brett Cannon 611afc1b3f Issue #17098: all modules should have __loader__ 2013-02-01 14:07:28 -05:00
Brett Cannon 0ecd30b4af Issue #17098: Make sure every module has __loader__ defined.
Thanks to Thomas Heller for the bug report.
2013-02-01 14:04:12 -05:00
Nadeem Vawda ef0a44c629 Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.
Also fix sporadic failures in test_builtin due to dependence on whether the
readline module has previously been imported.
2013-01-27 14:17:21 +01:00
Nadeem Vawda 60cc32382f Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.
Also fix sporadic failures in test_builtin due to dependence on whether the
readline module has previously been imported.
2013-01-27 14:13:25 +01:00
Nadeem Vawda 6f02ea02c8 Issue #13886: Fix input() to not strip out supposedly-invalid input bytes.
Also fix sporadic failures in test_builtin due to dependence on whether the
readline module has previously been imported.
2013-01-27 14:01:42 +01:00
Ezio Melotti 3a62e45b97 Merge typo fixes from 3.3. 2013-01-27 06:20:51 +02:00
Ezio Melotti 3f5db3940f Fix a few typos and a double semicolon. Patch by Eitan Adler. 2013-01-27 06:20:14 +02:00
Ronald Oussoren 20190e2d54 Issue #1602133: 'environ' is not really available with shared libraries on OSX (merge from 3.3)
There already was a workaround for this for framework builds on OSX,
this changeset enables the same workaround for shared libraries.

Closes #1602133
2013-01-25 18:02:35 +01:00
Ronald Oussoren 1c90eed8a9 Issue #1602133: 'environ' is not really available with shared libraries on OSX (merge from 3.2)
There already was a workaround for this for framework builds on OSX,
this changeset enables the same workaround for shared libraries.

Closes #1602133
2013-01-25 18:01:05 +01:00
Ronald Oussoren 697e56d0f5 Issue #1602133: 'environ' is not really available with shared libraries on OSX
There already was a workaround for this for framework builds on OSX,
this changeset enables the same workaround for shared libraries.

Closes #1602133
2013-01-25 17:57:13 +01:00
Martin v. Löwis c8c6563097 Replace WaitForMultipleObjects with WaitForMultipleObjectEx,
for better WinRT compatibility.
2013-01-25 14:29:13 +01:00
Martin v. Löwis b26a9b10ea Replace WaitForSingleObject with WaitForSingleObjectEx,
for better WinRT compatibility.
2013-01-25 14:25:48 +01:00
Serhiy Storchaka 35f284b75e Clean trailing whitespace in itertoolsmodule.c. 2013-01-25 13:40:01 +02:00
Serhiy Storchaka d269b5e73d Clean trailing whitespace in itertoolsmodule.c. 2013-01-25 13:38:56 +02:00
Serhiy Storchaka e7e9c32195 Clean trailing whitespace in itertoolsmodule.c. 2013-01-25 13:37:39 +02:00
Serhiy Storchaka c5dadcf2fd Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
2013-01-25 13:26:55 +02:00
Serhiy Storchaka 339e91d4cb Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
2013-01-25 13:24:47 +02:00
Serhiy Storchaka a3e9128aba Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
if all other iterators were very advanced before.
2013-01-25 13:19:31 +02:00
Eli Bendersky fa88b5d656 merge heads 2013-01-24 07:17:17 -08:00
Stefan Krah eb8c451bd2 Since the return type of format() is not a Decimal, raise ValueError instead of
InvalidOperation if the format specification (width, prec) exceeds the internal
limits of libmpdec.
2013-01-24 15:22:33 +01:00
Charles-François Natali c07fcbb698 Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
Patch by Jeffrey Armstrong.
2013-01-19 12:39:29 +01:00
Charles-François Natali 95195b35b8 Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
Patch by Jeffrey Armstrong.
2013-01-19 12:21:26 +01:00
Charles-François Natali 986a56cefe Issue #16953: Fix socket module compilation on platforms with HAVE_BROKEN_POLL.
Patch by Jeffrey Armstrong.
2013-01-19 12:19:10 +01:00
Serhiy Storchaka 9101e23ff6 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:41:45 +02:00
Serhiy Storchaka 441d30fac7 Issue #15989: Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.

This is a backport of changesets 13e2e44db99d and 525407d89277.
2013-01-19 12:26:26 +02:00
Raymond Hettinger 8a7d74446c merge 2013-01-18 17:53:18 -08:00
Raymond Hettinger bd8f29028e Show the function signature in the docstring 2013-01-18 17:35:25 -08:00
Benjamin Peterson 9f30abd393 merge 3.3 2013-01-18 00:10:37 -05:00
Benjamin Peterson c68a4a048c check windows fd validity (closes #16992) 2013-01-18 00:10:24 -05:00
Stefan Krah 20d60803d5 Issue #16982: Fix --without-threads build failure. 2013-01-17 17:07:17 +01:00
Stefan Krah 31efb380b3 Merge 3.3. 2013-01-16 23:25:41 +01:00
Stefan Krah 897c3e994f Issue #11729: Backport commit bff052d9 from libffi upstream in order to fix
a ctypes build failure with clang.
2013-01-16 23:18:34 +01:00
Stefan Krah e2515e4997 Merge 3.3. 2013-01-16 15:19:16 +01:00