Commit Graph

6234 Commits

Author SHA1 Message Date
Benjamin Peterson 388c0e2325 merge heads 2011-09-06 07:57:38 -04:00
Benjamin Peterson 6d8f744730 merge 3.2 (#1616) 2011-09-06 07:56:47 -04:00
Benjamin Peterson f22913b8c3 cast to getter 2011-09-06 07:55:34 -04:00
Victor Stinner 71e44cb97f Issue #12567: Add curses.unget_wch() function
Push a character so the next get_wch() will return it.
2011-09-06 01:53:03 +02:00
Benjamin Peterson 9fd5374d4e merge 3.2 (#12878) 2011-09-03 09:32:24 -04:00
Benjamin Peterson f6f3a35447 add a __dict__ descr for IOBase (closes #12878) 2011-09-03 09:26:20 -04:00
Amaury Forgeot d'Arc 842d921a79 ctypes: Slightly better error message when a struct field name is not a string. 2011-09-02 23:07:54 +02:00
Amaury Forgeot d'Arc 9b20e27c01 Merge from 3.2: Issue #12764: Fix a crash in ctypes when the name of a
Structure field is not a string.
2011-09-02 20:43:59 +02:00
Amaury Forgeot d'Arc 02dd539dbb Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
a string.
2011-09-02 20:39:40 +02:00
Benjamin Peterson 799bd80d8a expose linux extended file system attributes (closes #12720) 2011-08-31 22:15:17 -04:00
Amaury Forgeot d'Arc dd2f8b0b77 Merge from 3.2:
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to file.write()
- Issue #11241: subclasses of ctypes.Array can now be subclassed.
2011-08-30 22:07:20 +02:00
Amaury Forgeot d'Arc faecc38809 Issue #11241: subclasses of ctypes.Array can now be subclassed. 2011-08-30 22:02:51 +02:00
Amaury Forgeot d'Arc 326e189410 Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
2011-08-30 21:40:20 +02:00
Antoine Pitrou a514eb95f3 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:28:40 +02:00
Antoine Pitrou 55549ec476 Issue #12847: Fix a crash with negative PUT and LONG_BINPUT arguments in
the C pickle implementation.
2011-08-30 00:27:10 +02:00
Antoine Pitrou ee763e2acc Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:14:53 +02:00
Antoine Pitrou 82be19f889 Issue #11564: Avoid crashes when trying to pickle huge objects or containers
(more than 2**31 items).  Instead, in most cases, an OverflowError is raised.
2011-08-29 23:09:33 +02:00
Charles-François Natali 466517df0e Issue #12837: POSIX.1-2008 allows socklen_t to be a signed integer: re-enable
the check against negative values, and add a note on this surprising test.
Patch by David Watson.
2011-08-28 18:23:43 +02:00
Charles-François Natali ac7e9e058d Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
2011-08-28 18:10:27 +02:00
Charles-François Natali aa26b27503 Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
2011-08-28 17:51:43 +02:00
Nadeem Vawda 44c6ef50af Merge: #12839: Fix crash in zlib module due to version mismatch.
If the version of zlib used to compile the zlib module is incompatible
with the one that is actually linked in, then calls into zlib will fail.
This can leave attributes of the z_stream uninitialized, so we must take
care to avoid segfaulting by trying to use an invalid pointer.

Fix by Richard M. Tew.
2011-08-28 11:29:35 +02:00
Nadeem Vawda 524148ad7a Issue #12839: Fix crash in zlib module due to version mismatch.
If the version of zlib used to compile the zlib module is incompatible
with the one that is actually linked in, then calls into zlib will fail.
This can leave attributes of the z_stream uninitialized, so we must take
care to avoid segfaulting by trying to use an invalid pointer.

Fix by Richard M. Tew.
2011-08-28 11:26:46 +02:00
Antoine Pitrou 4fd1e6a3ba Issue #12803: SSLContext.load_cert_chain() now accepts a password argument
to be used if the private key is encrypted.  Patch by Adam Simpkins.
2011-08-25 14:39:44 +02:00
Charles-François Natali e9e95ae93d sock_sendmsg/sock_recvmsg: Use {0} to 0-initialize aggregate types with
automatic storage class.
2011-08-24 21:40:53 +02:00
Charles-François Natali b09f25e9a3 Issue12810: Remove check for negative unsigned value in socketmodule.c. Patch
by Joel Stanley.
2011-08-24 20:07:54 +02:00
Antoine Pitrou 162fee109b Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
2011-08-23 19:48:34 +02:00
Antoine Pitrou bcb39d4846 Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
2011-08-23 19:46:22 +02:00
Victor Stinner 710d27e93a Close #12826: fix socketmodule.c for OpenBSD, include sys/uio.h
Patch written by Remi Pointel.
2011-08-23 10:57:32 +02:00
Nick Coghlan 4ecf6cfc20 Attempt to address Windows buildbot failures 2011-08-22 15:45:19 +10:00
Nick Coghlan 96fe56abec Add support for the send/recvmsg API to the socket module. Patch by David Watson and Heiko Wundram. (Closes #6560) 2011-08-22 11:55:57 +10:00
Antoine Pitrou e8bb1a0229 Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:52:04 +02:00
Antoine Pitrou e05565ec5a Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on BufferedRandom streams.
2011-08-20 14:39:23 +02:00
Antoine Pitrou 18bb330203 Fix compilation under Windows 2011-08-20 03:19:34 +02:00
Antoine Pitrou df7fc9dda7 Issue #12778: Reduce memory consumption when JSON-encoding a large container of many small objects. 2011-08-19 18:03:14 +02:00
Ezio Melotti 7ec7fc4c3b #12725: merge with 3.2. 2011-08-14 08:29:49 +03:00
Ezio Melotti 388c945e97 #12725: fix working. Patch by Ben Hayden. 2011-08-14 08:28:57 +03:00
Antoine Pitrou e58bffb8ae Followup to 8e824e09924a: fix regression on 32-bit builds 2011-08-13 20:40:32 +02:00
Antoine Pitrou 3c7e928098 Issue #12744: Fix inefficient representation of integers
between 2**31 and 2**63 on systems with a 64-bit C "long".
2011-08-13 20:15:19 +02:00
Nadeem Vawda 3bf71c54d8 Fix incorrect comment in zlib.Decompress.flush().
Reported by Oleg Oshmyan in issue #12646.
2011-08-13 15:42:50 +02:00
Nadeem Vawda 1c38546e49 Issue #12646: Add an 'eof' attribute to zlib.Decompress.
This will make it easier to detect truncated input streams.

Also, make zlib's error messages more consistent.
2011-08-13 15:22:40 +02:00
Antoine Pitrou fdf4a27422 Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:15:53 +02:00
Antoine Pitrou f6c7a8595e Issue #12687: Fix a possible buffering bug when unpickling text mode (protocol 0, mostly) pickles. 2011-08-11 21:04:02 +02:00
Brian Curtin dfc80e3d97 Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
2011-08-10 20:28:54 -05:00
Benjamin Peterson a17a5d67b4 typo 2011-08-09 16:49:13 -05:00
Benjamin Peterson 087a2a951c merge 3.2 2011-08-04 11:09:57 -05:00
Benjamin Peterson fc9bbd1692 dosmodule is, thankfully, no more 2011-08-04 11:07:42 -05:00
Benjamin Peterson 7ac9214e43 fix arg strings 2011-08-03 08:54:26 -05:00
Benjamin Peterson 4e36d5ae88 need NULL sentinel 2011-08-02 19:56:11 -05:00
Benjamin Peterson bad9c2f13a avoid warning when SchedParamType is not used 2011-08-02 18:42:14 -05:00
Benjamin Peterson e3298dda6d only add sched_param if it is initialized 2011-08-02 18:40:46 -05:00
Benjamin Peterson 8f7bdd3208 I have been spoiled by chained comparisons in python 2011-08-02 18:34:30 -05:00
Benjamin Peterson 9b374bfa03 comparing on number of cpus makes more sense 2011-08-02 18:22:30 -05:00
Benjamin Peterson 0163c9aa0c fix sched defines 2011-08-02 18:11:38 -05:00
Benjamin Peterson c5fce4ded2 check individually for some for sched_ functions 2011-08-02 18:07:32 -05:00
Benjamin Peterson e870fe601a make_new_cpu_set takes the number of cpus 2011-08-02 17:44:26 -05:00
Benjamin Peterson 2740af8cc4 sched.h can exist without sched affinity support 2011-08-02 17:41:34 -05:00
Benjamin Peterson 94b580d423 expose sched.h functions (closes #12655) 2011-08-02 17:30:04 -05:00
Nadeem Vawda 9e2e99097c Fix build error in _curses module when not using libncursesw.
Code extracted from Victor Stinner's patch for issue #12567.
2011-07-31 15:01:11 +02:00
Eli Bendersky 906b88fb2a Issue #12380: PyArg_ParseTuple now accepts a bytearray for the 'c' format.
As a side effect, this now allows the rjust, ljust and center methods of
bytes and bytearray to accept a bytearray argument.

Patch by Petri Lehtinen
2011-07-29 07:05:08 +03:00
Ross Lagerwall 114f0e499d Issue #12607: Merge with 3.2. 2011-07-27 07:39:27 +02:00
Ross Lagerwall d98646e430 Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
2011-07-27 07:16:31 +02:00
Antoine Pitrou d42c1d09e9 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add a *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:50:21 +02:00
Antoine Pitrou e96ec68101 Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without
a read1() method), and add an undocumented *write_through* parameter to
mandate unbuffered writes.
2011-07-23 21:46:35 +02:00
Antoine Pitrou d649480739 Issue #12551: Provide a get_channel_binding() method on SSL sockets so as
to get channel binding data for the current SSL session (only the
"tls-unique" channel binding is implemented).  This allows the
implementation of certain authentication mechanisms such as SCRAM-SHA-1-PLUS.

Patch by Jacek Konieczny.
2011-07-21 01:11:30 +02:00
Barry Warsaw 2ebada4233 - Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature.  Without this, architectures where sizeof void* != sizeof int are
  broken.  Patch given by Hallvard B Furuseth.
2011-07-19 19:23:56 -04:00
Barry Warsaw d460a76e9e - Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature.  Without this, architectures where sizeof void* != sizeof int are
  broken.  Patch given by Hallvard B Furuseth.
2011-07-19 18:28:30 -04:00
Antoine Pitrou 874d65afae Issue #11321: Fix a crash with multiple imports of the _pickle module when
embedding Python.  Patch by Andreas Stührk.
2011-07-15 21:02:09 +02:00
Antoine Pitrou 8391cf4e1d Issue #11321: Fix a crash with multiple imports of the _pickle module when
embedding Python.  Patch by Andreas Stührk.
2011-07-15 21:01:21 +02:00
Victor Stinner a7878b77dc Close #6755: Add get_wch() method to curses.window class
Patch by Iñigo Serna.
2011-07-14 23:07:44 +02:00
Victor Stinner a9a9dab042 Issue #12550: Add chain optional argument to faulthandler.register()
Call the previous signal handler if chain is True.
2011-07-13 23:39:53 +02:00
Antoine Pitrou 90ce72dd06 Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError. 2011-07-13 21:08:56 +02:00
Antoine Pitrou cb4ae815b5 Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError. 2011-07-13 21:07:49 +02:00
Antoine Pitrou 7128f95bd2 Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against,
rather than the runtime version of the OpenSSL library.
2011-07-08 18:49:07 +02:00
Antoine Pitrou b9ac25d1c3 Issue #12440: When testing whether some bits in SSLContext.options can be
reset, check the version of the OpenSSL headers Python was compiled against,
rather than the runtime version of the OpenSSL library.
2011-07-08 18:47:06 +02:00
Victor Stinner c655a726db Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows. 2011-07-05 11:31:49 +02:00
Victor Stinner 2cded9c3f3 Issue #12016: Multibyte CJK decoders now resynchronize faster
They only ignore the first byte of an invalid byte sequence.

For example, b'\xff\n'.decode('gb2312', 'replace') gives '\ufffd\n' instead of
'\ufffd'.
2011-07-08 01:45:13 +02:00
Victor Stinner 081fe46ff9 Issue #9566: cast unsigned int to Py_ssize_t in md5 and sha1 modules
Fix a compiler warning on Windows 64 bits.
2011-07-08 01:10:28 +02:00
Victor Stinner 7f53a5027d Issue #12459: time.sleep() now raises a ValueError if the sleep length is
negative, instead of an infinite sleep on Windows or raising an IOError on
Linux for example, to have the same behaviour on all platforms.
2011-07-05 22:00:25 +02:00
Victor Stinner d9fc85db7f (merge 3.2) Issue #9611, #9015: FileIO.read() clamps the length to INT_MAX on Windows. 2011-07-05 11:34:18 +02:00
Victor Stinner 99b9538636 Issue #9642: Uniformize the tests on the availability of the mbcs codec
Add a new HAVE_MBCS define.
2011-07-04 14:23:54 +02:00
Victor Stinner 9122fdd8fa Issue #9642: Fix the definition of time.clock() on Windows
Don't unset and set againt the HAVE_CLOCK define, reorder the #if tests
instead. Fix also the definition of the timezone encoding.
2011-07-04 13:55:40 +02:00
Victor Stinner 48b1ce5519 Issue #12462: time.sleep() now calls immediatly the (Python) signal handler if
it is interrupted by a signal, instead of having to wait until the next
instruction.

Patch reviewed by Antoine Pitrou.
2011-07-01 13:50:09 +02:00
Giampaolo Rodola' 210e7ca032 Issue #12442: add shutil.disk_usage() 2011-07-01 13:55:36 +02:00
Victor Stinner 0aafa4f1e2 faulthandler: add missing include, pthread.h, for FreeBSD 6 2011-06-29 23:28:02 +02:00
Benjamin Peterson dd6098b8a1 merge 3.2 2011-06-27 09:16:40 -05:00
Senthil Kumaran 7d80bd1909 Fix closes issue 11568 - update select.epoll.register docstring with mention of correct behavior. 2011-06-26 23:48:23 -07:00
Ross Lagerwall bc808224b6 Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module. 2011-06-25 12:13:40 +02:00
Ross Lagerwall 1db37f3248 Merge with 3.2 (Issue #12404). 2011-06-25 10:11:44 +02:00
Ross Lagerwall dbfb9b89db Issue 12404: Remove C89 incompatible code from mmap module.
Patch by Akira Kitada.
2011-06-25 10:02:37 +02:00
Victor Stinner 7edb5dfcbc Issue #6697: _lsprof: normalizeUserObj() doesn't encode/decode (UTF-8) the
module name anymore, only work on unicode strings. Therefore it doesn't
truncate module names with embedded NUL characters, or fail if the module name
contains surrogate characters (UTF-8 encoder fails on a surrogate character).

Patch written by Alexander Belopolsky.
2011-06-20 14:59:53 +02:00
Victor Stinner 99563b1df8 calculate_path() decodes the PYTHONPATH environment variable from the locale
encoding using _Py_char2wchar() instead of mbstowcs() to store undecodable
bytes as surrogates characters (PEP 383) instead of ignoring silently
the PYTHONPATH variable.
2011-06-20 14:45:54 +02:00
Victor Stinner 6ee7a57b38 (Merge 3.2) posixmodule.c: fix function name in argument parsing
Fix os.fchown() and os.open()

Remove also trailing spaces and replace tabs by spaces.
2011-06-17 15:18:16 +02:00
Victor Stinner 26de69dff8 posixmodule.c: fix function name in argument parsing
Fix os.fchown() and os.open()

Remove also trailing spaces and replace tabs by spaces.
2011-06-17 15:15:38 +02:00
Brian Curtin 4ff1a414f8 Merge 3.2 - update to the fix for #12084 2011-06-14 10:06:41 -05:00
Brian Curtin c8be84077b Correct completely broken os.stat behavior on Windows XP.
After 1a3e8db28d49, Windows XP could not os.stat at all due to raising
immediately when GetFinalPathNameByHandle wasn't available (pre-Vista).
The proper behavior in that situation is to just not attempt a traversal
rather than outright rejecting.

This change additionally handles a failed malloc by setting the error code
and returning false.

Patch by Hirokazu Yamamoto.
2011-06-14 09:52:50 -05:00
Brian Curtin a87d586fd6 branch merge? 2011-06-13 16:10:32 -05:00
Brian Curtin c9d6a501db branch merge 2011-06-13 16:03:01 -05:00
Brian Curtin 3e86c99f90 Merge from 3.2 for Issue #12084. 2011-06-13 16:00:35 -05:00
Brian Curtin d25aef55c8 Fix #12084. os.stat on Windows wasn't working properly with relative symlinks.
Use of DeviceIoControl to obtain the symlink path via the reparse tag was
removed. The code now uses GetFinalPathNameByHandle in the case of a
symbolic link and works properly given the added test which creates a symbolic
link and calls os.stat on it from multiple locations.

Victor Stinner also noticed an issue with os.lstat following the os.stat
code path when being passed bytes. The posix_lstat function was adjusted to
properly hook up win32_lstat instead of the previous STAT macro (win32_stat).
2011-06-13 15:16:04 -05:00
Charles-François Natali a529308348 Issue #12287: In ossaudiodev, check that the device isn't closed in several
methods.
2011-06-11 18:58:24 +02:00
Ross Lagerwall b0ae53d8a0 Issue #9344: Add os.getgrouplist(). 2011-06-10 07:30:30 +02:00
Victor Stinner 10c30d6764 Issue #8407: signal.sigwait() releases the GIL
Initial patch by Charles-François Natali.
2011-06-10 01:39:53 +02:00
Brian Curtin d9463b233c Merge 3.2 2011-06-09 09:46:21 -05:00
Brian Curtin 95d028fd18 Correction to 88e318166eaf - Issue #11583
Rather than wrapping the C _isdir function in a Python function,
just import the C _isdir function directly. Additionally, add in the
docstring which was left out.
2011-06-09 09:10:38 -05:00
Brian Curtin 9a82eaade3 Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.
By changing to the Windows GetFileAttributes API in nt._isdir we can figure
out if the path is a directory without opening the file via os.stat. This has
the minor benefit of speeding up os.path.isdir by at least 2x for regular
files and 10-15x improvements were seen on symbolic links (which opened the
file multiple times during os.stat). Since os.path.isdir is used in
several places on interpreter startup, we get a minor speedup in startup time.
2011-06-08 18:43:57 -05:00
Brian Curtin 9c669ccc77 Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.
By changing to the Windows GetFileAttributes API in nt._isdir we can figure
out if the path is a directory without opening the file via os.stat. This has
the minor benefit of speeding up os.path.isdir by at least 2x for regular
files and 10-15x improvements were seen on symbolic links (which opened the
file multiple times during os.stat). Since os.path.isdir is used in
several places on interpreter startup, we get a minor speedup in startup time.
2011-06-08 18:17:18 -05:00
Charles-François Natali 4dd453c6aa Issue #12021: Make mmap's read() method argument optional. Patch by Petri
Lehtinen.
2011-06-08 19:18:14 +02:00
Antoine Pitrou dd69649660 Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed
children and raises BrokenProcessPool in such a situation.  Previously it
would reliably freeze/deadlock.
2011-06-08 17:21:55 +02:00
Brett Cannon 4a5e5de03f Revert a reversed comparison order introduced in r70695. 2011-06-07 20:09:32 -07:00
Brett Cannon eb175c473d Remove a redundant assignment.
Found by LLVM/clang 2.9.
2011-06-06 20:24:11 -07:00
Brett Cannon 5fac8af22c Checking if an unsigned long is < 0 is pointless.
Found by LLVM/clang 2.9.
2011-06-06 20:22:56 -07:00
Brett Cannon a0b1ff5844 Remove some extraneous parentheses and swap the comparison order to
prevent accidental assignment.

Silences a warning from LLVM/clang 2.9.
2011-06-06 20:20:36 -07:00
Charles-François Natali 368f34bb4b Issue #12196: Make os.pipe2() flags argument mandatory. 2011-06-06 19:49:47 +02:00
Benjamin Peterson f0cdbad1b3 always clear parser error 2011-06-05 22:14:05 -05:00
Gregory P. Smith d64b2bae9b merge heads. 2011-06-04 23:05:19 -07:00
Benjamin Peterson f719957d7a only clear the parser error if it's set (closes #12264) 2011-06-04 22:06:42 -05:00
Victor Stinner 2bc6c2ec2f (Merge 3.2) Issue #12016: Reindent decoders of HK and JP codecs 2011-06-03 23:34:32 +02:00
Victor Stinner 5dfe3bb2d9 Issue #12016: Reindent decoders of HK and JP codecs 2011-06-03 23:34:09 +02:00
Éric Araujo 5397c797f4 Merge 3.2 2011-06-01 19:47:24 +02:00
Éric Araujo affcf2967f Branch merge 2011-06-01 19:39:27 +02:00
Benjamin Peterson fdb2d909a4 merge 3.1 2011-05-31 21:38:49 -05:00
Benjamin Peterson 52e61449e3 return NULL on error 2011-05-31 21:38:15 -05:00
Benjamin Peterson f17101a307 merge 3.2 2011-05-31 21:31:59 -05:00
Benjamin Peterson 5c2b09e856 be extra careful with a borrowed reference when the GIL could be released (closes #8578) 2011-05-31 21:31:37 -05:00
Benjamin Peterson 8c6f88efa2 remove __version__s dependent on subversion keyword expansion (closes #12221) 2011-05-31 20:52:17 -05:00
Benjamin Peterson 9e3e1c6e4e merge 3.2 (#12221) 2011-05-31 19:07:45 -05:00
Benjamin Peterson 0aa71f7982 merge 3.1 (#12221) 2011-05-31 19:06:17 -05:00
Benjamin Peterson a22c98de85 simply use the Python version for pyexpat.__version__ #12221 2011-05-31 18:59:49 -05:00
Victor Stinner bc93a116eb Close #12229: Remove an unused argument of _bufferedreader_peek_unlocked(),
io.BufferedReader._peek_unlocked(). Patch written by John O'Connor.
2011-06-01 00:01:24 +02:00
Éric Araujo 9bcf8bfb24 Fix error message to use the Python name instead of the C name 2011-05-31 14:08:26 +02:00
Victor Stinner e15dce3d18 Close #12171: IncrementalEncoder.reset() of CJK codecs (multibytecodec) calls
encreset() instead of decreset().
2011-05-30 22:56:00 +02:00
Charles-François Natali daafdd5bea Issue #12196: Add pipe2() to the os module. 2011-05-29 20:07:40 +02:00
Victor Stinner 5572ba7e15 _posixsubprocess.c: don't redefine _GNU_SOURCE if it's already defined 2011-05-26 14:10:08 +02:00
Victor Stinner 77af172914 socket.sendto(): exit directly after setting the error
Dummy change to avoid a false positive with the Clang Static Analyzer.
2011-05-26 14:05:59 +02:00
Victor Stinner 9a2261a372 zipimport: initialize fullpath to NULL
In some cases, fullpath value is used whereas fullpath was not always
initialized. Warning found by the Clang Static Analyzer.
2011-05-26 13:59:41 +02:00
Victor Stinner 25095b2be6 Remove useless assignments
Warnings found by the the Clang Static Analyzer.
2011-05-26 13:47:08 +02:00
Stefan Krah f2c6db5fac Issue #12090: backport 79fcd71d0356 2011-05-26 00:37:45 +02:00
Victor Stinner b57f108b03 Issue #12175: BufferedReader.read(-1) now calls raw.readall() if available. 2011-05-26 00:19:38 +02:00
Victor Stinner e9d44ccb22 Issue #12175: FileIO.readall() now only reads the file position and size once. 2011-05-26 00:16:44 +02:00
Victor Stinner d2780aedce (Merge 3.2) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
2011-05-25 22:51:16 +02:00
Victor Stinner 988512cfd7 (Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()
returns None.
2011-05-25 22:49:15 +02:00
Victor Stinner a80987f20d Issue #12175: RawIOBase.readall() now returns None if read() returns None. 2011-05-25 22:47:16 +02:00
Victor Stinner af62c7d3de (Merge 3.2) Issue #12175: FileIO.readall() now raises a ValueError instead of
an IOError if the file is closed.
2011-05-25 22:13:47 +02:00
Victor Stinner 4767114e77 (Merge 3.1) Issue #12175: FileIO.readall() now raises a ValueError instead of
an IOError if the file is closed.
2011-05-25 22:11:55 +02:00
Victor Stinner b79f28ccbd Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError if
the file is closed.
2011-05-25 22:09:03 +02:00
Victor Stinner fd8211372d Fast path for IncrementalNewlineDecoder.decode() in io.TextIOWrapper.read(-1)
Copy/paste code from textiowrapper_read_chunk().
2011-05-25 22:01:33 +02:00
Victor Stinner c13ef66649 Issue #8407: Fix the signal handler of the signal module: if it is called
twice, it now writes the number of the second signal into the wakeup fd.
2011-05-25 02:35:58 +02:00
Victor Stinner eb734f77ad (Merge 3.2) Issue #12100: Don't reset incremental encoders of CJK codecs at
each call to their encode() method anymore, but continue to call the reset()
method if the final argument is True.
2011-05-24 22:24:11 +02:00
Victor Stinner d48ba0bde5 (Merge 3.1) Issue #12100: Don't reset incremental encoders of CJK codecs at
each call to their encode() method anymore, but continue to call the reset()
method if the final argument is True.
2011-05-24 22:22:17 +02:00
Victor Stinner 6bcbef7da0 Issue #12100: Don't reset incremental encoders of CJK codecs at each call to
their encode() method anymore, but continue to call the reset() method if the
final argument is True.
2011-05-24 22:17:55 +02:00
Victor Stinner 99c8b16143 Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl
module.
2011-05-24 12:05:19 +02:00
Victor Stinner 7870bdff5a Issue #6501: os.device_encoding() returns None on Windows if the application
has no console.
2011-05-23 18:12:52 +02:00
Victor Stinner 9b49304790 Close #12153: faulthandler, mark stack_overflow() as static 2011-05-23 12:29:10 +02:00
Gregory P. Smith b6471db8a7 Further documentation updates to be consistent with doc standards and comments
Ezio Melotti pointed out.
2011-05-22 22:47:55 -07:00
Charles-François Natali 1e045b1831 Issue #12105: Add O_CLOEXEC to the os module. 2011-05-22 20:42:32 +02:00
Gregory P. Smith 95c7c46077 avoid a compiler warning. the compiler doesn't know that the static
struct guarantees the loop will always be run once to initialize code.
2011-05-21 05:19:42 -07:00
Charles-François Natali 6071359de1 Issue #1746656: make if_nameindex(), if_indextoname() and if_nametoindex()
accept and return str instead of bytes arrays. Add some more tests.
2011-05-20 16:55:06 +02:00
Victor Stinner 21809a6938 (Merge 3.2) Issue #12124: zipimport doesn't keep a reference to
zlib.decompress() anymore to be able to unload the module.
2011-05-20 00:22:39 +02:00
Victor Stinner 4445ec81c1 (Merge 3.1) Issue #12124: zipimport doesn't keep a reference to
zlib.decompress() anymore to be able to unload the module.
2011-05-20 00:18:58 +02:00
Victor Stinner 4925cde1cc Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
to be able to unload the module.
2011-05-20 00:16:09 +02:00
Gregory P. Smith 3b1f2c35f4 issue #1746656: Fix for OS X. configure and #include changes so that the socket
module compiles again on OS X with its more annoying #include requirements.
2011-05-15 12:18:23 -07:00
Victor Stinner d0e11ec5b0 Issue #10756: atexit normalizes the exception before displaying it. Patch by
Andreas Stührk.

Backport a fix already applied to Python 3.2+ (4a82be47a948 + 5060a92a8597).
2011-05-15 18:57:44 +02:00
Nadeem Vawda d74b5936a1 Fix _socket compilation failures on non-Linux buildbots (cf. issue #1746656). 2011-05-15 13:16:22 +02:00
Victor Stinner aedb2823fd (Merge 3.2) Issue #12060: Use sig_atomic_t type and volatile keyword in the
signal module. Patch written by Charles-François Natali.
2011-05-15 10:27:49 +02:00
Victor Stinner 5ebfe6d9a9 (Merge 3.1) Issue #12060: Use sig_atomic_t type and volatile keyword in the
signal module. Patch written by Charles-François Natali.
2011-05-15 10:27:09 +02:00
Victor Stinner 2ec6b176bd Issue #12060: Use sig_atomic_t type and volatile keyword in the signal module.
Patch written by Charles-François Natali.
2011-05-15 10:21:59 +02:00
Gregory P. Smith 5ed2e779f1 Issue #1746656: Add if_nameindex, if_nametoindex, if_indextoname
methods to the socket module.
2011-05-15 00:26:45 -07:00
Nadeem Vawda ccb33bf002 Merge: #8650: Make zlib.[de]compressobj().[de]compress() 64-bit clean.
Raise an OverflowError if the input data is too large, instead of silently
truncating the input and returning an incorrect result.
2011-05-15 00:23:40 +02:00
Nadeem Vawda 565d659dcd Merge: #8650: Make zlib.[de]compressobj().[de]compress() 64-bit clean.
Raise an OverflowError if the input data is too large, instead of silently
truncating the input and returning an incorrect result.
2011-05-15 00:20:52 +02:00
Nadeem Vawda 0c3d96ae1d Issue #8650: Make zlib.[de]compressobj().[de]compress() 64-bit clean.
Raise an OverflowError if the input data is too large, instead of silently
truncating the input and returning an incorrect result.
2011-05-15 00:19:50 +02:00
Nadeem Vawda 905cca011b Merge fix for memory leaks in zlib.compress() and .decompress().
Also, make sure that test_zlib tests decompress() for overly-large inputs.
2011-05-14 23:18:07 +02:00
Nadeem Vawda 154bdf92fc Fix memory leaks in zlib.compress() and .decompress().
Also, make sure that test_zlib tests decompress() for overly-large inputs.
2011-05-14 23:07:36 +02:00
Nadeem Vawda 1b8a417d9f Issue #8650: Backport 64-bit safety fixes for compress() and decompress(). 2011-05-14 22:26:55 +02:00
Nadeem Vawda 9c405c470b Merge: #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
attribute when called without a max_length argument.
2011-05-14 14:19:56 +02:00
Nadeem Vawda 5eef502de0 Merge: #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
attribute when called without a max_length argument.
2011-05-14 14:15:47 +02:00
Nadeem Vawda 7619e88adb Issue #12050: zlib.decompressobj().decompress() now clears the unconsumed_tail
attribute when called without a max_length argument.
2011-05-14 14:05:20 +02:00
Antoine Pitrou b89b31a158 Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
on a file opened in read+write mode (namely: reading, seeking a bit forward,
writing, then seeking before the previous write but still within buffered
data, and writing again).
2011-05-13 00:25:53 +02:00
Antoine Pitrou 00dd182b8e Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
on a file opened in read+write mode (namely: reading, seeking a bit forward,
writing, then seeking before the previous write but still within buffered
data, and writing again).
2011-05-13 00:16:28 +02:00
Antoine Pitrou 7c40489180 Issue #12062: Fix a flushing bug when doing a certain type of I/O sequence
on a file opened in read+write mode (namely: reading, seeking a bit forward,
writing, then seeking before the previous write but still within buffered
data, and writing again).
2011-05-13 00:13:33 +02:00
Antoine Pitrou 4e19e11958 Fix compile error under Windows 2011-05-12 02:07:00 +02:00
Antoine Pitrou 3486a98dcd Issue #9971: Write an optimized implementation of BufferedReader.readinto().
Patch by John O'Connor.
2011-05-12 01:57:53 +02:00
Victor Stinner 410dd7d357 Issue #12058: Minor edits to comments in faulthandler
Patch written by Éric Araujo.
2011-05-11 20:56:08 +02:00
Kurt B. Kaiser 9dd41fa970 Merge from 3.2 2011-05-11 14:18:13 -04:00
Kurt B. Kaiser bc3e13818b Merge from 3.1 2011-05-11 13:48:54 -04:00
Kurt B. Kaiser e147806da9 Issue #1028: Tk returns invalid Unicode null in %A: UnicodeDecodeError.
With Tk < 8.5 _tkinter.c:PythonCmd() raised UnicodeDecodeError, caused IDLE to
exit.  Converted to valid Unicode null in PythonCmd().
2011-05-11 12:24:17 -04:00
Ezio Melotti f8d6fd605d #12051: merge with 3.2. 2011-05-11 01:23:41 +03:00
Ezio Melotti f188bc5d46 #12051: merge with 3.1. 2011-05-11 01:10:27 +03:00
Ezio Melotti 136726537f #12051: Fix segfault in json.dumps() while encoding highly-nested objects using the C accelerations. 2011-05-11 01:02:56 +03:00
Antoine Pitrou 3cade9942e Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
order to accept exactly one connection.  Patch by Daniel Evers.
2011-05-10 19:19:13 +02:00
Antoine Pitrou 1be815aac4 Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in
order to accept exactly one connection.  Patch by Daniel Evers.
2011-05-10 19:16:29 +02:00
Victor Stinner 388196ed72 Issue #12011: signal.signal() and signal.siginterrupt() raise an OSError,
instead of a RuntimeError: OSError has an errno attribute.
2011-05-10 17:13:00 +02:00
Victor Stinner 00bc6ccb78 faulthandler: improve_sigabrt() on Visual Studio
Use _set_abort_behavior() + abort() instead of raise(SIGABRT) which may write
an error message and/or open a popup asking to report the fault.
2011-05-10 01:30:03 +02:00
Victor Stinner 17ca323e7c (Merge 3.1) Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional
OpenSSL is now compiled with OPENSSL_NO_SSL2 defined (without the SSLv2
protocol) on Debian: fix the ssl module on Debian Testing and Debian Sid.

Optimize also ssl.get_protocol_name(): speed does matter!
2011-05-10 00:48:41 +02:00
Victor Stinner ee18b6f2fd Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional
OpenSSL is now compiled with OPENSSL_NO_SSL2 defined (without the SSLv2
protocol) on Debian: fix the ssl module on Debian Testing and Debian Sid.

Optimize also ssl.get_protocol_name(): speed does matter!
2011-05-10 00:38:00 +02:00
Antoine Pitrou 2341f9ba00 Remove dead code from _multiprocessing 2011-05-09 20:55:03 +02:00
Antoine Pitrou 87cf220972 Issue #11743: Rewrite multiprocessing connection classes in pure Python. 2011-05-09 17:04:27 +02:00
Victor Stinner 86e104a6ab Issue #8407: Use an explicit cast for FreeBSD
pthread_t is a pointer, not an integer, on FreeBSD. It should fix the following
gcc warning:

passing argument 1 of ‘pthread_kill’ makes pointer from integer without a cast
2011-05-09 14:45:38 +02:00
Victor Stinner e0c9a7533c faulthandler: make quiet a gcc 4.6 warning (z was unused) 2011-05-09 14:44:26 +02:00
Victor Stinner 8f9f8d612a Issue #11888: Use system log2() when available
I expect the system libc to use more accurate functions than Python. The GNU
libc uses for example FYL2X and FYL2XP1 hardware instructions on Intel FPU.
2011-05-09 12:45:41 +02:00
Gerhard Haering 936d518dc8 #10811: Fix recursive usage of cursors. Instead of crashing, raise a ProgrammingError now. 2011-05-09 12:24:09 +02:00