Commit graph

90578 commits

Author SHA1 Message Date
R David Murray
1058cda38f #23792: Ignore KeyboardInterrupt when the pydoc pager is active.
Previously, if you hit ctl-c while the pager was active, the python that
launched the subprocess for the pager would see the KeyboardInterrupt in the
__exit__ method of the subprocess context manager where it was waiting for the
subprocess to complete, ending the wait.  This would leave the pager running,
while the interactive interpreter, after handling the exception by printing
it, would go back to trying to post a prompt...but the pager would generally
have the terminal in raw mode, and in any case would be still trying to read
from stdin.  On some systems, even exiting python at that point would not
restore the terminal mode.  The problem with raw mode could also happen if
ctl-C was hit when pydoc was called from the shell command line and the pager
was active.

Instead, we now wait on the subprocess in a loop, ignoring KeyboardInterrupt
just like the pager does, until the pager actually exits.

(Note: this was a regression relative to python2...in python2 the pager
is called via system, and system does not return until the pager exits.)
2015-03-29 15:15:40 -04:00
Serhiy Storchaka
48070c1248 Issue #23803: Fixed str.partition() and str.rpartition() when a separator
is wider then partitioned string.
2015-03-29 19:21:02 +03:00
Serhiy Storchaka
9db55004a1 Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.
2015-03-28 20:38:37 +02:00
Victor Stinner
d7aa5248fb Issue #23445: Fix test.support.python_is_optimized() for CFLAGS=-Og
-Og does not optimize the C code, it's just "fast debugging".
2015-03-27 15:36:01 +01:00
Victor Stinner
79fd962652 asyncio: Fix _SelectorTransport.__repr__() if the event loop is closed 2015-03-27 15:20:08 +01:00
Serhiy Storchaka
0b4e355b8e Check that failed writerow() doesn't produce change a file. 2015-03-25 19:16:15 +02:00
Serhiy Storchaka
1b87ae0c91 Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes. 2015-03-25 16:40:15 +02:00
Victor Stinner
81f241ab2e Issue #23571: If io.TextIOWrapper constructor fails in _Py_DisplaySourceLine(),
close the binary file to fix a resource warning.
2015-03-25 02:25:25 +01:00
Victor Stinner
84092ac370 Issue #23571: Fix reentrant call to Py_FatalError()
Flushing sys.stdout and sys.stderr in Py_FatalError() can call again
Py_FatalError(). Add a reentrant flag to detect this case and just abort at the
second call.
2015-03-25 01:54:46 +01:00
Serhiy Storchaka
b0749ca933 Fixed bytes warnings when run tests with -vv. 2015-03-25 01:33:19 +02:00
Serhiy Storchaka
7665be6087 Issue #21802: The reader in BufferedRWPair now is closed even when closing
writer failed in BufferedRWPair.close().
2015-03-24 23:21:57 +02:00
Serhiy Storchaka
8ffe917cee Issue #23671: string.Template now allows to specify the "self" parameter as
keyword argument.  string.Formatter now allows to specify the "self" and
the "format_string" parameters as keyword arguments.
2015-03-24 22:28:43 +02:00
Serhiy Storchaka
be1eb14241 Added tests for mixed kinds of Unicode strings. 2015-03-24 21:48:30 +02:00
Serhiy Storchaka
6c86fe2d4b Issue #23583: Added tests for standard IO streams in IDLE. 2015-03-24 19:46:54 +02:00
Victor Stinner
ec4f9592f5 Issue #23571: Py_FatalError() now tries to flush sys.stdout and sys.stderr
It should help to see exceptions when stderr if buffered: PyErr_Display() calls
sys.stderr.write(), it doesn't write into stderr file descriptor directly.
2015-03-24 13:44:35 +01:00
Victor Stinner
0e98a76b65 Issue #23571: Enhance Py_FatalError()
* Display the current Python stack if an exception was raised but the exception
  has no traceback
* Disable faulthandler if an exception was raised (before it was only disabled
  if no exception was raised)
* To display the current Python stack, call PyGILState_GetThisThreadState()
  which works even if the GIL was released
2015-03-24 11:24:06 +01:00
Ezio Melotti
2e3998fae0 #11468: improve unittest basic example. Initial patch by Florian Preinstorfer. 2015-03-24 12:42:41 +02:00
Victor Stinner
19276f184f Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC)
Issue #23654: Turn off ICC's tail call optimization for the stack_overflow
generator. ICC turns the recursive tail call into a loop.

Patch written by Matt Frank.
2015-03-23 21:20:27 +01:00
Serhiy Storchaka
d4c2ac8394 Issue #21560: An attempt to write a data of wrong type no longer cause
GzipFile corruption.  Original patch by Wolfgang Maier.
2015-03-23 15:25:43 +02:00
Raymond Hettinger
f6e31b79a8 Issue 23729: Document ElementTree namespace handling and fix an omission in the XPATH predicate table. 2015-03-22 15:29:09 -07:00
R David Murray
936da2a796 #23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes. 2015-03-22 16:17:46 -04:00
R David Murray
beed8402ca #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.
Some http servers will reject PUT, POST, and PATCH requests if they
do not have a Content-Length header.

Patch by James Rutherford, with additional cleaning up of the
'request' documentation by me.
2015-03-22 15:18:23 -04:00
R David Murray
75ed90a4cf #23700: fix/improve comment 2015-03-22 12:33:46 -04:00
Benjamin Peterson
218144a94d clarify behavior of shutil.move when destination exists (closes #22933)
Patch by Mike Short.
2015-03-22 10:11:54 -04:00
Ned Deily
ce8f5ded65 Issue #22289: Prevent test_urllib2net failures due to ftp connection timeout. 2015-03-22 01:14:48 -07:00
Serhiy Storchaka
d357b89f0b Issue #22079: Deprecation warning now is issued in PyType_Ready() instead of
raising TypeError when statically allocated type subclasses dynamically
allocated type
2015-03-22 09:46:36 +02:00
Serhiy Storchaka
52027c301a Issue #22351: The nntplib.NNTP constructor no longer leaves the connection
and socket open until the garbage collector cleans them up.  Patch by
Martin Panter.
2015-03-21 09:40:26 +02:00
Steve Dower
fe0a41aae4 Issue #23668: Adds support for os.truncate and os.ftruncate on Windows 2015-03-20 19:50:46 -07:00
Steve Dower
c7d979f022 Closes #23686: Update Windows installer OpenSSL to 1.0.2a 2015-04-11 23:36:04 -04:00
doko@ubuntu.com
f172caeb8b - fix file permission for Lib/test/test_script_helper.py 2015-04-12 02:03:50 +02:00
Ned Deily
267998a766 Issue #23817: run autoreconf to update configure. 2015-04-11 16:00:38 -07:00
doko@ubuntu.com
6433e9efde - Modules/Setup.dist: remove time extension duplicate, introduced by the fix for #5309. 2015-04-12 00:13:52 +02:00
Antoine Pitrou
8d0c478601 Close #23904: fix pathlib documentation misleadingly mentioning that bytes objects are accepted in the PurePath constructor 2015-04-12 00:08:35 +02:00
Guido van Rossum
0ac8aa7ff3 Unittest for Issue 21511 by Christie Wilson bobcatfish@gmail.com (merge from 3.4). 2015-04-11 17:45:56 -04:00
Ethan Furman
3323da92e7 Issue23826: fix doc test for -OO runs 2015-04-11 09:39:59 -07:00
Berker Peksag
2995cc6855 Issue #23912: Fix code formatting in datamodel.rst.
Patch by James Edwards.
2015-04-11 14:59:50 +03:00
Benjamin Peterson
339e3f33b6 merge 3.4 2015-04-11 07:44:45 -04:00
Antoine Pitrou
2dbc6e6bce Issue #23529: Limit the size of decompressed data when reading from
GzipFile, BZ2File or LZMAFile.  This defeats denial of service attacks
using compressed bombs (i.e. compressed payloads which decompress to a huge
size).

Patch by Martin Panter and Nikolaus Rath.
2015-04-11 00:31:01 +02:00
Serhiy Storchaka
2ce11d296c Null merge 2015-04-10 16:22:14 +03:00
Serhiy Storchaka
43264b8844 Merge heads 2015-04-10 16:22:03 +03:00
Berker Peksag
a7b9a1f4df Issue #23025: Add a mention of os.urandom to RAND_bytes and RAND_pseudo_bytes docs.
Patch by Alex Gaynor.
2015-04-10 16:19:44 +03:00
Serhiy Storchaka
1c04a391f7 Null merge 2015-04-10 16:19:42 +03:00
Serhiy Storchaka
056eb967ee Merge heads 2015-04-10 16:18:58 +03:00
Serhiy Storchaka
71fd224af0 Issue #21859: Added Python implementation of io.FileIO. 2015-04-10 16:16:16 +03:00
Berker Peksag
82c920c59e Issue #23062: Add a test for suppressing --version with argparse.SUPPRESS.
TestHelpVersionOptional was redundant.
2015-04-10 16:11:45 +03:00
Serhiy Storchaka
cd092efb16 Issue #21859: Corrected FileIO docstrings. 2015-04-10 16:09:13 +03:00
Serhiy Storchaka
2116b12da5 Issue #23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If needs to release multiple resources, they are released
even if errors are occured.
2015-04-10 13:29:28 +03:00
Serhiy Storchaka
fcbf8f3e3d Null merge 2015-04-10 13:03:05 +03:00
Serhiy Storchaka
1c5e281df8 Use assertRaisesRegex instead of deprecated assertRaisesRegexp. 2015-04-10 12:54:19 +03:00
Serhiy Storchaka
93da9b5e57 Use assertRaisesRegex instead of deprecated assertRaisesRegexp. 2015-04-10 12:52:09 +03:00