Commit Graph

7685 Commits

Author SHA1 Message Date
Antoine Pitrou e93b63b74b Issue #18876: The FileIO.mode attribute now better reflects the actual mode under which the file was opened.
Patch by Erik Bray.
2013-09-04 20:46:33 +02:00
Tim Peters c6171e49ab Merge 3.3 into default.
cwr_next():  move invariants out of loops.

This simplifies and clarifies the code, and gives a small speedup.
2013-09-03 11:52:59 -05:00
Tim Peters 9edb168dd7 cwr_next(): move invariants out of loops.
This simplifies and clarifies the code, and gives a small speedup.
2013-09-03 11:49:31 -05:00
Eli Bendersky 207fe01187 Issue #18912: Fix indentation in docstring
Contributed by Jeroen Van Goey
2013-09-03 06:38:55 -07:00
Eli Bendersky c554f725a0 Issue #18912: Fix indentation in docstring
Contributed by Jeroen Van Goey
2013-09-03 06:37:19 -07:00
Charles-François Natali 24aa041731 Use INADDR_BROADCAST instead of hard-coded value (it's part of POSIX and
already appears without #ifdef a couple lines above).
2013-08-31 14:48:25 +02:00
Victor Stinner d72fe89b80 select.epoll.fromfd(fd) must be not change the inheritable flag of the file
descriptor
2013-08-28 12:22:39 +02:00
Victor Stinner 1fa174a418 Get rid of signed/unsigned comparaison in _sre.c
Fix compilation warnings on Windows (Visual C++) like: "_sre.c(3121): warning
C4018: '>' : signed/unsigned mismatch".

_validate_outer() ensures that groups >= 0, so _validate_inner() can cast
groups to size_t.
2013-08-28 02:06:21 +02:00
Victor Stinner 36a5a062dc _datetimemodule.c: fix the compilation warning "conversion from 'double' to
'long', possible loss of data" in delta_new(), use an explicit cast from double
to long
2013-08-28 01:53:39 +02:00
Victor Stinner b9981ba680 fix a compilation warning in posix_openpty() on "PPC64 AIX 3.x" buildbot 2013-08-28 01:51:06 +02:00
Victor Stinner 340f712b84 (Merge 3.3) Fix compilation of the _sqlite module if threads are disabled 2013-08-28 01:45:39 +02:00
Victor Stinner b84fc0fd9f Fix compilation of the _sqlite module if threads are disabled 2013-08-28 01:44:42 +02:00
Victor Stinner daf455554b Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
2013-08-28 00:53:59 +02:00
Serhiy Storchaka 46e1ce214b Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2013-08-27 20:17:03 +03:00
Serhiy Storchaka 9594942716 Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2013-08-27 19:40:23 +03:00
Victor Stinner 14e461d5b9 Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
2013-08-26 22:28:21 +02:00
Ezio Melotti d640fe2af5 #18803: merge with 3.3. 2013-08-26 01:33:30 +03:00
Ezio Melotti 7c4a7e6f3c #18803: fix more typos. Patch by Févry Thibault. 2013-08-26 01:32:56 +03:00
Charles-François Natali a439b32cf0 Merge. 2013-08-25 18:28:44 +02:00
Charles-François Natali c20a7b977e Merge. 2013-08-25 18:27:59 +02:00
Charles-François Natali 249cdc39fc Issue #18763: subprocess: The file descriptors are now closed after calling the
preexec_fn callback, which may open file descriptors.
2013-08-25 18:24:45 +02:00
Christian Heimes 9dd279a3ac Issue #11973: Fix a problem in kevent. The flags and fflags fields are now
properly handled as unsigned.
2013-08-25 14:57:38 +02:00
Christian Heimes f1fe159822 Issue #11973: Fix a problem in kevent. The flags and fflags fields are now
properly handled as unsigned.
2013-08-25 14:57:00 +02:00
Christian Heimes cfa47962c2 Issue #18747: Fix spelling errors in my commit message and comments,
thanks to Vajrasky Kok for proof-reading.
2013-08-25 14:19:29 +02:00
Christian Heimes 61636e7105 Issue #18747: Fix spelling errors in my commit message and comments,
thanks to Vajrasky Kok for proof-reading.
2013-08-25 14:19:16 +02:00
Richard Oudkerk cabbde9e1e Fix compiler warning on Windows. 2013-08-24 23:46:27 +01:00
Eli Bendersky 6eb50b1f5b Use consistent style for else if / else 2013-08-24 15:17:08 -07:00
Benjamin Peterson 3a7dffa4ce remove support for compiling on systems without getcwd()
Do we need a fallback implementation of getcwd() from 1991 that claims to
support "really old Unix systems"? I don't think so.
2013-08-23 21:01:48 -05:00
Serhiy Storchaka 254954aacd Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj
argument.

This is needed for support Tcl/Tk 8.6.
2013-08-22 17:42:05 +03:00
Serhiy Storchaka 203eb317d2 Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj
argument.

This is needed for support Tcl/Tk 8.6.
2013-08-22 17:40:31 +03:00
Richard Oudkerk a93bf7b9a6 Fix devpoll_dealloc(). 2013-08-22 14:03:44 +01:00
Richard Oudkerk 168d59b669 Move definition of devpoll_internal_close() before devpoll_close(). 2013-08-22 13:31:15 +01:00
Richard Oudkerk 069d65c35a Fix compilation of select module on Solaris. 2013-08-22 13:04:23 +01:00
Christian Heimes f54c24628b Issue #18747: Use a parent atfork handler instead of a child atfork handler.
fork() is suppose to be async-signal safe but the handler calls unsafe functions. A parent handler mitigates the issue.
2013-08-22 13:19:56 +02:00
Christian Heimes 80c5de93f9 Issue #18747: Use a parent atfork handler instead of a child atfork handler.
fork() is suppose to be async-signal safe but the handler calls unsafe functions. A parent handler mitigates the issue.
2013-08-22 13:19:48 +02:00
Victor Stinner 13423c3726 Close #18794: Add a fileno() method and a closed attribute to select.devpoll
objects.

Add also tests on fileno() method and closed attribute of select.epoll and select.kqueue.
2013-08-22 00:19:50 +02:00
Serhiy Storchaka 4e4088d273 Issue #17119: Fixed integer overflows when processing large strings and tuples
in the tkinter module.
2013-08-21 21:43:08 +03:00
Serhiy Storchaka 9e6b97502f Issue #17119: Fixed integer overflows when processing large strings and tuples
in the tkinter module.
2013-08-21 21:38:21 +03:00
Christian Heimes 6acbe2aaa3 Issue #18747: Re-seed OpenSSL's pseudo-random number generator after fork.
A pthread_atfork() child handler is used to seeded the PRNG with pid, time
and some stack data.
2013-08-21 13:26:34 +02:00
Christian Heimes f77b4b20e9 Issue #18747: Re-seed OpenSSL's pseudo-random number generator after fork.
A pthread_atfork() child handler is used to seeded the PRNG with pid, time
and some stack data.
2013-08-21 13:26:05 +02:00
Serhiy Storchaka 5617df1be6 Issue #8865: Concurrent invocation of select.poll.poll() now raises a
RuntimeError exception.  Patch by Christian Schubert.
2013-08-20 20:50:32 +03:00
Serhiy Storchaka b1973c252c Issue #8865: Concurrent invocation of select.poll.poll() now raises a
RuntimeError exception.  Patch by Christian Schubert.
2013-08-20 20:38:21 +03:00
Serhiy Storchaka edd0de58a8 Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit platforms.
Patch by Yogesh Chaudhari.
2013-08-20 20:07:50 +03:00
Serhiy Storchaka ec67d187ee Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit platforms.
Patch by Yogesh Chaudhari.
2013-08-20 20:04:47 +03:00
Christian Heimes 85532eb212 Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
OpenSSL 1.0.0+ instead of the deprecated CRYPTO id callback function.
2013-08-19 17:36:39 +02:00
Christian Heimes 4d98ca9ff6 Issue #18777: The ssl module now uses the new CRYPTO_THREADID API of
OpenSSL 1.0.0+ instead of the deprecated CRYPTO id callback function.
2013-08-19 17:36:29 +02:00
Christian Heimes 44ed3de6f4 Issue #18774: Remove last bits of GNU PTH thread code, patch by Vajrasky Kok. 2013-08-18 12:43:24 +02:00
Antoine Pitrou 6f6ec37838 Issue #16105: When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, report an exception instead of ignoring the error. 2013-08-17 20:27:56 +02:00
Christian Heimes f920a1c1f1 Issue 18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok. 2013-08-17 17:25:27 +02:00
Christian Heimes 3c2593b2bb Issue 18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok. 2013-08-17 17:25:18 +02:00
Christian Heimes 9b5907cbd5 Issue #18768: coding style nitpick. Thanks to Vajrasky Kok 2013-08-17 17:19:03 +02:00
Christian Heimes 474afdda60 Issue #18768: coding style nitpick. Thanks to Vajrasky Kok 2013-08-17 17:18:56 +02:00
Ezio Melotti a7e7497d88 #18466: merge with 3.3. 2013-08-17 16:58:13 +03:00
Ezio Melotti 85a8629d21 #18466: fix more typos. Patch by Févry Thibault. 2013-08-17 16:57:41 +03:00
Christian Heimes 1d8e7dbf1a Issue #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke malloc weak symbols. 2013-08-17 15:02:05 +02:00
Christian Heimes 9ff79f7c46 Issue #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke malloc weak symbols. 2013-08-17 15:01:54 +02:00
Christian Heimes e06d47c70c Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
inside subjectAltName correctly. Formerly the module has used OpenSSL's
GENERAL_NAME_print() function to get the string represention of ASN.1
strings for rfc822Name (email), dNSName (DNS) and
uniformResourceIdentifier (URI).
2013-08-17 00:58:00 +02:00
Christian Heimes 824f7f366d Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
inside subjectAltName correctly. Formerly the module has used OpenSSL's
GENERAL_NAME_print() function to get the string represention of ASN.1
strings for rfc822Name (email), dNSName (DNS) and
uniformResourceIdentifier (URI).
2013-08-17 00:54:47 +02:00
Serhiy Storchaka cbad3a367e Issue #18701: Remove sqlitecompat.h. 2013-08-17 01:01:23 +03:00
Serhiy Storchaka 8fa8ee3970 Issue #18701: Remove support of old CPython versions (<3.0) from C code. 2013-08-17 00:48:02 +03:00
Christian Heimes 177b3f9982 Issue #18673: Add O_TMPFILE to os module. O_TMPFILE requires Linux kernel
3.11 or newer. It's only defined on system with 3.11 uapi headers, too.
2013-08-16 14:35:09 +02:00
Antoine Pitrou c69c9bc24b Replace an overly optimistic assert() in _PyGC_CollectNoFail with a simple guard. 2013-08-15 20:15:15 +02:00
Christian Heimes 37d5cebb48 Change the builtin hash algorithms' names to lower case names
as promised by hashlib's documentation.
2013-08-15 18:31:48 +02:00
Richard Oudkerk 84ed9a68bd Issue #8713: Support alternative start methods in multiprocessing on Unix.
See http://hg.python.org/sandbox/sbt#spawn
2013-08-14 15:35:41 +01:00
Antoine Pitrou 9ed5f27266 Issue #18722: Remove uses of the "register" keyword in C code. 2013-08-13 20:18:52 +02:00
Larry Hastings e70f2d588a Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions. 2013-08-12 13:53:20 -04:00
Larry Hastings 00964ed216 Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions. 2013-08-12 13:49:30 -04:00
Antoine Pitrou 584e815114 Fix refcounting issue with extension types in tkinter.
(issue #15721)
2013-08-11 00:22:30 +02:00
Ethan Furman a4998a7041 Close #18264: int- and float-derived enums now converted to int or float. 2013-08-10 13:01:45 -07:00
Eli Bendersky 532d03e547 Issue #15651: PEP 3121 refactoring for _elementtree
Patch by Antoine Pitrou (based on Robin Schreiber's original patch)
2013-08-10 08:00:39 -07:00
Christian Heimes ad73a9cf97 Issue #16400: Add command line option for isolated mode.
-I

    Run Python in isolated mode. This also implies -E and -s. In isolated mode
    sys.path contains neither the script’s directory nor the user’s
    site-packages directory. All PYTHON* environment variables are ignored,
    too. Further restrictions may be imposed to prevent the user from
    injecting malicious code.
2013-08-10 16:36:18 +02:00
Larry Hastings a27b83ad2d Issue #15301: Parsing fd, uid, and gid parameters for builtins
in Modules/posixmodule.c is now far more robust.
2013-08-08 00:19:50 -07:00
Antoine Pitrou 257cf2fb83 In _PyGC_Fini(), lose the reference that was kept to the time module 2013-08-06 20:50:48 +02:00
Antoine Pitrou c53204b947 Issue #4885: Add weakref support to mmap objects. Patch by Valerie Lambert. 2013-08-05 23:17:30 +02:00
Mark Dickinson e5192cdbb9 Issue #18661: typo in grp.struct_group docstring (fix merged from 3.3). Thanks Vajrasky Kok. 2013-08-05 17:57:54 +01:00
Mark Dickinson fb29a164df Issue #18661: typo in grp.struct_group docstring. Thanks Vajrasky Kok. 2013-08-05 17:57:01 +01:00
Raymond Hettinger d7bd7a5525 Silence compiler warnings for strict function prototype declarations. 2013-08-04 12:43:37 -07:00
Raymond Hettinger 28dc9b9fc0 merge 2013-08-04 12:43:59 -07:00
Alexander Belopolsky df7027bb9e Reuse us_per_second in delta_total_seconds. 2013-08-04 15:18:58 -04:00
Alexander Belopolsky 790d269d39 Fixes #8860: Round half-microseconds to even in the timedelta constructor.
(Original patch by Mark Dickinson.)
2013-08-04 14:51:35 -04:00
Serhiy Storchaka b94f61b6fb Issue #17998: Fix an internal error in regular expression engine. 2013-08-03 19:22:28 +03:00
Serhiy Storchaka 1f35ae0a3c Issue #17998: Fix an internal error in regular expression engine. 2013-08-03 19:18:38 +03:00
Christian Heimes 865d12a2d9 Fix warning: ‘ptr2’ may be used uninitialized in this function 2013-08-02 11:10:51 +02:00
Ned Deily 970a87fc07 Closes #18627: merge from 3.3 2013-08-01 22:13:30 -07:00
Ned Deily bd143c3760 Issue #18627: Fix typo noticed by Vajrasky Kok. 2013-08-01 22:12:29 -07:00
Ned Deily ffb32893a3 Issue #17557: merge from 3.3 2013-08-01 21:37:17 -07:00
Ned Deily b5dd6d2287 Issue #17557: Fix os.getgroups() to work with the modified behavior of
getgroups(2) on OS X 10.8.  Original patch by Mateusz Lenik.
2013-08-01 21:21:15 -07:00
Larry Hastings 2e3e593e34 Issue #17899: Fix rare file descriptor leak in os.listdir().
(Done as separate patch from trunk as the code has diverged quite a bit.)
2013-08-01 19:34:46 -07:00
Larry Hastings 4dbc95e258 Issue #17899: Fix rare file descriptor leak in os.listdir(). 2013-08-01 18:18:56 -07:00
Victor Stinner ffff763161 Issue #18519: Fix test_sqlite on old versions of libsqlite3
With old SQLite versions, _sqlite3_result_error() sets a new Python exception,
so don't restore the previous exception.
2013-08-02 01:48:10 +02:00
Victor Stinner 044c516854 Issue #18609, #18408: _ctypes_add_traceback() now clears the current exception
while adding the traceback, because it may call indirectly a Python function
and Python functions must not be called with an exception set.

In the case of the issue #18609, _ctypes_add_traceback() called the iso8859-1
decoder which is implemented in Python. Python has a ISO-8859-1 codec
implemented in C. It is not used because PyUnicode_Decode() only uses the C
codec for other names (aliases) of this codec ("latin-1", "latin1" and
"iso-8859-1").
2013-08-02 00:47:47 +02:00
Antoine Pitrou 932ff83682 Issue #18608: Avoid keeping a strong reference to the locale module inside the _io module. 2013-08-01 21:04:50 +02:00
Antoine Pitrou 2d350fd8af Issue #18619: Fix atexit leaking callbacks registered from sub-interpreters, and make it GC-aware. 2013-08-01 20:56:12 +02:00
Tim Golden 6b528067c5 Issue #9035: os.path.ismount now recognises volumes mounted below
a drive root on Windows. Original patch by Atsuo Ishimoto.
2013-08-01 12:44:00 +01:00
Christian Heimes abe639f115 Initialize utime with 0. It fixes a couple of compiler warnung:
warning: 'utime.mtime_ns' may be used uninitialized in this function [-Wmaybe-uninitialized]
2013-08-01 00:12:06 +02:00
Christian Heimes b3c872403d Initialize utime with 0. It fixes a couple of compiler warnung:
warning: 'utime.mtime_ns' may be used uninitialized in this function [-Wmaybe-uninitialized]
2013-08-01 00:08:16 +02:00
Antoine Pitrou c27cd71cd7 Merge 2013-07-31 21:54:18 +02:00
Antoine Pitrou 5c30a75722 Issue #15699: The readline module now uses PEP 3121-style module initialization, so as to reclaim allocated resources (Python callbacks) at shutdown.
Original patch by Robin Schreiber.
2013-07-31 21:52:53 +02:00
Christian Heimes 0ce642ebca yet another WITH_THREADS typo 2013-07-31 13:32:40 +02:00
Christian Heimes 6ffa5ce1f3 Fix _sha3 module to actually release the GIL around its update function.
gcov is great.
2013-07-31 11:58:18 +02:00