Commit Graph

33940 Commits

Author SHA1 Message Date
Serhiy Storchaka dbe0982bc5 Issue #8260: The read(), readline() and readlines() methods of
codecs.StreamReader returned incomplete data when were called after
readline() or read(size).  Based on patch by Amaury Forgeot d'Arc.
2014-01-26 19:27:56 +02:00
Serhiy Storchaka 8003850e22 Issue #8260: The read(), readline() and readlines() methods of
codecs.StreamReader returned incomplete data when were called after
readline() or read(size).  Based on patch by Amaury Forgeot d'Arc.
2014-01-26 19:21:00 +02:00
Andrew Svetlov 0742cae335 Merge latest Tulip into asyncio 2014-01-26 18:36:01 +02:00
Nick Coghlan 77b286b2cc Close #20105: set __traceback__ when chaining exceptions in C 2014-01-27 00:53:38 +10:00
Larry Hastings 2d8e1e4f07 Version bump for 3.4.0b3. 2014-01-26 00:48:23 -08:00
Larry Hastings 0e25410319 Documentation fixes, including fixing "suspicious" problems. 2014-01-26 00:42:02 -08:00
Larry Hastings 23e37aa7b7 Issue #20358: Tests for curses.window.overlay and curses.window.overwrite
no longer specify min{row,col} > max{row,col}.
2014-01-25 22:19:47 -08:00
Donald Stufft 0711dd921b Update pip to 1.5.2 and setuptools to 2.1 2014-01-26 00:22:39 -05:00
Guido van Rossum fef7098ef9 asyncio: Rename {Empty,Full} to {QueueEmpty,QueueFull} and no longer get them from queue.py. 2014-01-25 17:24:51 -08:00
Guido van Rossum ab3c88983b asyncio: Locks refactor: use a separate context manager; remove Semaphore._locked. 2014-01-25 16:51:57 -08:00
Guido van Rossum ab27a9fc4b asyncio: Fix race in FastChildWatcher (by its original author, Anthony Baire). 2014-01-25 16:32:17 -08:00
Victor Stinner 669eeaf933 Merge latest Tulip into asyncio
- Make the new granularity attribute private
- Simplify BaseEventLoop._run_once(): avoid math.ceil(), use simple arithmetic
  instead
2014-01-26 00:02:31 +01:00
Victor Stinner 3c2f175ec4 Issue #20311: Fix test_telnetlib, set the resolution of the MockSelector 2014-01-25 23:53:28 +01:00
Eric Snow 6029e08691 Issue 19944: Fix importlib.find_spec() so it imports parents as needed.
The function is also moved to importlib.util.
2014-01-25 15:32:46 -07:00
Victor Stinner 128ee220e2 asyncio: Don't export BaseEventLoop, BaseSelectorEventLoop nor
BaseProactorEventLoop

Import them from submodules if you really need them.
2014-01-25 22:22:18 +01:00
Serhiy Storchaka c0b0bb6e01 Issue #20331: Fixed possible FD leaks in various modules:
http.server, imghdr, mailcap, mimetypes, xml.etree.
2014-01-25 19:43:56 +02:00
Serhiy Storchaka 91b0bc237c Issue #20331: Fixed possible FD leaks in various modules:
http.server, imghdr, mailcap, mimetypes, xml.etree.
2014-01-25 19:43:02 +02:00
Victor Stinner 8dffc456d7 Update asyncio from the Tulip project
Major changes:

- StreamReader.readexactly() now raises an IncompleteReadError if the
  end of stream is reached before we received enough bytes, instead of
  returning less bytes than requested.

- Unit tests use the main asyncio module instead of submodules like events

- _UnixWritePipeTransport now also supports character devices, as
  _UnixReadPipeTransport. Patch written by Jonathan Slenders.

- Export more symbols: BaseEventLoop, BaseProactorEventLoop,
  BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
2014-01-25 15:32:06 +01:00
Victor Stinner 75a5ec88ff Fix asyncio tests: define resolution 2014-01-25 15:31:06 +01:00
Victor Stinner 6b0fa70547 test_selectors: remove unused imports 2014-01-25 15:04:22 +01:00
Victor Stinner f67255ab94 Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
between the resolution of the BaseEventLoop.time() method and the resolution of
the selector. The granuarility is used in the scheduler to round time and
deadline.
2014-01-25 15:01:33 +01:00
Victor Stinner 635fca9704 Issue #20311: selectors: Add a resolution attribute to BaseSelector. 2014-01-25 14:56:48 +01:00
Victor Stinner 2041859f27 Issue #20311: Revert e042ea77a152 and 7ce7295393c2, PollSelector.select() and
EpollSelector.select() round again the timeout towards zero
2014-01-25 14:43:45 +01:00
Victor Stinner 38c72bd199 (Merge 3.3) Issue #20311: Revert 033137c12d88 (02f9db3e684e),
select.epoll.poll() rounds again the timeout towards zero
2014-01-25 14:40:04 +01:00
Victor Stinner 933209689e Issue #20311: Revert 033137c12d88, select.epoll.poll() rounds again the timeout
towards zero
2014-01-25 14:37:50 +01:00
Serhiy Storchaka a7184e617a Fix typo. 2014-01-24 22:28:06 +02:00
Serhiy Storchaka 2d5a0928f1 Issue #20384: Fix the test_tarfile test on Windows.
On Windows os.open() error message doesn't contain file name.
2014-01-24 22:19:23 +02:00
Larry Hastings 5c66189e88 Issue #20189: Four additional builtin types (PyTypeObject,
PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type)
have been modified to provide introspection information for builtins.
Also: many additional Lib, test suite, and Argument Clinic fixes.
2014-01-24 06:17:25 -08:00
Nick Coghlan b3c0f4067d Merge removal of issue 20317 debugging code from 3.3 2014-01-24 23:07:16 +10:00
Nick Coghlan add94c9d82 Issue 20317: Remove debugging code from contextlib
- Alex J Burke noticed a debugging raise in the commit that
  fixed the original bug reported in issue 20317
- this showed that multiple iterations through the affected
  loop wasn't actually being tested
2014-01-24 23:05:45 +10:00
Victor Stinner 421e49b5c1 asyncio: wait_for() now cancels the future on timeout. Patch written by Gustavo
Carneiro.
2014-01-23 17:40:59 +01:00
Victor Stinner 183e347796 asyncio (Tulip issue 110): StreamReader.read() and StreamReader.readline() now
raise a RuntimeError, instead of using an assertion, if another coroutine is
already waiting for incoming data
2014-01-23 17:40:03 +01:00
Victor Stinner 8ce6e1100e Close #20365: Skip test_asyncio.test_events.test_read_pty_output() on Mac OS X
older than 10.9 (Maverick). kqueue doesn't support character devices (PTY) on
Mac OS X older than 10.9.
2014-01-23 17:26:06 +01:00
Serhiy Storchaka 418e80ba00 Fixed test_user_command on OpenSolaris where floats can have different string
representation in Tcl and Python.
2014-01-23 16:49:22 +02:00
Serhiy Storchaka bdf0cb52eb Fixed test_user_command on OpenSolaris where floats can have different string
representation in Tcl and Python.
2014-01-23 16:48:44 +02:00
Victor Stinner da94b9ebeb Issue #20311: add debug help in test_selectors 2014-01-23 15:07:26 +01:00
Victor Stinner 3eb45d3eae asyncio: Fix open_connection() documentation, writer is a StreamWriter 2014-01-23 10:20:18 +01:00
Serhiy Storchaka d869a0b132 Added test_user_command in test_tcl.
It tests the convertion Tcl values to Python values when Tcl calls a command
implemented on Python. Currently all values are passed as strings.
2014-01-23 09:49:42 +02:00
Serhiy Storchaka 4b730161fd Added test_user_command in test_tcl.
It tests the convertion Tcl values to Python values when Tcl calls a command
implemented on Python. Currently all values are passed as strings.
2014-01-23 09:44:05 +02:00
Terry Jan Reedy 8860443749 Merge with 3.3 2014-01-23 00:39:11 -05:00
Terry Jan Reedy 94338de49b Issue #17390: Add Python version to Idle editor window title bar.
Original patches by Edmond Burnett and Kent Johnson.
2014-01-23 00:36:46 -05:00
Nick Coghlan d58831e688 Merge #20317 from 3.3 2014-01-22 23:04:37 +10:00
Nick Coghlan 09761e7c9c Issue #20317: Don't create a reference loop in ExitStack 2014-01-22 22:24:46 +10:00
Victor Stinner 4a2dbeb0d3 asyncio: Cleanup logging in BaseEventLoop._run_once()
logger.log() is now responsible to format the timeout. It might be faster if
the log is disabled for DEBUG level, but it's also more readable and fix
an issue with Python 2.6 in the Trollius project.
2014-01-22 12:26:01 +01:00
Terry Jan Reedy 45726d3011 Merge with 3.3 2014-01-21 21:13:25 -05:00
Terry Jan Reedy 0e3b0e397e Issue #20818: Remove code from idlelib.CallTipWindow.showtip that is now
completely redundant. After 16638 patch, CallTips.get_argspec trims over-long
signature strings as well as docstring lines.
2014-01-21 21:12:24 -05:00
Terry Jan Reedy 3f440de7d3 Merge with 3.3 2014-01-21 20:45:38 -05:00
Terry Jan Reedy d5710f8b36 Issue #16638: Include up to 5 docstring header lines (before first blank) in
Idle calltips. This is needed for builtins, such bytes (which is why 5).
Based on patch by Serhiy Storchaka.
2014-01-21 20:45:17 -05:00
Florent Xicluna 45e124e26d Issue #17825: Cursor ^ is correctly positioned for SyntaxError and IndentationError. 2014-01-22 01:16:25 +01:00
Florent Xicluna 758fa5ea81 Issue #17825: Cursor ^ is correctly positioned for SyntaxError and IndentationError. 2014-01-22 01:11:43 +01:00
Stefan Krah b772f2e89d Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts. 2014-01-21 22:59:57 +01:00
Stefan Krah 6b2e5597e1 Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts. 2014-01-21 22:58:40 +01:00
Terry Jan Reedy 502d80f8b4 Merge with 3.3 2014-01-21 15:37:16 -05:00
Terry Jan Reedy 715476d8e3 Issue #16630: Make Idle calltips work even when __getattr__ raises.
Initial patch by Roger Serwy.
2014-01-21 15:36:51 -05:00
Serhiy Storchaka 2bd59daf58 Issue #2382: SyntaxError cursor "^" now is written at correct position in most
cases when multibyte characters are in line (before "^").  This still not
works correctly with wide East Asian characters.
2014-01-21 22:29:47 +02:00
Serhiy Storchaka 65fd0592fb Issue #2382: SyntaxError cursor "^" now is written at correct position in most
cases when multibyte characters are in line (before "^").  This still not
works correctly with wide East Asian characters.
2014-01-21 22:26:52 +02:00
Victor Stinner 567b26e882 Issue #20311: EpollSelector now also rounds the timeout towards zero, as
PollSelector.

This change is not really required in Python 3.4, since select.epoll.poll() now
rounds also correctly the timeout. But Guido van Rossum prefers to have exactly
the same selectors.py file in CPython and Tulip projects: "it's not harmful".
2014-01-21 21:00:47 +01:00
Victor Stinner 7067b5d927 selectors: add a comment to explain why and how poll timeout is rounded 2014-01-21 17:49:41 +01:00
Terry Jan Reedy 781a5441ae Issue #16655: Explain why Idle's test_calltips has 'fragile' tests of builtins.
Pending Clinic/inspect changes will probably require change to this file.
2014-01-21 03:10:01 -05:00
Terry Jan Reedy eed1661b47 Issue #16655: Explain why Idle's test_calltips has 'fragile' tests of builtins. 2014-01-21 03:07:51 -05:00
Terry Jan Reedy 83b8105c64 Merge with 3.3 2014-01-21 00:26:49 -05:00
Terry Jan Reedy 681ede8b0a Issue #20122: Idlelib: Move tests in CallTips.py to test_calltips.py. 2014-01-21 00:26:21 -05:00
Victor Stinner 240cae7d17 (Merge 3.3) Issue #20311: Try to fix the unit test, use time.monotonic()
instead of time.perf_counter()
2014-01-21 02:38:33 +01:00
Victor Stinner 39d798eb03 Issue #20311: Try to fix the unit test, use time.monotonic() instead of
time.perf_counter()

Move also the unit test at the end.
2014-01-21 02:37:41 +01:00
Victor Stinner 11da8e24ba Issue #20311: selector.PollSelector.select() now rounds the timeout away from
zero, instead of rounding towards zero. For example, a timeout of one
microsecond is now rounded to one millisecond, instead of being rounded to
zero.

Move also a test in test_epoll which was moved by my previous merge.
2014-01-21 01:48:28 +01:00
Victor Stinner 09354fd606 (Merge 3.3) Issue #20311: select.epoll.poll() now rounds the timeout away from
zero, instead of rounding towards zero. For example, a timeout of one
microsecond is now rounded to one millisecond, instead of being rounded to
zero.
2014-01-21 01:42:11 +01:00
Victor Stinner 665486e0e7 Issue #20311: select.epoll.poll() now rounds the timeout away from zero,
instead of rounding towards zero. For example, a timeout of one microsecond is
now rounded to one millisecond, instead of being rounded to zero.
2014-01-21 01:41:00 +01:00
Victor Stinner 22463aa947 Close #20275: Optimize BaseEventLoop._run_once()
Logger.log() is "slow", logger.isEnabledFor() is faster and the logger is
disabled in most cases. A microbenchmark executing 100,000 dummy tasks is 22%
faster with this change.
2014-01-20 23:56:40 +01:00
Serhiy Storchaka c46d1faa4a Issue #20262: Warnings are raised now when duplicate names are added in the
ZIP file or too long ZIP file comment is truncated.
2014-01-20 21:59:33 +02:00
Serhiy Storchaka 9b7a1a1af6 Issue #20262: Warnings are raised now when duplicate names are added in the
ZIP file or too long ZIP file comment is truncated.
2014-01-20 21:57:40 +02:00
Serhiy Storchaka ab0ac27d24 Issue #20315: Removed support for backward compatibility with early 2.x versions.
Removed backward compatibility alias curses.window.nooutrefresh which should
be removed in 2.3.
2014-01-20 21:35:06 +02:00
Serhiy Storchaka 7e52705ee3 Issue #20315: Removed support for backward compatibility with early 2.x versions. 2014-01-20 21:29:31 +02:00
Gregory P. Smith 5a6d4bf671 Fixes Issue #20165: The unittest module no longer considers tests marked with
@expectedFailure successful if they pass.
2014-01-20 01:11:18 -08:00
Gregory P. Smith b599c61179 Fix the unittest to run properly when the working directory has
additional bits set (such as the setgid or sticky bits).
2014-01-20 01:10:33 -08:00
Benjamin Peterson c28ab08887 merge 3.3 (#18574) 2014-01-18 21:51:11 -05:00
Benjamin Peterson 044242360d fix handling of 100-continue status code (closes #18574) 2014-01-18 21:50:18 -05:00
Stefan Krah 5de3278b23 Fix test failures (--without-doc-strings). 2014-01-18 23:18:39 +01:00
R David Murray bbf18bee3c Merge #19855: restore use of LC_ALL, not LC_MESSAGES 2014-01-18 15:02:00 -05:00
R David Murray 4295353568 #19855: restore use of LC_ALL, not LC_MESSAGES
I didn't realize LC_ALL was an override, and I should have.  I tried to
make a test, but it is not clear that the LC variables actually affect
the strings that uuid is using to parse the command output.
2014-01-18 14:56:10 -05:00
Serhiy Storchaka 5d83d1a814 Issue #20270: urllib.urlparse now supports empty ports. 2014-01-18 18:31:41 +02:00
Serhiy Storchaka ff97b08d00 Issue #20270: urllib.urlparse now supports empty ports. 2014-01-18 18:30:33 +02:00
Serhiy Storchaka 2d1f092469 Issue #20244: Fixed possible file leaks when unexpected error raised in
tarfile open functions.
2014-01-18 16:28:37 +02:00
Serhiy Storchaka e413cde95f Issue #20244: Fixed possible file leaks when unexpected error raised in
tarfile open functions.
2014-01-18 16:28:08 +02:00
Serhiy Storchaka aee0e63ed0 Issue #20243: TarFile no longer raise ReadError when opened in write mode. 2014-01-18 16:14:49 +02:00
Serhiy Storchaka c2d01423e0 Issue #20243: TarFile no longer raise ReadError when opened in write mode. 2014-01-18 16:14:10 +02:00
Serhiy Storchaka 7d68a1c921 Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
2014-01-18 15:53:39 +02:00
Serhiy Storchaka 9fbec7ad5e Issue #20238: TarFile opened with external fileobj and "w:gz" mode didn't
write complete output on close.
2014-01-18 15:53:05 +02:00
Serhiy Storchaka ce644a09ac Issue #20245: The open functions in the tarfile module now correctly handle empty mode. 2014-01-18 15:37:21 +02:00
Serhiy Storchaka 53ad0cd284 Issue #20245: The open functions in the tarfile module now correctly handle empty mode. 2014-01-18 15:35:37 +02:00
Gregory P. Smith 4cfbac80bd sort os.listxattr results before comparing it to avoid depending on the ordering of the directory information in the underlying filesystem. 2014-01-17 12:01:40 -08:00
Gregory P. Smith 1093bf2c7f sort os.listxattr results before comparing it to avoid depending on the
ordering of the directory information in the underlying filesystem.
2014-01-17 12:01:22 -08:00
Larry Hastings 1abd708681 Issue #20226: Added tests for new features and regressions. 2014-01-16 14:15:03 -08:00
Larry Hastings 2a727916c5 Issue #20226: Major improvements to Argument Clinic.
* You may now specify an expression as the default value for a
  parameter!  Example: "sys.maxsize - 1".  This support is
  intentionally quite limited; you may only use values that
  can be represented as static C values.
* Removed "doc_default", simplified support for "c_default"
  and "py_default".  (I'm not sure we still even need
  "py_default", but I'm leaving it in for now in case a
  use presents itself.)
* Parameter lines support a trailing '\\' as a line
  continuation character, allowing you to break up long lines.
* The argument parsing code generated when supporting optional
  groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize,
  leading to a 850% speedup in parsing.  (Just kidding, this
  is an unmeasurable difference.)
* A bugfix for the recent regression where the generated
  prototype from pydoc for builtins would be littered with
  unreadable "=<object ...>"" default values for parameters
  that had no default value.
* Converted some asserts into proper failure messages.
* Many doc improvements and fixes.
2014-01-16 11:32:01 -08:00
Guido van Rossum e1f554490d asyncio: Reincarnate CoroWrapper's docstring as a comment. 2014-01-16 11:05:23 -08:00
Serhiy Storchaka 7f470d0f9c Issue #19936: Remove executable bits from C source files and several forgotten
test files.
2014-01-16 18:48:45 +02:00
Serhiy Storchaka 8f8ec92de8 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang lines in the unittestgui and checkpip scripts.
2014-01-16 17:33:23 +02:00
Serhiy Storchaka b992a0e102 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang line to use python3 executable in the unittestgui script.
2014-01-16 17:15:49 +02:00
Victor Stinner bac7793b5b asyncio: Fix CoroWrapper (fix my previous commit)
Add __name__ and __doc__ to __slots__
2014-01-16 01:55:29 +01:00
Victor Stinner 4d7a29c5de asyncio: Fix a typo in CoroWrapper
__slot__ => __slots__
2014-01-16 01:38:24 +01:00
Ronald Oussoren 6db6653bbc Issue #14455: Fix some issues with plistlib
* Negative integer support in binary plists was broken

* Better exception for invalid data

* Fix the versionadded/versionchanged markup in the documentation

* Add the interface cleanup to what's new for 3.4
2014-01-15 11:32:35 +01:00