Brett Cannon
845f7845aa
Issue #18556 : Check the return value for PyUnicode_AsWideChar() in
...
U_set() from ctypes.
CID #486657
2013-07-25 17:34:00 -04:00
Christian Heimes
7c8cd257e4
Issue #18549 : Eliminate dead code in socket_ntohl().
...
CID 982369
2013-07-25 11:47:25 +02:00
Christian Heimes
9228837e31
Issue #18549 : Eliminate dead code in socket_ntohl().
...
CID 982369
2013-07-25 11:46:10 +02:00
Ezio Melotti
3e1e97a99a
#16937 : merge with 3.3.
2013-07-25 05:04:50 +02:00
Ezio Melotti
61b0c672b5
#16937 : document that stdin is always buffered, even when -u is used. Patch by Elena Oat.
2013-07-25 05:04:02 +02:00
Victor Stinner
1c8f059019
Issue #18520 : Add a new PyStructSequence_InitType2() function, same than
...
PyStructSequence_InitType() except that it has a return value (0 on success,
-1 on error).
* PyStructSequence_InitType2() now raises MemoryError on memory allocation failure
* Fix also some calls to PyDict_SetItemString(): handle error
2013-07-22 22:24:54 +02:00
Christian Heimes
de0e63bd9c
Issue #15905 : Fix theoretical buffer overflow in handling of sys.argv[0],
...
prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
2013-07-22 12:54:21 +02:00
Christian Heimes
60a6067709
Issue #15905 : Fix theoretical buffer overflow in handling of sys.argv[0],
...
prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
2013-07-22 12:53:32 +02:00
Victor Stinner
3a8573230c
Issue #18488 : Fix _pysqlite_final_callback()
...
Restore behaviour of Python 3.3: print the finalizer() error if
sqlite3.enable_callback_tracebacks() has been called, clear the error
otherwise.
But keep (save/restore) also the AttributeError raised in
_pysqlite_step_callback().
2013-07-22 08:34:32 +02:00
Christian Heimes
e5378e2223
Now all error paths of _freeze_importlib use 'goto error' and the error label cleans up all used resources.
2013-07-21 23:05:11 +02:00
Christian Heimes
43d82df406
Now all error paths of _freeze_importlib use 'goto error' and the error label cleans up all used resources.
2013-07-21 23:05:04 +02:00
Christian Heimes
71945880fb
Issue #18514 : Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
2013-07-21 16:25:30 +02:00
Christian Heimes
8c4c1f6e66
Issue #18514 : Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
2013-07-21 16:24:51 +02:00
Christian Heimes
992fe2ab84
Fix reference and memory leaks in _freeze_importlib
2013-07-21 16:19:16 +02:00
Christian Heimes
96f628f487
Fix reference and memory leaks in _freeze_importlib
2013-07-21 16:19:02 +02:00
Victor Stinner
41801f5812
Issue #18519 , #18408 : Fix sqlite authorizer callback
...
If a previous call to the authorizer callback failed and raised an exception,
don't call the Python authorizer callback, but just return SQLITE_DENY.
2013-07-21 13:05:38 +02:00
Raymond Hettinger
b97cc49c3a
Minor code simplification by eliminating an unnecessary temporary variable.
2013-07-21 01:51:07 -07:00
Christian Heimes
603bd2d374
Check return value of PyEval_GetGlobals() for NULL
...
CID 486814
2013-07-20 22:54:39 +02:00
Christian Heimes
a6404ad43c
Check return value of PyEval_GetGlobals() for NULL
...
CID 486814
2013-07-20 22:54:25 +02:00
Christian Heimes
5df8ff01d9
Check return value of flush_character_buffer()
...
CID 486663
2013-07-20 22:42:06 +02:00
Christian Heimes
09994a9c59
Check return value of flush_character_buffer()
...
CID 486663
2013-07-20 22:41:58 +02:00
Mark Dickinson
60d634ae4a
Issue #18513 : Add workaround for OS X 10.8 cexp bug that leads to wrong cmath.rect(0.0,-0.0) results.
2013-07-20 18:00:06 +01:00
Mark Dickinson
58ceecfe5a
Issue #18513 : Add workaround for OS X 10.8 cexp bug that leads to wrong cmath.rect(0.0,-0.0) results.
2013-07-20 17:59:13 +01:00
Christian Heimes
2ef710e40f
Add missing check of PyDict_Update()'s return value in _elementtree.c
...
CID 719637
2013-07-20 15:12:19 +02:00
Christian Heimes
7ed4294d7f
Add missing check of PyDict_Update()'s return value in _elementtree.c
...
CID 719637
2013-07-20 15:12:09 +02:00
Christian Heimes
3f95bdcdbe
Add missing check of PyDict_SetItem()'s return value
...
CID 486659
2013-07-20 15:01:36 +02:00
Christian Heimes
97cb67b9ca
Add missing check of PyDict_SetItem()'s return value
...
CID 486659
2013-07-20 15:01:26 +02:00
Christian Heimes
abfc4d838a
Fix fishy sizeof(Py_ssize_t *).
...
sizeof(Py_ssize_t *) == sizeof(Py_ssize_t) but it's not a portable assumption.
CID 486403
2013-07-20 14:11:52 +02:00
Christian Heimes
e91ad501c5
Use strncat() instead of strcat() to silence some warnings.
...
CID 486616, CID 486617, CID 486615
2013-07-20 14:11:28 +02:00
Raymond Hettinger
5ea0f80165
Make the GCC-4.8 compiler happy by moving declarations to the top of the function.
2013-07-19 19:52:04 -07:00
Ronald Oussoren
ced1226cce
(3.3->default): #18480 : Add missing PyType_Ready call to _elementtree extension
2013-07-19 11:14:05 +02:00
Ronald Oussoren
138d080a28
#18480 : Add missing PyType_Ready call to _elementtree extension
2013-07-19 11:11:25 +02:00
Victor Stinner
d85032e25d
(Merge 3.3) Fix posix_chflags(): return_value was uninitialized when
...
follow_symlinks=False whereas the fchmodat() function is not avaialble.
2013-07-18 23:58:08 +02:00
Victor Stinner
45e90394e7
Fix posix_chflags(): return_value was uninitialized when follow_symlinks=False
...
whereas the fchmodat() function is not avaialble.
2013-07-18 23:57:35 +02:00
Victor Stinner
9e09c26e8a
Issue #18501 , #18408 : Fix expat handlers in pyexpat, don't call Python
...
functions if a Python exception was raised
2013-07-18 23:17:01 +02:00
Victor Stinner
3fd8cbd5e4
Issue #18408 : Fix _elementtree.c, don't call Python function from an expat
...
handler if a Python exception is set
2013-07-18 22:46:14 +02:00
Victor Stinner
ca713c014e
Fix a compiler warning on FreeBSD
...
Modules/python.c:40: warning: ISO C90 forbids mixed declarations and code
2013-07-18 02:43:47 +02:00
Victor Stinner
569f364017
Issue #18408 : Fix PyInit__curses_panel(), handle import_curses() failure
...
Don't call PyErr_NewException() if an exception is set, or type_call() would
fail with an assertion error.
2013-07-18 02:31:21 +02:00
Victor Stinner
4abda5d5b0
Issue #18408 : Fix _pysqlite_fetch_one_row(), in debug mode, don't call
...
type_call() with an exception set
2013-07-18 01:54:37 +02:00
Victor Stinner
ace47d7efd
Issue #18408 : PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail
...
with an assertion error if they are called with an exception set
(PyErr_Occurred()).
If these functions are called with an exception set, the exception may be
cleared and so the caller looses its exception.
Add also assertions to PyEval_CallObjectWithKeywords() and call_function() to
check if the function succeed with no exception set, or the function failed
with an exception set.
2013-07-18 01:41:08 +02:00
Victor Stinner
e9af4cface
Issue #18488 : _pysqlite_final_callback() should not clear the exception set by
...
the last call to the step() method of a user function
2013-07-18 01:42:04 +02:00
Victor Stinner
4755beac3c
Issue #18408 : Fix array_tolist(), handle PyList_SetItem() failure
2013-07-18 01:12:35 +02:00
Victor Stinner
0b142e2809
Issue #18408 : Fix array_index(), handle getarrayitem() failure
2013-07-17 23:01:30 +02:00
Victor Stinner
764a46d2ed
Issue #18408 : Fix heapq.heappop(), handle PyList_SetSlice() failure
2013-07-17 21:50:21 +02:00
Victor Stinner
2ff51b83b8
Issue #18408 : Fix time.tzset(), detect exception when calling PyInit_timezone()
2013-07-17 21:42:45 +02:00
Victor Stinner
d594f24fbc
Issue #18408 : Fix locale.localeconv(), handle PyDict_SetItemString() failure
2013-07-17 00:55:57 +02:00
Victor Stinner
6684bdf73d
Issue #18408 : Fix typo in build_node_tree() of the parser module
...
Type "o" format of Py_BuildValue() is invalid: it must be "O".
2013-07-17 00:13:52 +02:00
Victor Stinner
1e53bbaced
Issue #18408 : handle PySys_GetObject() failure, raise a RuntimeError
2013-07-16 22:26:05 +02:00
Victor Stinner
d1f9942ae3
Issue #18408 : Fix cjkcodecs decoders, add a new MBERR_EXCEPTION constant to
...
notify exceptions raised by the _PyUnicodeWriter API
2013-07-16 21:41:43 +02:00
Victor Stinner
85c761d3d3
Issue #18408 : Fix fileio_read() on _PyBytes_Resize() failure
...
bytes is NULL on _PyBytes_Resize() failure
2013-07-16 21:36:02 +02:00
Victor Stinner
a4ced86f03
Issue #18408 : random_seed() now raises a MemoryError on memory allocation
...
failure
2013-07-15 20:00:36 +02:00
Victor Stinner
33283ba300
Issue #18408 : Fix CJK decoders, raise MemoryError on memory allocation failure
2013-07-15 17:47:39 +02:00
Victor Stinner
54b2d2ec69
Issue #18408 : Fix pyexpat.ParserCreate()
...
Check if XML_ParserCreate_MM() failed (ex: MemoryError) before using
self->itself.
2013-07-15 17:15:57 +02:00
Ronald Oussoren
0fedb37c47
Issue #18393 : Remove use of deprecated API on OSX
...
The "Gestalt" function on OSX is deprecated (starting with OSX 10.8),
remove its usage from the stdlib. The patch removes a number of private
functions and a private module, but does not change the public API.
The removed code was effectively dead, the platform module has used
other code to fetch the OSX version for years and could only use
on the Gestalt-based code as a fallback. That fallback can only trigger
on broken OSX installs (that is, someone has removed parts of the system
install)
2013-07-15 18:32:09 +02:00
Richard Oudkerk
9ba6962a04
Issue #18344 : Fix potential ref-leaks in _bufferedreader_read_all().
2013-07-15 16:10:28 +01:00
Richard Oudkerk
9ad51ec81b
Issue #18344 : Fix potential ref-leaks in _bufferedreader_read_all().
2013-07-15 16:05:22 +01:00
Raymond Hettinger
90dea4ce43
Tweak the deque struct by moving the least used fields (maxlen and weakref) to the end.
2013-07-13 22:30:25 -07:00
Raymond Hettinger
840533bf1c
Use a do-while loop in the inner loop for rotate (m is always greater than zero).
2013-07-13 17:03:58 -07:00
Raymond Hettinger
3959af9b2a
Move the freeblock() call outside the main loop to speed-up and simplify the block re-use logic.
2013-07-13 02:34:08 -07:00
Victor Stinner
d917dcbe5e
Issue #18408 : Fix constructors of _elementtree.c
...
* Use Py_DECREF() instead of PyObject_GC_Del() to release correctly all
resources
* Raise MemoryError on memory allocation failure
2013-07-12 02:05:17 +02:00
Victor Stinner
81aac734e1
Issue #18408 : Fix create_extra() of _elementtree.c, raise MemoryError on memory
...
allocation failure
2013-07-12 02:03:34 +02:00
Victor Stinner
df4572cc71
Issue #18408 : parser module: fix error handling in node2tuple()
...
Handle PyLong_FromLong() and PyUnicode_FromString() failures
2013-07-12 01:35:10 +02:00
Victor Stinner
3bd6abd129
Issue #18408 : Fix parser.sequence2st() and parser.tuple2st(): raise MemoryError
...
on memory allocation failure
Instead of ignoring the memory allocation failure and create invalid objects.
2013-07-12 01:33:59 +02:00
Victor Stinner
4202456cd4
Issue #18408 : _pickle.c: Add missing PyErr_NoMemory() on memory allocation failures
2013-07-12 00:53:57 +02:00
Victor Stinner
8ca72e2e3d
Issue #18408 : _PyMemoTable_ResizeTable() now restores the old table if
...
allocating a bigger table failed
PyMemoTable destructor does crash if mt_table is NULL.
2013-07-12 00:53:26 +02:00
Victor Stinner
c31df04234
Issue #18408 : Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroy
...
the newly created pickler, and not PyObject_GC_Del().
2013-07-12 00:08:59 +02:00
Victor Stinner
71c8b7ec04
Issue #18408 : Different fixes in _elementtree.c to handle correctly MemoryError
...
* create_new_element() initializes all attributes before handling errors,
to fix a crash in the destructor
* create_new_element() calls PyObject_GC_Del() on error, instead of
PyObject_Del(), because the object was created by PyObject_GC_New()
* subelement() now handles create_new_element() failure
* element_getattro() now handles element_get_text() failure
* makeuniversal() now handles PyBytes_FromStringAndSize() failure
2013-07-11 23:08:39 +02:00
Victor Stinner
4d46343340
Cleanup _elementtree.c
2013-07-11 23:05:03 +02:00
Victor Stinner
5f0af23f5e
Issue #18408 : _elementtree.c now handles create_extra() failure
2013-07-11 23:01:36 +02:00
Victor Stinner
68c8ea25f1
Issue #18408 : Fix _Pickler_New() and _Unpickler_New(): initialize all
...
attributes before handling errors
_Pickler_New() now calls PyObject_GC_Del() instead of Py_DECREF() on error,
because the pickle object is created using PyObject_GC_New().
Fix a crash in the destructor when an attribute is not initiallized.
2013-07-11 22:56:25 +02:00
Serhiy Storchaka
50ae3f680b
Issue #18101 : Tcl.split() now process strings nested in a tuple as it
...
do with byte strings.
Added tests for Tcl.split() and Tcl.splitline().
2013-07-11 20:36:00 +03:00
Serhiy Storchaka
275d5fdbe4
Issue #18101 : Tcl.split() now process strings nested in a tuple as it
...
do with byte strings.
Added tests for Tcl.split() and Tcl.splitline().
2013-07-11 20:34:47 +03:00
Serhiy Storchaka
e3ed4edb94
Issue #18338 : `python --version` now prints version string to stdout, and
...
not to stderr. Patch by Berker Peksag and Michael Dickens.
2013-07-11 20:01:17 +03:00
R David Murray
609142ef05
Merge: #18399 : fix comment typo.
2013-07-10 11:57:39 -04:00
R David Murray
296b73c83d
#18399 : fix comment typo.
...
Patch by Andrew Rowe.
2013-07-10 10:57:39 -04:00
Raymond Hettinger
d9c116ca40
Add a spacing saving heuristic to deque's extend methods
2013-07-09 00:13:21 -07:00
Victor Stinner
bbf8ce5b87
Issue #18408 : Fix select.select() to handle PyList_New() failure (MemoryError)
...
in set2list()
2013-07-09 00:49:03 +02:00
Victor Stinner
7979926616
Issue #18408 : Fix usage of _PyBytes_Resize()
...
_PyBytes_Resize(&v, new_size) sets v to NULL on error, so v cannot be used
anymore. Replace "Py_DECREF(v); v = NULL;" with "Py_CLEAR(v);".
2013-07-09 00:35:22 +02:00
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