Commit Graph

8597 Commits

Author SHA1 Message Date
Benjamin Peterson 33f8f15bdd add readline.append_history_file (closes #22940)
patch by "bru"
2014-11-26 13:58:16 -06:00
Benjamin Peterson f9284ae8ed merge 3.4 (#22921) 2014-11-23 17:06:39 -06:00
Nick Coghlan d600951748 Issue #22869: Split pythonrun into two modules
- interpreter startup and shutdown code moved to a new
  pylifecycle.c module
- Py_OptimizeFlag moved into the new module with the other
  global flags
2014-11-20 21:39:37 +10:00
Benjamin Peterson 994c7f76a3 merge 3.4 (#22849) 2014-11-12 10:23:35 -05:00
Benjamin Peterson 6c14f23100 fix possible double free in TextIOWrapper.__init__ (closes #22849) 2014-11-12 10:19:46 -05:00
Serhiy Storchaka 5a8dacf9c6 Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
2014-11-10 11:25:50 +02:00
Serhiy Storchaka d915b0847d Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
2014-11-10 10:42:26 +02:00
Brett Cannon b7299ddbc7 Issue 20152, 22821: Port the fcntl module to Argument Clinic.
Along the way, fix an argumrnt to fcntl.fcntl to be an int instead of
a long.

Thanks to Serhiy Storchaka for reviewing my Clinic patch and for
writing the patch to fix the long/int issue.
2014-11-09 20:22:01 -05:00
Benjamin Peterson 8726f2b89c merge 3.4 2014-11-06 00:53:18 -05:00
Benjamin Peterson abd1c97bd2 fix test where sizeof(long) != sizeof(int) 2014-11-06 00:52:58 -05:00
Steve Dower 5c2939cc41 Issue #20160: broken ctypes calling convention on MSVC / 64-bit Windows (large structs) Patch by mattip 2014-11-05 19:30:30 -08:00
Victor Stinner ce43f38ace Issue #20597: Remove unused definition of PATH_MAX on Windows, MAXPATHLEN is
now preferred. Patch written by Jeffrey Armstrong.
2014-11-05 15:11:34 +01:00
Steve Dower b7fa201113 Issue #20160: broken ctypes calling convention on MSVC / 64-bit Windows (large structs) Patch by mattip 2014-11-04 21:21:22 -08:00
Antoine Pitrou d39e199a0d Issue #22773: fix failing test with old readline versions due to issue #19884. 2014-11-04 14:53:01 +01:00
Antoine Pitrou 7e8b8678f1 Issue #22773: fix failing test with old readline versions due to issue #19884. 2014-11-04 14:52:10 +01:00
Serhiy Storchaka 4b8f8949b4 Issue #17381: Fixed handling of case-insensitive ranges in regular expressions.
Added new opcode RANGE_IGNORE.
2014-10-31 12:36:56 +02:00
Georg Brandl 587bac1a0a merge with 3.4 2014-10-28 22:24:52 +01:00
Georg Brandl e48ec212e8 Fix typo. 2014-10-28 22:24:46 +01:00
Antoine Pitrou fce60eaf15 Issue #22676: Make the pickling of global objects which don't have a __module__ attribute less slow. 2014-10-23 22:47:50 +02:00
Victor Stinner f427a14156 Issue #22592: Drop support of the Borland C compiler to build Python
The distutils module still supports it to build extensions.
2014-10-22 12:33:23 +02:00
Robert Collins 933430ab69 Issue #17401: document closefd in io.FileIO docs and add to repr
closefd was documented in the open docs but not the matching FileIO
class documented. Further, closefd, part of the core state for the
object was not shown.

In review it was noted that the open docs are a little confusing about
the interaction between closefd and paths, so tweaked them at the same
time.
2014-10-18 13:32:43 +13:00
Brett Cannon b0fc490307 Issue #20152: Convert the cmath module to Argument Clinic. 2014-10-14 17:37:02 -04:00
Larry Hastings dfbeb160de Issue #22615: Argument Clinic now supports the "type" argument for the
int converter.  This permits using the int converter with enums and
typedefs.
2014-10-13 10:39:41 +01:00
R David Murray 9755174464 Merge: #13096: Fix segfault in CTypes POINTER handling of large values. 2014-10-12 13:56:37 -04:00
R David Murray 817905b239 #13096: Fix segfault in CTypes POINTER handling of large values.
Patch by Meador Inge.
2014-10-12 13:54:48 -04:00
Georg Brandl bfd7881aa6 #22568: merge with 3.4 2014-10-12 08:45:26 +02:00
Georg Brandl e1a7d9dbf5 Closes #22568: fix UTIME_TO_* macros in posixmodule for rare cases. 2014-10-12 08:45:15 +02:00
Benjamin Peterson 588dad0308 merge 3.4 (closes #22605) 2014-10-10 20:58:43 -04:00
Benjamin Peterson 682124ccc3 prevent passing NULL to memcpy (closes #22605)
Patch by Jakub Wilk.
2014-10-10 20:58:30 -04:00
Brett Cannon 1eb32c2045 Issue #20152: Port the array module to Argument Clinic. 2014-10-10 16:26:45 -04:00
Serhiy Storchaka 5aa47443c6 Issue #22584: Got rid of character tables in _sre.c and use standard macros
Py_TOLOWER, Py_ISSPACE, etc.
2014-10-10 11:10:46 +03:00
Victor Stinner d42c4282b9 Closes #22579: Fix posixmodule.c to support any C compiler on Windows 2014-10-10 00:09:47 +02:00
Victor Stinner aad627f2f9 Merge 3.4 2014-10-09 22:16:15 +02:00
Victor Stinner fc6a90a92e Issue #22588: Fix typo in _testcapi.test_incref_decref_API() 2014-10-09 22:15:41 +02:00
Victor Stinner 67e2e6d600 (Merge 3.4) Issue #22568: Fix compilation of posixmodule.c with Open Watcom:
rename "utime" variable to "ut" to avoid conflict with the C utime() function.
Patch written by Jeffrey Armstrong.
2014-10-09 13:53:45 +02:00
Victor Stinner 484df0075a Issue #22568: Fix compilation of posixmodule.c with Open Watcom: rename "utime"
variable to "ut" to avoid conflict with the C utime() function. Patch written
by Jeffrey Armstrong.
2014-10-09 13:52:31 +02:00
Serhiy Storchaka 78184af9b5 Issue #21715: Extracted shared complicated code in the _io module to new
_PyErr_ChainExceptions() function.
2014-10-08 22:32:50 +03:00
Serhiy Storchaka e2bd2a7186 Issue #21715: Extracted shared complicated code in the _io module to new
_PyErr_ChainExceptions() function.
2014-10-08 22:31:52 +03:00
Antoine Pitrou 94262ebc9c Issue #22462: Fix pyexpat's creation of a dummy frame to make it appear in exception tracebacks.
Initial patch by Mark Shannon.
2014-10-08 20:02:40 +02:00
Antoine Pitrou 0ddbf4795f Issue #22462: Fix pyexpat's creation of a dummy frame to make it appear in exception tracebacks.
Initial patch by Mark Shannon.
2014-10-08 20:00:09 +02:00
Antoine Pitrou b1fdf47ff5 Issue #21965: Add support for in-memory SSL to the ssl module.
Patch by Geert Jansen.
2014-10-05 20:41:53 +02:00
R David Murray 861470c836 #16518: Bring error messages in harmony with docs ("bytes-like object")
Some time ago we changed the docs to consistently use the term 'bytes-like
object' in all the contexts where bytes, bytearray, memoryview, etc are used.
This patch (by Ezio Melotti) completes that work by changing the error
messages that previously reported that certain types did "not support the
buffer interface" to instead say that a bytes-like object is required.  (The
glossary entry for bytes-like object references the discussion of the buffer
protocol in the docs.)
2014-10-05 11:47:01 -04:00
Victor Stinner f4e4b83824 (Merge 3.4) Issue #22290: Fix error handling in the _posixsubprocess module.
* Don't call the garbage collector with an exception set: it causes an
  assertion to fail in debug mode.
* Enhance also error handling if allocating an array for the executable list
  failed.
* Add an unit test for 4 different errors in the _posixsubprocess module.
2014-10-05 17:25:48 +02:00
Victor Stinner 8f437aac06 Issue #22290: Fix error handling in the _posixsubprocess module.
* Don't call the garbage collector with an exception set: it causes an
  assertion to fail in debug mode.
* Enhance also error handling if allocating an array for the executable list
  failed.
* Add an unit test for 4 different errors in the _posixsubprocess module.
2014-10-05 17:25:19 +02:00
Georg Brandl 54eec2d0af merge with 3.4 2014-10-02 08:35:31 +02:00
Georg Brandl 41ea1f4f26 Closes #19342: improve docstrings in grp module. 2014-10-02 08:34:41 +02:00
Victor Stinner 6b8e0ed562 (Merge 3.4) faulthandler: test_gil_released() now uses _sigsegv() instead of
_read_null(), because _read_null() cannot be used on AIX. On AIX, reading from
NULL is allowed: the first page of memory is a mapped read-only on AIX.

_read_null() and _sigabrt() don't accept parameters.
2014-09-30 13:55:30 +02:00
Victor Stinner 5083828d65 faulthandler: test_gil_released() now uses _sigsegv() instead of _read_null(),
because _read_null() cannot be used on AIX. On AIX, reading from NULL is
allowed: the first page of memory is a mapped read-only on AIX.
2014-09-30 13:54:14 +02:00
Victor Stinner 9db521c4a8 faulthandler: _sigsegv() and _sigabrt() don't accept parameters 2014-09-30 13:49:09 +02:00
Victor Stinner 7a39912dda faulthandler: suppress crash reporter directly in test functions written to
crash.
2014-09-30 13:40:12 +02:00
Victor Stinner ec39e26881 (Merge 3.4) Issue #22396: On 32-bit AIX platform, don't expose
os.posix_fadvise() nor os.posix_fallocate() because their prototypes in system
headers are wrong.
2014-09-30 12:35:58 +02:00
Victor Stinner d6b176905d Issue #22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
os.posix_fallocate() because their prototypes in system headers are wrong.
2014-09-30 12:20:05 +02:00
Benjamin Peterson 58ee2d31ab merge 3.4 (#22517) 2014-09-29 22:49:05 -04:00
Benjamin Peterson c44eb73473 merge 3.3 (#22517) 2014-09-29 22:48:51 -04:00
Benjamin Peterson bbd0a323ae clear BufferedRWPair weakrefs on deallocation (closes #22517) 2014-09-29 22:46:57 -04:00
Serhiy Storchaka 9baa5b2de2 Issue #22437: Number of capturing groups in regular expression is no longer
limited by 100.
2014-09-29 22:49:23 +03:00
Serhiy Storchaka 20b39b27d9 Removed redundant casts to `char *`.
Corresponding functions now accept `const char *` (issue #1772673).
2014-09-28 11:27:24 +03:00
Antoine Pitrou 2c0a916061 Issue #5309: distutils' build and build_ext commands now accept a ``-j``
option to enable parallel building of extension modules.
2014-09-26 23:31:59 +02:00
Berker Peksag 43705d76aa Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.
Patch by Terry Chia.
2014-09-24 12:44:06 +03:00
Berker Peksag b87630c273 Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.
Patch by Terry Chia.
2014-09-24 12:43:29 +03:00
Charles-François Natali ea07eb9469 Issue #22378: socket module: add SO_MARK. 2014-09-18 23:18:46 +01:00
Nick Coghlan a0f33759fa Merge fix for issue #22166 from 3.4 2014-09-15 23:55:16 +12:00
Nick Coghlan 8fad1676a2 Issue #22166: clear codec caches in test_codecs 2014-09-15 23:50:44 +12:00
Ned Deily 45759a3924 Issue #17095: merge from 3.4 2014-09-14 19:21:05 -07:00
Ned Deily ad24d62882 Issue #17095: Temporarily revert getpath.c change that added the Modules
directory to sys.path when running from a build directory.  That has
proven to be problematic for several standard library modules with
C extension modules whose builds can fail on some platforms.
2014-09-14 19:19:49 -07:00
Victor Stinner ee6c3c7162 Closes #22336: attemptckalloc() with PyMem_Malloc() in _tkinter
The PyMem_Malloc(size) function has a well defined behaviour: if size is 0, a
pointer different than NULL is returned. PyMem_Malloc() allocations are
tracked by tracemalloc, attemptckalloc() allocations are not tracked.
2014-09-11 17:50:21 +02:00
Serhiy Storchaka 2c16df269a Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncate it.  Based on patch by Victor Stinner.
2014-09-11 13:30:48 +03:00
Serhiy Storchaka 42d67af87f Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncate it.  Based on patch by Victor Stinner.
2014-09-11 13:29:05 +03:00
Serhiy Storchaka d5fd6188e2 Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.

On some platforms Tcl memory allocator returns NULL when allocating zero-sized
block of memory.
2014-09-11 10:58:02 +03:00
Serhiy Storchaka abf68ce164 Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.

On some platforms Tcl memory allocator returns NULL when allocating zero-sized
block of memory.
2014-09-11 10:57:13 +03:00
Serhiy Storchaka 979f80b8da Issue #21951: Use attemptckalloc() instead of ckalloc() in Tkinter.
ckalloc() causes the Tcl interpreter to panic, attemptckalloc() returns NULL
if the memory allocation fails.
2014-09-11 10:40:44 +03:00
Serhiy Storchaka 0794088379 Issue #21951: Use attemptckalloc() instead of ckalloc() in Tkinter.
ckalloc() causes the Tcl interpreter to panic, attemptckalloc() returns NULL
if the memory allocation fails.
2014-09-11 10:38:54 +03:00
Victor Stinner 8ebf910612 (Merge 3.4) Issue #22338: Fix a crash in the json module on memory allocation
failure.
2014-09-10 23:32:36 +02:00
Victor Stinner 31a3ec313d Issue #22338: Fix a crash in the json module on memory allocation failure. 2014-09-10 23:31:42 +02:00
Serhiy Storchaka dd6507eb86 Issue #22369: Change "context manager protocol" to "context management protocol". 2014-09-10 23:45:42 +03:00
Serhiy Storchaka 148679982f Issue #22369: Change "context manager protocol" to "context management protocol". 2014-09-10 23:43:41 +03:00
Stefan Krah b578f8a1ef Issue #19232: Speed up decimal import. Additionally, since _decimal is
self-contained, this change facilitates maintenance and the Python version
can be easily imported for experimentation.
2014-09-10 17:58:15 +02:00
Serhiy Storchaka d8a1447c99 Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
2014-09-06 20:07:17 +03:00
Serhiy Storchaka 67c719b34b Silenced some warnings about comparison between signed and unsigned integer
expressions.
2014-09-05 10:10:23 +03:00
Antoine Pitrou 47e40429fb Issue #20421: Add a .version() method to SSL sockets exposing the actual protocol version in use. 2014-09-04 21:00:10 +02:00
Victor Stinner 60a64d6812 Issue #21951: Fix AsObj() of the _tkinter module: raise MemoryError on memory
allocation failure
2014-09-04 17:29:52 +02:00
Victor Stinner ae58649721 Issue #22043: time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
2014-09-02 23:18:25 +02:00
Victor Stinner 67ca33dbf4 Issue #22043: Oops, fix perf_counter() on UNIX if no monotonic clock is
available (unlikely)
2014-08-29 17:00:17 +02:00
Victor Stinner 5488449ba4 Issue #22043: Simplify time.perf_counter() on Windows
QueryPerformanceFrequency() cannot fail on Windows XP and later according to
its documentation: raise an exception on error and drop the fallback to the
system clock.
2014-08-29 16:51:33 +02:00
Victor Stinner 0011124dc2 Issue #22043: _PyTime_Init() now checks if the system clock works.
Other changes:

* The whole _PyTime API is private (not defined if Py_LIMITED_API is set)
* _PyTime_gettimeofday_info() also returns -1 on error
* Simplify PyTime_gettimeofday(): only use clock_gettime(CLOCK_REALTIME) or
  gettimeofday() on UNIX. Don't fallback to ftime() or time() anymore.
2014-08-29 16:31:59 +02:00
Victor Stinner 7efb83393c Issue #22287: On UNIX, _PyTime_gettimeofday() now uses
clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now
depends on the librt library on Solaris and on Linux (only with glibc older
than 2.17).
2014-08-29 15:41:08 +02:00
Victor Stinner 3822760f2d Issue #22042: signal.set_wakeup_fd(fd) now raises an exception if the file
descriptor is in blocking mode.
2014-08-27 12:59:44 +02:00
Stefan Krah fc452518e6 Merge 3.4. 2014-08-26 21:32:26 +02:00
Stefan Krah cf26115651 Introduce and check for MPD_VERSION_HEX for precise management of builds
with an external libmpdec.
2014-08-26 21:31:47 +02:00
Stefan Krah 9ea83cff47 Merge 3.4. 2014-08-26 20:47:32 +02:00
Stefan Krah 298131a448 Issue #22090: Fix '%' formatting for infinities and NaNs. 2014-08-26 20:46:49 +02:00
Brett Cannon d0aeda8f0f Issue #20152: Port pyexpat to Argument Clinic.
Could not emit an external file as pyexpat has a conditionally built
method which Clinic won't hide otherwise.
2014-08-22 14:23:20 -04:00
Brett Cannon 9f49e31a4a Add a missing Argument Clinic file 2014-08-22 14:08:46 -04:00
Brett Cannon 3d25e16760 Issue #20152: Port the pwd module to Argument Clinic. 2014-08-22 14:03:51 -04:00
Brett Cannon 52d67ef358 Fix a missing #include. 2014-08-22 14:01:56 -04:00
Brett Cannon 20cf6ddfa2 Issue #20152: Port the spwd module to Argument Clinic. 2014-08-22 13:59:24 -04:00
Brett Cannon 8fb7bb2f29 Issue #20152: Convert the grp module to Argument Clinic. 2014-08-22 11:52:46 -04:00
Brett Cannon f2de1fc21a Issue #20152: Convert _multibytecodecs to Argument Clinic. 2014-08-22 11:45:03 -04:00
Serhiy Storchaka ef1a79799f Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. 2014-08-19 17:12:46 +03:00
Serhiy Storchaka 76b47655ff Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. 2014-08-19 17:11:20 +03:00
Victor Stinner 049e509a9f Issue #22207: Fix "comparison between signed and unsigned integers" warning in
test checking for integer overflow on Py_ssize_t type: cast explicitly to
size_t.
2014-08-17 22:20:00 +02:00
Victor Stinner 7270b7f1aa _pickle: Optimize raw_unicode_escape(), use directly a bytes object, don't use
a temporary bytearray object.
2014-08-17 21:14:46 +02:00
Victor Stinner cfcde8ca40 Issue #22218: Fix "comparison between signed and unsigned integers" warning in
Modules/_sqlite/cursor.c.
2014-08-17 21:09:30 +02:00
Victor Stinner f13c46cc69 Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
Modules/_pickle.c.
2014-08-17 21:05:55 +02:00
Victor Stinner 1a62a680d6 Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
socketmodule.c.
2014-08-17 19:33:28 +02:00
Victor Stinner 52aee85613 Issue #22156: simplify _tracemalloc.c, use an int for the MAX_NFRAME constant 2014-08-16 15:44:02 +02:00
Victor Stinner 706768c687 Issue #22156: Fix some "comparison between signed and unsigned integers"
compiler warnings in the Modules/ subdirectory.
2014-08-16 01:03:39 +02:00
Serhiy Storchaka d7728cafc5 Issue #15381: Optimized line reading in io.BytesIO. 2014-08-14 22:26:38 +03:00
doko@ubuntu.com 3b48af018f - Issue #22176: Fix build failure on ARM with -Werror=declaration-after-statement 2014-08-10 00:01:04 +02:00
doko@ubuntu.com 6a66f155df - Issue #22176: Add src/x86/win32.S for x86 libffi builds. 2014-08-09 23:52:34 +02:00
doko@ubuntu.com a61d058bf9 - Merge 3.4 2014-08-10 00:01:21 +02:00
doko@ubuntu.com be1cd50eb1 merge 3.4. 2014-08-09 23:53:29 +02:00
doko@ubuntu.com 9e15d7a3cc - Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
  architectures.
2014-08-09 22:43:02 +02:00
doko@ubuntu.com 736a913321 - Issue #22176: Update the ctypes module's libffi to v3.1. This release
adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
  architectures.
2014-08-09 22:36:35 +02:00
Serhiy Storchaka d5736faabe Issue #22161: Conformed arguments type checks in ctype to actually supported
types.  Corrected error messages about bytes arguments.
2014-08-09 09:34:25 +03:00
Serhiy Storchaka 4f06d604c4 Issue #22161: Conformed arguments type checks in ctype to actually supported
types.  Corrected error messages about bytes arguments.
2014-08-09 09:33:05 +03:00
Antoine Pitrou b349e4c929 Issue #22116: C functions and methods (of the 'builtin_function_or_method' type) can now be weakref'ed. Patch by Wei Wu. 2014-08-06 19:31:40 -04:00
Serhiy Storchaka af78ef1824 Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
when unpickling pickled sqlite3.Row).  sqlite3.Row is now initialized in the
__new__() method.
2014-08-06 17:51:58 +03:00
Serhiy Storchaka 3d4b2d4df2 Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
when unpickling pickled sqlite3.Row).  sqlite3.Row is now initialized in the
__new__() method.
2014-08-06 17:50:39 +03:00
Zachary Ware 037605b50e Closes #22136: Fix MSVC compiler warnings introduced by #22085 2014-08-05 11:54:34 -05:00
Martin v. Löwis 17fd1e1013 Issue #22127: fix typo. 2014-08-05 16:13:50 +02:00
Martin v. Löwis eb1c28a849 Issue #22127: Bypass IDNA for pure-ASCII host names (in particular for numeric IPs). 2014-08-05 16:10:38 +02:00
Larry Hastings a73cb8a6b8 Issue #22120: For functions using an unsigned integer return converter,
Argument Clinic now generates a cast to that type for the comparison
to -1 in the generated code.  (This supresses a compilation warning.)
2014-08-05 19:55:21 +10:00
Larry Hastings b1dc112dca More fixes for the unhappy AMD FreeBSD 9 buildbot. Fingers crossed. 2014-08-05 16:06:16 +10:00
Larry Hastings 548095cd4f Fix for AMD FreeBSD 9 buildbot (hopefully), broken by my last checkin. 2014-08-05 16:00:03 +10:00
Larry Hastings 2f93635d34 Issue #20170: Convert posixmodule to use Argument Clinic. 2014-08-05 14:04:04 +10:00
Victor Stinner f6a271ae98 Issue #18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`, rename
``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document these
functions.
2014-08-01 12:28:48 +02:00
Victor Stinner a734af3f39 timemodule.c: Replace PyExc_IOError with PyExc_OSError 2014-07-31 13:07:17 +02:00
Serhiy Storchaka 6716d60cec Issue #22085: Dropped support of Tk 8.3 in Tkinter. 2014-07-30 19:19:21 +03:00
Serhiy Storchaka f44611cadf Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
2014-07-30 18:34:01 +03:00
Serhiy Storchaka 74596a887a Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
2014-07-30 18:33:13 +03:00
Antoine Pitrou cc66a73d27 Issue #22003: When initialized from a bytes object, io.BytesIO() now
defers making a copy until it is mutated, improving performance and
memory use on some use cases.

Patch by David Wilson.
2014-07-29 19:41:11 -04:00
Victor Stinner 115171086a Issue #22018: On Windows, signal.set_wakeup_fd() now also supports sockets.
A side effect is that Python depends to the WinSock library.
2014-07-29 23:31:34 +02:00
Victor Stinner 1db9e7bb19 Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get and
set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is
set, True otherwise). These functions are not available on Windows.
2014-07-29 22:32:47 +02:00
Richard Oudkerk c3fc341c35 Issue #21704: Merge. 2014-07-28 23:13:58 +01:00
Richard Oudkerk e0e65817e5 Issue #21704: Fix build error for _multiprocessing when semaphores
are not available.  Patch by Arfrever Frehtes Taifersar Arahesis.
2014-07-28 23:01:02 +01:00
Berker Peksag 0f41acb0ea Issue #22076: Minor grammar fix.
Patch by Martin Matusiak.
2014-07-27 23:22:34 +03:00
Martin v. Löwis 501b13c622 Issue #20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic.
Patch by Vajrasky Kok.
2014-07-27 14:20:23 +02:00
Victor Stinner 011428e168 (Merge 3.4) Fix repr(_socket.socket) on Windows 64-bit: don't fail with
OverflowError on closed socket. repr(socket.socket) already works fine.
2014-07-26 14:37:57 +02:00
Victor Stinner e254e53c83 Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. repr(socket.socket) already works fine.
2014-07-26 14:36:55 +02:00
Raymond Hettinger a22d8231a3 merge 2014-07-25 15:00:30 -07:00
Raymond Hettinger 5a2146a2fd Issue #22044: Fixed premature DECREF in call_tzinfo_method. 2014-07-25 14:59:48 -07:00
Nick Coghlan 973fe0ba7a Issue #18093: Factor out the programs that embed the runtime 2014-07-25 21:52:14 +10:00
Victor Stinner 1d8948e023 Backout 42ced0d023cd: oops, i didn't want to push this changeset :-/ 2014-07-24 22:51:05 +02:00
Victor Stinner 31f1a360b8 (Merge 3.4) Issue #19884, readline: calling rl_variable_bind
("enable-meta-key", "off") does crash on Mac OS X which uses libedit instead of
readline.
2014-07-24 22:11:55 +02:00
Victor Stinner 92639cce35 Issue #19884, readline: calling rl_variable_bind ("enable-meta-key", "off")
does crash on Mac OS X which uses libedit instead of readline.
2014-07-24 22:11:38 +02:00
Victor Stinner d18ccd19f0 tets 2014-07-24 21:58:53 +02:00
Victor Stinner 24ad98b98c (Merge 3.4) Issue #19884: readline: Disable the meta modifier key if stdout is
not a terminal to not write the ANSI sequence "\033[1034h" into stdout. This
sequence is used on some terminal (ex: TERM=xterm-256color") to enable support
of 8 bit characters.
2014-07-24 12:24:45 +02:00
Victor Stinner a3c80ce8b7 Issue #19884: readline: Disable the meta modifier key if stdout is not a
terminal to not write the ANSI sequence "\033[1034h" into stdout. This sequence
is used on some terminal (ex: TERM=xterm-256color") to enable support of 8 bit
characters.
2014-07-24 12:23:56 +02:00
Victor Stinner b6dab6bce8 Issue #22042: Avoid dangerous C cast in socket.setblocking()
Avoid cast from (int*) to (u_long*), even if sizeof(int) == sizeof(u_long).
2014-07-23 22:56:55 +02:00
Serhiy Storchaka e6d9805ec4 Issue #4350: Removed a number of out-of-dated and non-working for a long time
Tkinter methods.
2014-07-23 22:33:50 +03:00
Victor Stinner 0bffc94d57 Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a
ValueError on fstat() failure.
2014-07-21 16:28:54 +02:00
Victor Stinner 56e8c29a4e Issue #22018: Add _testcapi.raise_signal()
- Use _testcapi.raise_signal() in test_signal
- close also os.pipe() file descriptors in some test_signal tests where they
  were not closed properly
- Remove faulthandler._sigill() and faulthandler._sigbus(): reuse
  _testcapi.raise_signal() in test_faulthandler
2014-07-21 12:30:22 +02:00
Serhiy Storchaka 56ded52fa8 Call PyErr_NoMemory() when PyMem_Malloc() fails. 2014-07-14 12:20:49 +03:00
Serhiy Storchaka b1ebfdddb3 Call PyErr_NoMemory() when PyMem_Malloc() fails. 2014-07-14 12:20:15 +03:00
Victor Stinner b28ed92dd0 Issue #21932: os.read() now uses a :c:func:`Py_ssize_t` type instead of
:c:type:`int` for the size to support reading more than 2 GB at once. On
Windows, the size is truncted to INT_MAX. As any call to os.read(), the OS
may read less bytes than the number of requested bytes.
2014-07-11 17:04:41 +02:00
Antoine Pitrou de08cb60fd Fix compilation failure (followup to #21803) 2014-07-07 19:08:47 -04:00
Victor Stinner e03de09ff2 (Merge 3.4) Issue #21781, _ssl: Fix asn1obj2py() on Windows 64-bit, "s#" format
requires size to be a Py_ssize_t, not an int. _ssl.c is now "Py_ssize_t clean".
2014-07-07 21:52:49 +02:00
Victor Stinner cd75298611 Issue #21781, _ssl: Fix asn1obj2py() on Windows 64-bit, "s#" format requires
size to be a Py_ssize_t, not an int. _ssl.c is now "Py_ssize_t clean".
2014-07-07 21:52:29 +02:00
Benjamin Peterson 3032ed7cb1 upgrade to unicode 7.0.0 2014-07-06 13:04:20 -07:00
Benjamin Peterson e865128605 properly decref the return value of close() 2014-07-04 17:00:25 -07:00
Benjamin Peterson 4f654fbe30 properly decref the return value of close() 2014-07-04 17:00:25 -07:00
Victor Stinner 6680e9f5fd (Merge 3.4) Issue #21090: io.FileIO.readall() does not ignore I/O errors
anymore. Before, it ignored I/O errors if at least the first C call read()
succeed.
2014-07-02 23:00:38 +02:00
Victor Stinner e10920f0d1 Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
it ignored I/O errors if at least the first C call read() succeed.
2014-07-02 22:59:31 +02:00
Victor Stinner 7f341ca16e (Merge 3.4) Issue #8677: make the zlib module "ssize_t clean" for parsing
parameters
2014-07-01 16:48:42 +02:00
Victor Stinner f18f87111b Issue #8677: make the zlib module "ssize_t clean" for parsing parameters 2014-07-01 16:48:12 +02:00
Victor Stinner da8e6a2dff (Merge 3.4) Closes #21780: make the unicodedata module "ssize_t clean" for
parsing parameters
2014-07-01 16:46:12 +02:00
Victor Stinner 65a3144e54 Closes #21780: make the unicodedata module "ssize_t clean" for parsing parameters 2014-07-01 16:45:52 +02:00
Victor Stinner 7f084064e8 (Merge 3.4) Issue #21781: Make the ssl module "ssize_t clean" for parsing
parameters.  ssl.RAND_add() now supports strings longer than 2 GB.
2014-07-01 16:39:23 +02:00
Victor Stinner 2e57b4e488 Issue #21781: Make the ssl module "ssize_t clean" for parsing parameters.
ssl.RAND_add() now supports strings longer than 2 GB.
2014-07-01 16:37:17 +02:00
Victor Stinner 9f43505f3d (Merge 3.4) Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu
to format C size_t, because %zi/%u is not supported on all platforms.
2014-07-01 08:57:54 +02:00
Victor Stinner 293f3f526d Closes #21892, #21893: Use PY_FORMAT_SIZE_T instead of %zi or %zu to format C
size_t, because %zi/%u is not supported on all platforms.
2014-07-01 08:57:10 +02:00
Berker Peksag d9375f121e Fix typo in socket.getaddrinfo() docstring.
Reported by Krishna Kumar Thakur on docs@.
2014-06-30 11:30:00 +03:00
Berker Peksag a6ec5ee3c8 Fix typo in socket.getaddrinfo() docstring.
Reported by Krishna Kumar Thakur on docs@.
2014-06-30 11:28:40 +03:00
Antoine Pitrou de68722ca0 Issue #21679: Prevent extraneous fstat() calls during open(). Patch by Bohuslav Kabrda. 2014-06-29 20:07:28 -04:00
Antoine Pitrou 8477f7af13 Issue #21863: cProfile now displays the module name of C extension functions, in addition to their own name. 2014-06-27 23:49:29 -04:00
Victor Stinner 7722769b76 (Merge 3.4) Issue #21858: Better handling of Python exceptions in the sqlite3
module.
2014-06-26 23:33:34 +02:00
Victor Stinner 297d104248 Issue #21858: Better handling of Python exceptions in the sqlite3 module. 2014-06-26 23:32:00 +02:00
Raymond Hettinger ee205dc7d8 merge 2014-06-24 21:39:27 -07:00
Raymond Hettinger 97d3555029 Issue #19145: Fix handling of negative values for a "times" keyword argument to itertools.repeat()>
(Patch contributed by Vajrasky Kok.)
2014-06-24 21:36:58 -07:00
Benjamin Peterson a96fea03e8 add BufferedIOBase.readinto1 (closes #20578)
Patch by Nikolaus Rath.
2014-06-22 14:17:44 -07:00
Zachary Ware 63f277b694 Issue #21741: Add st_file_attributes to os.stat_result on Windows.
Patch by Ben Hoyt.
2014-06-19 09:46:37 -05:00
Victor Stinner 7d7e7756d9 Issue #10310: Use "unsigned int field:1" instead of "signed int field:1" in a
private structure of the _io module to fix a compiler warning (overflow when
assigning the value 1). Fix also a cast in
incrementalnewlinedecoder_setstate().  Patch written by Hallvard B Furuseth.
2014-06-17 23:31:25 +02:00
Raymond Hettinger 48f68d00b8 Factor common code into internal functions.
Clean-up names of static functions.
Use Py_RETURN_NONE macro.
Expose private functions needed to support merge().
Move C imports to the bottom of the Python file.
2014-06-14 16:43:35 -07:00
Serhiy Storchaka ec87a13e5d PyErr_NormalizeException doesn't like being called with an exception set
(issues #21677, #21310).
2014-06-11 07:19:39 +03:00
Serhiy Storchaka 76d3f14e01 PyErr_NormalizeException doesn't like being called with an exception set
(issues #21677, #21310).
2014-06-11 07:18:53 +03:00
Serhiy Storchaka 3a56117a60 Issue #21310: Fixed possible resource leak in failed open(). 2014-06-09 13:35:43 +03:00
Serhiy Storchaka f10063e3c3 Issue #21310: Fixed possible resource leak in failed open(). 2014-06-09 13:32:34 +03:00
Serhiy Storchaka 85e4235c0e Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods. 2014-06-09 09:15:42 +03:00
Serhiy Storchaka 8a8f7f9830 Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods. 2014-06-09 09:13:04 +03:00
Benjamin Peterson 4fb01ffe66 backout 0fb7789b5eeb for test breakage (#20578) 2014-06-07 23:18:12 -07:00
Benjamin Peterson 10e847bbc7 add BufferedIOBase.readinto1 (closes #20578)
Patch by Nikolaus Rath.
2014-06-07 20:06:48 -07:00
Victor Stinner ef7f140366 All modern compilers provide a offsetof() function
offsetof() is used directly in many other .c files without any issue.
2014-06-03 18:45:05 +02:00
Victor Stinner d8f0d922d5 Issue #21233: Rename the C structure "PyMemAllocator" to "PyMemAllocatorEx" to
make sure that the code using it will be adapted for the new "calloc" field
(instead of crashing).
2014-06-02 21:57:10 +02:00
Victor Stinner aa0e7afa43 Issue #21639: Fix a division by zero in tracemalloc on calloc(0, 0). The
regression was introduced recently with the introduction of the new "calloc"
functions (PyMem_RawCalloc, PyMem_Calloc, PyObject_Calloc).

Add also a unit test to check for the non-regression.
2014-06-02 21:40:22 +02:00
Victor Stinner 38d65dff7c (Merge 3.4) Issue #21639: Fix name of _testcapi test functions 2014-06-02 21:29:28 +02:00
Victor Stinner 797bcb51d0 Issue #21639: Fix name of _testcapi test functions 2014-06-02 21:29:07 +02:00
Ned Deily 8f794eef9b Issue #17095: Fix Modules/Setup *shared* support.
Original patch by Thomas Wouters.
2014-06-02 01:15:32 -07:00
Ned Deily b166191886 Issue #17095: Fix Modules/Setup *shared* support.
Original patch by Thomas Wouters.
2014-06-02 01:05:29 -07:00
Gregory P. Smith 45f31d1492 merge the end_fd comment fix and explicit wait() for the child. 2014-06-01 13:47:34 -07:00
Gregory P. Smith a26987a0a5 Fix the comment to not refer to the removed end_fd parameter. 2014-06-01 13:46:36 -07:00
Gregory P. Smith 3fe9e8d5a5 Don't restrict ourselves to a "max" fd when closing fds before exec()
when we have a way to get an actual list of all open fds from the OS.

Fixes issue #21618: The subprocess module would ignore fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow.  On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
2014-06-01 13:22:12 -07:00
Gregory P. Smith d4dcb70287 Don't restrict ourselves to a "max" fd when closing fds before exec()
when we have a way to get an actual list of all open fds from the OS.

Fixes issue #21618: The subprocess module would ignore fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow.  On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
2014-06-01 13:18:28 -07:00
Serhiy Storchaka 1753d2255e Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
2014-05-30 14:25:22 +03:00
Serhiy Storchaka 79851d755b Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
2014-05-30 14:24:03 +03:00
Serhiy Storchaka 9e7cbda1ef Issue #3015: _tkinter.create() now creates tkapp object with wantobject=1 by
default.
2014-05-28 16:57:55 +03:00
Serhiy Storchaka 3fc6d80fb1 Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr
it supports reverse() and negative indices.  Original patch by Claudiu Popa.
2014-05-28 13:00:59 +03:00
Serhiy Storchaka 47a981337a Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr
it supports reverse() and negative indices.  Original patch by Claudiu Popa.
2014-05-28 12:58:34 +03:00
Raymond Hettinger 62f4dad816 Issue 21137: Better repr for threading.Lock() 2014-05-25 18:22:35 -07:00
Antoine Pitrou ded3c1b837 Cleanup other stats formatting code in gcmodule.c 2014-05-24 19:24:40 +02:00
Antoine Pitrou 40f6b121c5 Issue #21555: simplify code in gcmodule.c by using the pytime.h functions instead of trying to call time.time() via the C API.
Patch by Geoffrey Spear.
2014-05-24 19:21:53 +02:00
Charles-François Natali 644b8f52a8 Issue #21455: Add a default backlog to socket.listen(). 2014-05-22 19:45:39 +01:00
Serhiy Storchaka 2b00c4999d Issue #21525: Most Tkinter methods which accepted tuples now accept lists too. 2014-05-21 17:12:21 +03:00
Raymond Hettinger 507d997714 Add comment and make minor code clean-up to improve clarity. 2014-05-18 21:32:40 +01:00
Benjamin Peterson da89123bd6 merge 3.4 (#10744) 2014-05-17 15:07:34 -07:00
Benjamin Peterson 5eb6b39210 support pep 3118 format strings for ctypes objects with nontrivial shapes (closes #10744)
Patch by Matti Picus.
2014-05-17 14:59:12 -07:00
Serhiy Storchaka 2e03a0a8a7 Issue #20998: Fixed re.fullmatch() of repeated single character pattern
with ignore case.  Original patch by Matthew Barnett.
2014-05-14 21:51:37 +03:00
Serhiy Storchaka 429b59ec69 Issue #20998: Fixed re.fullmatch() of repeated single character pattern
with ignore case.  Original patch by Matthew Barnett.
2014-05-14 21:48:17 +03:00
Victor Stinner 45e8e2f218 Issue #21490: Add new C macros: Py_ABS() and Py_STRINGIFY()
Keep _Py_STRINGIZE() in PC/pyconfig.h to not introduce a dependency between
pyconfig.h and pymacros.h.
2014-05-14 17:24:35 +02:00
Victor Stinner 79b49ab553 (Merge 3.4) Issue #21497: faulthandler functions now raise a better error if
sys.stderr is None: RuntimeError("sys.stderr is None") instead of
AttributeError("'NoneType' object has no attribute 'fileno'").
2014-05-14 17:16:58 +02:00
Victor Stinner e2d66903e8 Issue #21497: faulthandler functions now raise a better error if sys.stderr is
None: RuntimeError("sys.stderr is None") instead of AttributeError("'NoneType'
object has no attribute 'fileno'").
2014-05-14 17:15:50 +02:00
Victor Stinner a57dfd033c Issue #21488: Add support of keyword arguments for codecs.encode and codecs.decode 2014-05-14 17:13:14 +02:00
Victor Stinner e1e04ad8aa Backed out changeset 6ceedbd88b5f 2014-05-14 17:12:27 +02:00
Victor Stinner b78c448f4b Issue #21488: Add support of keyword arguments for codecs.encode and codecs.decode 2014-05-14 17:10:45 +02:00
Benjamin Peterson 89aea5075e merge 3.4 2014-05-11 16:17:34 -07:00
Benjamin Peterson 23a192d963 use logical rather than bit and 2014-05-11 16:17:02 -07:00
Raymond Hettinger 234fb2d503 Issue 21424: Apply the nlargest() optimizations to nsmallest() as well. 2014-05-11 14:21:23 -07:00
Raymond Hettinger 277842eff1 Issue #21424: Optimize heaqp.nlargest() to make fewer tuple comparisons.
Consolidates the logic for nlargest() into a single function so that
decoration tuples (elem,order) or (key, order, elem) only need to
be formed when a new element is added to the heap.  Formerly, a tuple
was created for every element regardless of whether it was added to
the heap.

The change reduces the number of tuples created, the number of ordering
integers created, and total number of tuple comparisons.
2014-05-11 01:55:46 -07:00
Tim Peters 983c1065fe Merge from 3.4.
Issue #21435: Segfault in gc with cyclic trash
Changed the iteration logic in finalize_garbage() to tolerate objects vanishing
from the list as a side effect of executing a finalizer.
2014-05-08 17:43:25 -05:00
Tim Peters 5fbc7b12f7 Issue #21435: Segfault in gc with cyclic trash
Changed the iteration logic in finalize_garbage() to tolerate objects vanishing
from the list as a side effect of executing a finalizer.
2014-05-08 17:42:19 -05:00
Antoine Pitrou 38ca5a7b6d Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a flush() on the underlying binary stream.
Patch by akira.
2014-05-09 00:31:32 +02:00
Antoine Pitrou c644e7c39f Issue #21396: Fix TextIOWrapper(..., write_through=True) to not force a flush() on the underlying binary stream.
Patch by akira.
2014-05-09 00:24:50 +02:00
Tim Golden 0321cf2550 Issue18314 Allow unlink to remove junctions. Includes support for creating junctions. Patch by Kim Gräsman 2014-05-05 19:46:17 +01:00
Larry Hastings f19a400714 Issue #21088: Merge from 3.4. 2014-05-04 04:45:57 -07:00
Larry Hastings 9147a9697a Issue #21088: Bugfix for curses.window.addch() regression in 3.4.0.
In porting to Argument Clinic, the first two arguments were reversed.
2014-05-04 04:41:18 -07:00
Raymond Hettinger 90e9338383 Neaten-up a bit add add missing size change check. 2014-05-03 18:45:54 -07:00
Raymond Hettinger 871620d951 Simplify and speedup the internals of the heapq module. 2014-05-03 18:36:48 -07:00
Raymond Hettinger 4b0b1accb5 Issue #21101: Eliminate double hashing in the C code for collections.Counter(). 2014-05-03 16:41:19 -07:00
Raymond Hettinger 1b5eebcfa3 merge 2014-05-03 15:26:17 -07:00
Raymond Hettinger c9926088dd Issue 21375: Fix possible Py_ssizet overflow in heapq. 2014-05-03 15:22:07 -07:00
Victor Stinner db067af12a Issue #21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),
PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) and bytearray(int) are now
using ``calloc()`` instead of ``malloc()`` for large objects which is faster
and use less memory (until the bytearray buffer is filled with data).
2014-05-02 22:31:14 +02:00
Stefan Krah 6b7786bac2 Use $type instead of $cls in the signature specification. 2014-05-02 14:34:11 +02:00
Stefan Krah 5de1f82464 Issue #21407: _decimal now supports function signatures. 2014-05-01 15:53:42 +02:00
Stefan Krah 8fb74a35da Issue #21374: Fix pickling of DecimalTuple. 2014-04-29 18:24:50 +02:00
Stefan Krah f1d4e42195 Issue #21374: Fix pickling of DecimalTuple. 2014-04-29 18:23:35 +02:00
Antoine Pitrou 32497f89bb Issue #21321: itertools.islice() now releases the reference to the source iterator when the slice is exhausted.
Patch by Anton Afanasyev.
2014-04-29 12:14:47 +02:00
Antoine Pitrou 26f82efe59 Issue #21321: itertools.islice() now releases the reference to the source iterator when the slice is exhausted.
Patch by Anton Afanasyev.
2014-04-29 12:13:46 +02:00
Antoine Pitrou b8503896ad Issue #21057: TextIOWrapper now allows the underlying binary stream's read() or read1() method to return an arbitrary bytes-like object (such as a memoryview).
Patch by Nikolaus Rath.
2014-04-29 10:14:02 +02:00
Antoine Pitrou 6999441d62 Issue #20355: -W command line options now have higher priority than the PYTHONWARNINGS environment variable. Patch by Arfrever. 2014-04-29 00:56:08 +02:00
Tim Golden fbf963c064 Backed out changeset: 17df50df62c7 2014-04-27 18:35:36 +01:00