Commit Graph

19401 Commits

Author SHA1 Message Date
Victor Stinner c4c464911a asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests
* signal.set_wakeup_fd() can now raise an OSError on Python 3.5
2014-07-23 18:21:45 +02:00
Serhiy Storchaka 37f50e0c6b Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
2014-07-23 18:50:19 +03:00
Serhiy Storchaka 8966759b03 Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
2014-07-23 18:49:31 +03:00
Charles-François Natali 9d8118e5c5 Issue #21901: Cap the maximum number of file descriptors to use for the test. 2014-07-22 21:29:52 +01:00
Charles-François Natali 889d6463b3 Issue #21901: Cap the maximum number of file descriptors to use for the test. 2014-07-22 21:25:03 +01:00
Serhiy Storchaka 521e5860a5 Issue #22032: __qualname__ instead of __name__ is now always used to format
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
Serhiy Storchaka 0c937b3ed6 Issue #22031: Reprs now always use hexadecimal format with the "0x" prefix
when contain an id in form " at 0x...".
2014-07-22 12:14:52 +03:00
Senthil Kumaran 284a4a1bb0 Merge 3.4
Fix localhost checking in FileHandler. Raised in #21970.
2014-07-22 00:16:18 -07:00
Senthil Kumaran bc07ac5180 Fix localhost checking in FileHandler. Raised in #21970. 2014-07-22 00:15:20 -07:00
Antoine Pitrou 26408df88f Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
2014-07-21 18:37:36 -04:00
Antoine Pitrou dfab935c74 Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
2014-07-21 18:35:01 -04:00
Victor Stinner 41323e7483 (Merge 3.4) Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:55 +02:00
Victor Stinner 47ae763d28 Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:19 +02:00
Victor Stinner 963b4bab52 Merge Python 3.4
* Issue #19811, #22022: test_pathlib uses support.rmtree() instead of
  shutil.rmtree() to remove the temporary directory.

* Issue #19629: Fix support.rmtree(), use os.lstat() to check if the file is a
  directory, not os.path.isdir()
2014-07-21 19:20:06 +02:00
Victor Stinner ec86469ca3 Issue #19811, #22022: test_pathlib uses support.rmtree() instead of
shutil.rmtree() to remove the temporary directory.
2014-07-21 19:19:05 +02:00
Victor Stinner 67f8706521 Issue #19629: Fix support.rmtree(), use os.lstat() to check if the file is a
directory, not os.path.isdir()
2014-07-21 19:18:12 +02:00
Victor Stinner a7d03d98c9 Issue #22018: Hum, set_wakeup_fd() still raises ValueError on Windows 2014-07-21 17:17:28 +02: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 38d773bd10 (Merge 3.4) asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:51 +02:00
Victor Stinner 0dee8ad579 asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:33 +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
Victor Stinner 75dada6af3 (Merge 3.4) Issue #21247: Fix a race condition in test_send_signal() of asyncio
Add a basic synchronization mechanism to wait until the child process is ready
before sending it a signal.
2014-07-17 23:49:40 +02:00
Victor Stinner 98fa332e33 Issue #21247: Fix a race condition in test_send_signal() of asyncio
Add a basic synchronization mechanism to wait until the child process is ready
before sending it a signal.
2014-07-17 23:49:11 +02:00
Victor Stinner 2fa2c3dfc5 (Merge 3.4) Python issue #21645, Tulip issue 192: Rewrite signal handling
Since Python 3.3, the C signal handler writes the signal number into the wakeup
file descriptor and then schedules the Python call using Py_AddPendingCall().

asyncio uses the wakeup file descriptor to wake up the event loop, and relies
on Py_AddPendingCall() to schedule the final callback with call_soon().

If the C signal handler is called in a thread different than the thread of the
event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In
this case, the event loop has nothing to do and go to sleep again.
Py_AddPendingCall() is called while the event loop is sleeping again and so the
final callback is not scheduled immediatly.

This patch changes how asyncio handles signals. Instead of relying on
Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on
the wakeup file descriptor. asyncio reads signal numbers from the wakeup file
descriptor to call its signal handler.
2014-07-17 22:45:42 +02:00
Victor Stinner fe5649c7b7 Python issue #21645, Tulip issue 192: Rewrite signal handling
Since Python 3.3, the C signal handler writes the signal number into the wakeup
file descriptor and then schedules the Python call using Py_AddPendingCall().

asyncio uses the wakeup file descriptor to wake up the event loop, and relies
on Py_AddPendingCall() to schedule the final callback with call_soon().

If the C signal handler is called in a thread different than the thread of the
event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In
this case, the event loop has nothing to do and go to sleep again.
Py_AddPendingCall() is called while the event loop is sleeping again and so the
final callback is not scheduled immediatly.

This patch changes how asyncio handles signals. Instead of relying on
Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on
the wakeup file descriptor. asyncio reads signal numbers from the wakeup file
descriptor to call its signal handler.
2014-07-17 22:43:40 +02:00
Victor Stinner dc2539f957 (Merge 3.4) asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:39 +02:00
Victor Stinner ddc8c8db1c asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:14 +02:00
Victor Stinner 0d35741b16 (Merge 3.4) asyncio, tulip issue 190: Process.communicate() must ignore
BrokenPipeError

If you want to handle the BrokenPipeError, you can easily reimplement
communicate().

Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
2014-07-17 12:48:33 +02:00
Victor Stinner cc996b5789 asyncio, tulip issue 190: Process.communicate() must ignore BrokenPipeError
If you want to handle the BrokenPipeError, you can easily reimplement
communicate().

Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
2014-07-17 12:25:27 +02:00
Serhiy Storchaka a98faefd68 Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-17 00:00:26 +03:00
Serhiy Storchaka 2c6a3aedeb Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-16 23:58:58 +03:00
Zachary Ware 3481e21e98 Issue #21918: Convert test_tools.py to a sub-package of test.
Merge with 3.4.
2014-07-16 14:31:51 -05:00
Zachary Ware 2b0a610297 Issue #21918: Convert test_tools.py to a sub-package of test. 2014-07-16 14:26:09 -05:00
Victor Stinner c3fcf4b360 (Merge 3.4) asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:25 +02:00
Victor Stinner accef5ce36 asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:13 +02:00
Victor Stinner f85581f6e5 (Merge 3.4) Issue #21163: Fix "destroy pending task" warning in test_wait_errors() 2014-07-16 18:50:54 +02:00
Victor Stinner e931f7b768 Issue #21163: Fix "destroy pending task" warning in test_wait_errors() 2014-07-16 18:50:39 +02:00
Victor Stinner 72f8e256f6 (Merge 3.4) asyncio: test_selector_events: remove duplicate call to
_on_handshake() method

The _SelectorSslTransport constructor already calls it.
2014-07-16 18:03:26 +02:00
Victor Stinner 1314f06293 asyncio: test_selector_events: remove duplicate call to _on_handshake() method
The _SelectorSslTransport constructor already calls it.
2014-07-16 18:02:10 +02:00
Victor Stinner b5cace8980 Issue #21645, #21985: Remove debug code 2014-07-16 10:24:27 +02:00
Victor Stinner bbbf45b08d Merge with Python 3.4 2014-07-14 22:26:57 +02:00
Victor Stinner 1cae9ec966 asyncio tests: make quiet the logs of SSL handshake failures when running tests
in debug mode
2014-07-14 22:26:34 +02:00
Victor Stinner ed589f5354 Issue #21645: test_asyncio, log debug trace into sys.__stderr__, not in
sys.stderr, to get output even if tests are run with the -j command line
option.
2014-07-14 22:04:18 +02:00
Victor Stinner 24f2a5093f Issue #21645: Add debug code to analyze a failure on FreeBSD 9 2014-07-14 21:29:23 +02:00
Victor Stinner daded80283 Merge with Python 3.4 2014-07-14 18:36:24 +02:00
Victor Stinner acdb782a83 asyncio: sync with Tulip
* Tulip issue #184: Log subprocess events in debug mode

  - Log stdin, stdout and stderr transports and protocols
  - Log process identifier (pid)
  - Log connection of pipes
  - Log process exit
  - Log Process.communicate() tasks: feed stdin, read stdout and stderr
  - Add __repr__() method to many classes related to subprocesses


* Add BaseSubprocessTransport._pid attribute. Store the pid so it is still
  accessible after the process exited. It's more convinient for debug.

* create_connection(): add the socket in the "connected to" debug log

* Clean up some docstrings and comments. Remove unused unimplemented
  _read_from_self().
2014-07-14 18:33:40 +02:00
Ned Deily 55966193f2 Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:20:15 -07:00
Ned Deily 5d0d2e6ed6 Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:16:56 -07:00
Ned Deily 217f4cd7ee Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:12:39 -07:00
Ned Deily 915a30fb0d Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:06:26 -07:00
Victor Stinner 5c6e6fc57e Issue #21932: Skip test_os.test_large_read() on 32-bit system 2014-07-12 11:03:53 +02:00
Victor Stinner 59d77e8a05 Merge with 3.4 2014-07-12 03:12:30 +02:00
Victor Stinner e912e652f8 asyncio: sync with Tulip
* Tulip issue #183: log socket events in debug mode

  - Log most important socket events: socket connected, new client, connection
    reset or closed by peer (EOF), etc.
  - Log time elapsed in DNS resolution (getaddrinfo)
  - Log pause/resume reading
  - Log time of SSL handshake
  - Log SSL handshake errors
  - Add a __repr__() method to many classes

* Fix ProactorEventLoop() in debug mode. ProactorEventLoop._make_self_pipe()
  doesn't call call_soon() directly because it checks for the current loop
  which fails, because the method is called to build the event loop.

* Cleanup _ProactorReadPipeTransport constructor. Not need to set again
  _read_fut attribute to None, it is already done in the base class.
2014-07-12 03:11:53 +02:00
Berker Peksag 6960c1a94b Issue #21906: Merge from 3.4. 2014-07-11 20:44:39 +03:00
Berker Peksag 7aee3ecd57 Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
Patch by Zachary Ware.
2014-07-11 20:42:18 +03:00
Berker Peksag d8089e0d04 Issue #16382: Improve exception message of warnings.warn() for bad category.
Initial patch by Phil Elson.
2014-07-11 19:50:25 +03:00
Victor Stinner 6e1ccfe872 Issue #21932: Ooops, os.read(fd, size) allocates a buffer of size bytes, even
if the file is much smaller. Add @bigmemtest decorator to the new
test_large_read().
2014-07-11 17:35:06 +02: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
Victor Stinner 39578d8510 (Merge 3.4) asyncio: sync with Tulip
* Tulip issue #182: Improve logs of BaseEventLoop._run_once()

  - Don't log non-blocking poll
  - Only log polling with a timeout if it gets events or if it timed out after
    more than 1 second.

* Fix some pyflakes warnings: remove unused imports
2014-07-11 11:58:52 +02:00
Victor Stinner 770e48d017 asyncio: sync with Tulip
* Tulip issue #182: Improve logs of BaseEventLoop._run_once()

  - Don't log non-blocking poll
  - Only log polling with a timeout if it gets events or if it timed out after
    more than 1 second.

* Fix some pyflakes warnings: remove unused imports
2014-07-11 11:58:33 +02:00
Victor Stinner e77b5a775a (Merge 3.4) asyncio: sync with Tulip
- CoroWrapper.__del__() now reuses repr(CoroWrapper) to log the "... was never
  yielded from" warning
- Improve CoroWrapper: copy also the qualified name on Python 3.4, not only on
  Python 3.5+
2014-07-11 01:24:33 +02:00
Victor Stinner 737c34fa85 asyncio: sync with Tulip
- CoroWrapper.__del__() now reuses repr(CoroWrapper) to log the "... was never
  yielded from" warning
- Improve CoroWrapper: copy also the qualified name on Python 3.4, not only on
  Python 3.5+
2014-07-11 01:04:16 +02:00
Victor Stinner 4f96050d25 (Merge 3.4) asyncio: sync with Tulip
- repr(Task) and repr(CoroWrapper) now also includes where these objects were
  created. If the coroutine is not a generator (don't use "yield from"), use
  the location of the function, not the location of the coro() wrapper.
- Fix create_task(): truncate the traceback to hide the call to create_task().
2014-07-11 00:23:17 +02:00
Victor Stinner c39ba7d611 asyncio: sync with Tulip
- repr(Task) and repr(CoroWrapper) now also includes where these objects were
  created. If the coroutine is not a generator (don't use "yield from"), use
  the location of the function, not the location of the coro() wrapper.
- Fix create_task(): truncate the traceback to hide the call to create_task().
2014-07-11 00:21:27 +02:00
Victor Stinner 61d368e9c9 (Merge 3.4) asyncio: sync with Tulip
- Issues #21936, #21163: Fix sporadic failures of
  test_future_exception_never_retrieved()
- Handle.cancel() now clears references to callback and args
- In debug mode, repr(Handle) now contains the location where the Handle was
  created.
2014-07-10 22:34:58 +02:00
Victor Stinner f68bd88aa6 asyncio: sync with Tulip
- Issues #21936, #21163: Fix sporadic failures of
  test_future_exception_never_retrieved()
- Handle.cancel() now clears references to callback and args
- In debug mode, repr(Handle) now contains the location where the Handle was
  created.
2014-07-10 22:32:58 +02:00
Zachary Ware fff80d984c Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. 2014-07-10 11:21:01 -05:00
Zachary Ware eb43214427 Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. 2014-07-10 11:18:00 -05:00
Berker Peksag e4857f3528 Issue #6916: Use assertWarns in test_asynchat. 2014-07-09 03:12:23 +03:00
Victor Stinner b44fc32661 (Merge 3.4) asyncion, Tulip issue 181: BaseEventLoop.create_datagram_endpoint()
now waits until protocol.connection_made() has been called. Document also why
transport constructors use a waiter.
2014-07-08 23:58:25 +02:00
Victor Stinner bfff45d611 asyncion, Tulip issue 181: BaseEventLoop.create_datagram_endpoint() now waits
until protocol.connection_made() has been called. Document also why transport
constructors use a waiter.
2014-07-08 23:57:31 +02:00
Victor Stinner 4532c43e16 Merge 3.4
asyncio: sync with Tulip

- Tulip issue 185: Add a create_task() method to event loops. The create_task()
  method can be overriden in custom event loop to implement their own task
  class. For example, greenio and Pulsar projects use their own task class. The
  create_task() method is now preferred over creating directly task using the
  Task class.
- tests: fix a warning
- fix typo in the name of a test function
- Update AbstractEventLoop: add new event loop methods; update also the unit test

Update asyncio documentation

- Document the new create_task() method
- "Hide" the Task class: point to the create_task() method for interoperability
- Rewrite the documentation of the Task class
- Document the "Pending task destroyed"
- Update output in debug mode of examples in the dev section
- Replace Task() with create_task() in examples
2014-07-08 12:43:24 +02:00
Victor Stinner 896a25ab30 asyncio: sync with Tulip
- Tulip issue 185: Add a create_task() method to event loops. The create_task()
  method can be overriden in custom event loop to implement their own task
  class. For example, greenio and Pulsar projects use their own task class. The
  create_task() method is now preferred over creating directly task using the
  Task class.
- tests: fix a warning
- fix typo in the name of a test function
- Update AbstractEventLoop: add new event loop methods; update also the unit test
2014-07-08 11:29:25 +02:00
Victor Stinner db5f8fcde6 (Merge 3.4) Issue #11259: asynchat.async_chat().set_terminator() now raises a
ValueError if the number of received bytes is negative.
2014-07-08 00:34:48 +02:00
Victor Stinner 630a4f63c5 Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError if
the number of received bytes is negative.
2014-07-08 00:26:36 +02:00
Victor Stinner 7b9328f51b (Merge 3.4) asynchat: PEP8-ify the code 2014-07-08 00:19:33 +02:00
Victor Stinner fd5d1b51d6 asynchat: PEP8-ify the code 2014-07-08 00:16:54 +02:00
Victor Stinner e8209dab6b (Merge 3.4) Issue #12523: asynchat.async_chat.push() now raises a TypeError if
it doesn't get a bytes string
2014-07-08 00:01:28 +02:00
Victor Stinner d9e810a870 Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
get a bytes string
2014-07-08 00:00:30 +02:00
Berker Peksag b132069ea4 Issue #21707: Merge with 3.4. 2014-07-07 21:30:54 +03:00
Berker Peksag a90afbc7ee Issue #21707: Fix tests on Windows. 2014-07-07 21:29:50 +03:00
Serhiy Storchaka 11116da935 Merge heads 2014-07-07 15:18:22 +03:00
Serhiy Storchaka 80dce52800 Merge heads 2014-07-07 15:11:42 +03:00
Berker Peksag 7a5a8c8f7c Issue #21707: Merge with 3.4. 2014-07-07 14:59:47 +03:00
Berker Peksag 0a0d1da987 Issue #21707: Add missing kwonlyargcount argument to ModuleFinder.replace_paths_in_code(). 2014-07-07 14:58:12 +03:00
Serhiy Storchaka 3cb4af8fbf Issue #21881: Just omit tests for platform-specific NaN representation in test_tcl. 2014-07-07 14:57:57 +03:00
Serhiy Storchaka 6f1435c939 Issue #21881: Just omit tests for platform-specific NaN representation in test_tcl. 2014-07-07 14:57:08 +03:00
Serhiy Storchaka f2c4ba1207 Issue #19593: Use specific asserts in importlib tests. 2014-07-07 14:09:43 +03:00
Serhiy Storchaka 344f8316fd Issue #19593: Use specific asserts in importlib tests. 2014-07-07 14:08:19 +03:00
Serhiy Storchaka 3bc13cc8b0 Merge heads 2014-07-07 13:46:09 +03:00
Serhiy Storchaka 66ca861f86 Issue #21881: Be more tolerant in test_tcl to not parsable by float() NaN
representations (on mips and m68k platforms).
2014-07-07 13:45:15 +03:00
Serhiy Storchaka 667abc7d42 Issue #21881: Be more tolerant in test_tcl to not parsable by float() NaN
representations (on mips and m68k platforms).
2014-07-07 13:44:33 +03:00
Benjamin Peterson 96baaae46f for some reason, you don't get the right checksum from an incremental build 2014-07-06 22:07:08 -07:00
Antoine Pitrou 006c725426 Merge pathlib fixes 2014-07-06 21:38:35 -04:00
Antoine Pitrou e50dafcd63 Issue #20639: calling Path.with_suffix('') allows removing the suffix again.
Patch by July Tikhonov.
2014-07-06 21:37:15 -04:00
Antoine Pitrou 7084e736db Issue #21714: Disallow the construction of invalid paths using Path.with_name(). Original patch by Antony Lee. 2014-07-06 21:31:12 -04:00
Benjamin Peterson 3032ed7cb1 upgrade to unicode 7.0.0 2014-07-06 13:04:20 -07:00
Berker Peksag 1c5f56a955 Issue #9554: Use modern unittest features in test_argparse.
Initial patch by Denver Coneybeare and Radu Voicilas.
2014-07-06 09:33:20 +03:00
Victor Stinner 8c57548f89 (Merge 3.4) Closes #21886, #21447: Fix a race condition in asyncio when setting
the result of a Future with call_soon(). Add an helper, a private method, to
set the result only if the future was not cancelled.
2014-07-05 15:30:42 +02:00
Victor Stinner a9acbe82e7 Closes #21886, #21447: Fix a race condition in asyncio when setting the result
of a Future with call_soon(). Add an helper, a private method, to set the
result only if the future was not cancelled.
2014-07-05 15:29:41 +02:00
Antoine Pitrou a93342b8b2 Issue #21897: Fix a crash with the f_locals attribute with closure variables when frame.clear() has been called. 2014-07-04 20:26:22 -04:00
Antoine Pitrou acc8cf2cfa Issue #21897: Fix a crash with the f_locals attribute with closure variables when frame.clear() has been called. 2014-07-04 20:24:13 -04:00
R David Murray 76e13c1c29 #15014: Add 'auth' command to implement auth mechanisms and use it in login.
Patch by Milan Oberkirch.
2014-07-03 14:47:46 -04:00
Zachary Ware d8b129f279 Closes #21151: Merge with 3.4 2014-07-03 11:03:46 -05:00
Zachary Ware ad4690fcca Issue #21151: Fixed a segfault in the winreg module.
When ``None`` was passed as a ``REG_BINARY`` value to SetValueEx,
PyMem_DEL was called on an uninitialized buffer.  Patch by John Ehresman.

(Also an incidental typo fix in a comment in test_winreg)
2014-07-03 10:58:06 -05:00
Berker Peksag f7eaa0c63c Issue #21755: Skip {Frozen,Source}_DeadlockAvoidanceTests tests when
Python is built without threads.
2014-07-03 06:25:10 +03:00
Victor Stinner b57d6a2fec (Merge 3.4) asyncio: sync with Tulip
* _UnixSubprocessTransport: fix file mode of stdin. Open stdin in write mode,
  not in read mode
* Examples: close the event loop at exit
* More reliable CoroWrapper.__del__. If the constructor is interrupted by
  KeyboardInterrupt or the coroutine objet is destroyed lately, some the
  _source_traceback attribute doesn't exist anymore.
* repr(Task): include also the future the task is waiting for
2014-07-03 00:59:28 +02:00
Victor Stinner 2dba23af71 asyncio: sync with Tulip
* _UnixSubprocessTransport: fix file mode of stdin. Open stdin in write mode,
  not in read mode
* Examples: close the event loop at exit
* More reliable CoroWrapper.__del__. If the constructor is interrupted by
  KeyboardInterrupt or the coroutine objet is destroyed lately, some the
  _source_traceback attribute doesn't exist anymore.
* repr(Task): include also the future the task is waiting for
2014-07-03 00:59:00 +02:00
Berker Peksag 3e887222aa Issue #5800: headers parameter of wsgiref.headers.Headers is now optional.
Patch by Pablo Torres Navarrete and SilentGhost.
2014-07-02 08:37:22 +03:00
Zachary Ware 509dab9ef6 Issue #18258: Fix test discovery for test_codecmaps_*. 2014-07-01 20:06:19 -05:00
Zachary Ware d9de794c23 Issue #18258: Fix test discovery for test_codecmaps_*. 2014-07-01 19:55:04 -05:00
Victor Stinner 6a75bb0d83 (Merge 3.4) asyncio: Fix test_sleep_cancel(): call_later() mock has no self parameter 2014-07-01 12:39:26 +02:00
Victor Stinner 1690ed397a asyncio: Fix test_sleep_cancel(): call_later() mock has no self parameter 2014-07-01 12:38:51 +02:00
Victor Stinner 91dd20ba60 asyncio: sync with Tulip
- Sort imports
- Simplify/optimize iscoroutine(). Inline inspect.isgenerator(obj): replace it
  with isinstance(obj, types.GeneratorType)
- CoroWrapper: check at runtime if Python has the yield-from bug #21209.  If
  Python has the bug, check if CoroWrapper.send() was called by yield-from to
  decide if parameters must be unpacked or not.
- Fix "Task was destroyed but it is pending!" warning in
  test_task_source_traceback()
2014-06-30 14:39:47 +02:00
Victor Stinner b75380f333 asyncio: sync with Tulip
- Sort imports
- Simplify/optimize iscoroutine(). Inline inspect.isgenerator(obj): replace it
  with isinstance(obj, types.GeneratorType)
- CoroWrapper: check at runtime if Python has the yield-from bug #21209.  If
  Python has the bug, check if CoroWrapper.send() was called by yield-from to
  decide if parameters must be unpacked or not.
- Fix "Task was destroyed but it is pending!" warning in
  test_task_source_traceback()
2014-06-30 14:39:11 +02:00
Victor Stinner 9dd826b30b Issue #21645: asyncio: add a watchdog in test_read_all_from_pipe_reader() for
debug
2014-06-30 12:32:59 +02:00
Berker Peksag 977c8a354c Issue #14235: Merge from 3.4. 2014-06-30 04:05:54 +03:00
Berker Peksag 67ef591045 Issue #14235: Use importlib.reload() in test_cmd.test_coverage. 2014-06-30 04:04:52 +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
Alexander Belopolsky f026dae130 Fixes #10541: regrtest -T is broken
* makes test_trace tests restore the tracefunc after they run
 * write_results() in trace module will not terminate if lnotab
   cannot be found.
2014-06-29 17:44:05 -04:00
Berker Peksag 15c6ed5239 Issue #20753: Merge with 3.4. 2014-06-29 15:56:21 +03:00
Berker Peksag ad324f6bcc Issue #20753: Skip PasswordProtectedSiteTestCase when Python is built without threads. 2014-06-29 15:54:56 +03:00
Victor Stinner 6cdcf0d5ed (Merge 3.4) asyncio: sync with Tulip, add a new asyncio.coroutines module 2014-06-29 00:47:28 +02:00
Victor Stinner f951d28ac8 asyncio: sync with Tulip, add a new asyncio.coroutines module 2014-06-29 00:46:45 +02:00
Jesus Cea 41c8da95f4 MERGE: Closes #11279: test_posix and lack of "id -G" support - less noise required? (Solaris) 2014-06-28 18:39:51 +02:00
Jesus Cea 61f32cb5b8 Closes #11279: test_posix and lack of "id -G" support - less noise required? (Solaris) 2014-06-28 18:39:35 +02: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 0882e27e2a (Merge 3.4) asyncio: Fix two "Coroutine xxx was never yielded from" messages in
tests
2014-06-28 01:19:28 +02:00
Victor Stinner 09e7590801 asyncio: Fix two "Coroutine xxx was never yielded from" messages in tests 2014-06-28 01:19:11 +02:00
Victor Stinner 875dbedd28 (Merge 3.4) asyncio: Fix unit tests on Windows, escape filenames in regex 2014-06-28 00:14:28 +02:00
Victor Stinner b9a301a348 asyncio: Fix unit tests on Windows, escape filenames in regex 2014-06-28 00:12:02 +02:00
Victor Stinner a81088ae12 (Merge 3.4) Issue #11453: asyncore: emit a ResourceWarning when an unclosed
file_wrapper object is destroyed. The destructor now closes the file if needed.
The close() method can now be called twice: the second call does nothing.
2014-06-27 23:57:19 +02:00
Victor Stinner 4d4c69dc35 Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
object is destroyed. The destructor now closes the file if needed. The close()
method can now be called twice: the second call does nothing.
2014-06-27 23:52:03 +02:00
Victor Stinner c3bc856f42 (Merge 3.4) Closes #21582: Cleanup test_asyncore. Patch written by diana.
- Use support.captured_stderr() where appropriate
- Removes some "from test.support import xxx" import and uses support.xxx
  instead.
2014-06-27 22:47:41 +02:00
Victor Stinner 252d40ef1e Closes #21582: Cleanup test_asyncore. Patch written by diana.
- Use support.captured_stderr() where appropriate
- Removes some "from test.support import xxx" import and uses support.xxx
  instead.
2014-06-27 22:44:40 +02:00
Victor Stinner eb39199f3d (Merge 3.4) asyncio, Tulip issue 137: In debug mode, save traceback where
Future, Task and Handle objects are created. Pass the traceback to
call_exception_handler() in the 'source_traceback' key.

The traceback is truncated to hide internal calls in asyncio, show only the
traceback from user code.

Add tests for the new source_traceback, and a test for the 'Future/Task
exception was never retrieved' log.
2014-06-27 13:55:28 +02:00
Victor Stinner 80f53aa9a0 asyncio, Tulip issue 137: In debug mode, save traceback where Future, Task and
Handle objects are created. Pass the traceback to call_exception_handler() in
the 'source_traceback' key.

The traceback is truncated to hide internal calls in asyncio, show only the
traceback from user code.

Add tests for the new source_traceback, and a test for the 'Future/Task
exception was never retrieved' log.
2014-06-27 13:52:20 +02:00
Victor Stinner fe4a979099 (Merge 3.4) asyncio, Tulip issue 137: In debug mode, add the traceback where
the coroutine object was created to the "coroutine ... was never yield from"
log
2014-06-27 12:29:30 +02:00
Victor Stinner bbd96c6f47 asyncio, Tulip issue 137: In debug mode, add the traceback where the coroutine
object was created to the "coroutine ... was never yield from" log
2014-06-27 12:28:41 +02:00
Victor Stinner 19b011109d (Merge 3.4) asyncio: Oops, restore a removed test 2014-06-27 12:24:14 +02:00
Victor Stinner c4cca45baf asyncio: Oops, restore a removed test 2014-06-27 12:23:41 +02:00
R David Murray 0c43ed8716 Merge #21476: Unwrap fp in BytesParser so the file isn't unexpectedly closed. 2014-06-26 13:33:05 -04:00
R David Murray c6772c4d59 #21476: Unwrap fp in BytesParser so the file isn't unexpectedly closed.
This makes the behavior match that of Parser.  Patch by Vajrasky Kok.
2014-06-26 13:31:43 -04:00
R David Murray 2f60820f4c #20295: Teach imghdr to recognize OpenEXR format images.
Patch by Martin Vignali, test by Claudiu Popa.
2014-06-26 12:27:57 -04:00
Victor Stinner f5434f73d7 (Merge 3.4) Issue #21163: Fix one more "Task was destroyed but it is pending!"
log in tests
2014-06-25 23:59:31 +02:00
Victor Stinner 72502c12a7 Issue #21163: Fix one more "Task was destroyed but it is pending!" log in tests 2014-06-25 23:57:50 +02:00
Victor Stinner 86ceffc3ef (Merge 3.4) asyncio: sync with Tulip
- Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in
  tests
- Add test to check that run_until_complete() checks the loop of the future
2014-06-25 23:33:02 +02:00
Victor Stinner 7ba4061098 asyncio: sync with Tulip
- Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in
  tests
- Add test to check that run_until_complete() checks the loop of the future
2014-06-25 23:32:25 +02:00
Victor Stinner 16b3c99141 (Merge 3.4) Issue #21163, asyncio: Fix some "Task was destroyed but it is
pending!" logs in tests
2014-06-25 23:12:58 +02:00
Victor Stinner 87f16f892c Issue #21163, asyncio: Fix some "Task was destroyed but it is pending!" logs in tests 2014-06-25 23:11:21 +02:00
Ned Deily ce38f24af8 Issue #21811: Anticipated fixes to 3.x and 2.7 for OS X 10.10 Yosemite. 2014-06-25 13:42:22 -07:00
Ned Deily 04cdfa1147 Issue #21811: Anticipated fixes to 3.x and 2.7 for OS X 10.10 Yosemite. 2014-06-25 13:36:14 -07:00
Victor Stinner 893df48682 (Merge 3.4) asyncio, Tulip issue 177: Rewite repr() of Future, Task, Handle and
TimerHandle

- Uniformize repr() output to format "<Class ...>"
- On Python 3.5+, repr(Task) uses the qualified name instead of the short name
  of the coroutine
2014-06-25 21:43:21 +02:00
Victor Stinner 975735f729 asyncio, Tulip issue 177: Rewite repr() of Future, Task, Handle and TimerHandle
- Uniformize repr() output to format "<Class ...>"
- On Python 3.5+, repr(Task) uses the qualified name instead of the short name
  of the coroutine
2014-06-25 21:41:58 +02:00
Senthil Kumaran fc0cad86c7 merge from 3.4
issue20753 - robotparser tests should not rely upon external resource when not required.

Specifically, it was relying a URL which gave HTTP 403 and used it to assert
it's methods, this changes undoes that and provides a local http server with
similar properties.

Patch contributed by Vajrasky Kok.
2014-06-25 02:58:53 -07:00
Senthil Kumaran 601d6ec693 issue20753 - robotparser tests should not rely upon external resource when not required.
Specifically, it was relying a URL which gave HTTP 403 and used it to assert
it's methods, this changes undoes that and provides a local http server with
similar properties.

Patch contributed by Vajrasky Kok.
2014-06-25 02:58:15 -07: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
Victor Stinner 5c2f5ab465 (Merge 3.4) asyncio: repr(Task) now also contains the line number even if the
coroutine is done: use the first line number of the code object instead of the
current line number of the generator frame.

The name of the coroutine is not enough because many coroutines may have the
same name. It's a common case in asyncio tests for example.
2014-06-24 22:58:23 +02:00
Victor Stinner df29c4a83d asyncio: repr(Task) now also contains the line number even if the coroutine is
done: use the first line number of the code object instead of the current line
number of the generator frame.

The name of the coroutine is not enough because many coroutines may have the
same name. It's a common case in asyncio tests for example.
2014-06-24 22:57:14 +02:00
R David Murray 24a3c72638 merge: #20155: use fake HTTP method names so windows doesn't hang the tests. 2014-06-24 16:49:04 -04:00
R David Murray 14199f9392 #20155: use fake HTTP method names so windows doesn't hang the tests.
Windows was seeing the 'GET' generated by these tests as invalid and forcibly
closing the socket, causing the test to fail.

Patch by Jeff Allen.
2014-06-24 16:39:49 -04:00
Victor Stinner 777aa64eaa (Merge 3.4) asyncio: Log an error if a Task is destroyed while it is still pending 2014-06-24 22:38:31 +02:00
Victor Stinner a02f81ff17 asyncio: Log an error if a Task is destroyed while it is still pending 2014-06-24 22:37:53 +02:00
Yury Selivanov 42407abe24 inspect: Validate that __signature__ is None or an instance of Signature.
Closes #21801.
2014-06-23 10:23:50 -07:00
Yury Selivanov c0f964fd55 inspect: Validate that __signature__ is None or an instance of Signature.
Closes #21801.
2014-06-23 10:21:04 -07:00
Victor Stinner 425aaa11d8 (Merge 3.4) asyncio, Tulip issue 171: BaseEventLoop.close() now raises an
exception if the event loop is running. You must first stop the event loop and
then wait until it stopped, before closing it.
2014-06-23 01:03:13 +02:00
Victor Stinner f328c7dc69 asyncio, Tulip issue 171: BaseEventLoop.close() now raises an exception if the
event loop is running. You must first stop the event loop and then wait until
it stopped, before closing it.
2014-06-23 01:02:37 +02:00
Victor Stinner 1217ab0e0f (Merge 3.4) asyncio, Tulip issue 172: only log selector timing in debug mode 2014-06-23 00:31:31 +02:00
Victor Stinner 1580fe3fce asyncio, Tulip issue 172: only log selector timing in debug mode 2014-06-23 00:31:08 +02:00
Victor Stinner dc8b54cdf2 (Merge 3.4) asyncio: Add an unit test to check that setting the
PYTHONASYNCIODEBUG env var enables debug mode of the event loop.
2014-06-23 00:21:09 +02:00
Victor Stinner c082ee692b asyncio: Add an unit test to check that setting the PYTHONASYNCIODEBUG env var
enables debug mode of the event loop.
2014-06-23 00:19:33 +02:00
Victor Stinner d42b49256f (Merge 3.4) asyncio: Enable the debug mode of event loops when the
PYTHONASYNCIODEBUG environment variable is set
2014-06-23 00:14:45 +02:00
Victor Stinner 7b7120e159 asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUG
environment variable is set
2014-06-23 00:12:14 +02:00
Benjamin Peterson a96fea03e8 add BufferedIOBase.readinto1 (closes #20578)
Patch by Nikolaus Rath.
2014-06-22 14:17:44 -07:00
Giampaolo Rodola' bc8197a287 merge heads 2014-06-22 12:44:05 +02:00
Giampaolo Rodola' 4f2eb81280 #6916: attempt to fix BB failure 2014-06-22 12:43:19 +02:00
Raymond Hettinger bb91c1d019 Issue 21786: Clean-up test_pydoc taking taking advantage of diffing in unittest. 2014-06-21 12:08:22 -07:00
Raymond Hettinger 986efa074e merge 2014-06-21 11:59:46 -07:00
Raymond Hettinger fabefc3c5b Issue 21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks(). 2014-06-21 11:57:36 -07:00
Giampaolo Rodola' 47177861dd merge heads 2014-06-21 13:59:25 +02:00
Giampaolo Rodola' bd0487694c #6916: raise a deprecation warning if using asynchat.fifo 2014-06-21 13:58:30 +02:00
Charles-François Natali ca7e5d3e1d Fix test_pydoc failure introduced by cddb17c4975e. Patch by Berker Peksag. 2014-06-20 23:00:22 +01:00
Charles-François Natali 8aa9e4268f Merge. 2014-06-20 22:59:32 +01:00
Charles-François Natali 57398c31c4 Fix test_pydoc failure introduced by 7aa72075d440. Patch by Berker Peksag. 2014-06-20 22:59:12 +01:00
Terry Jan Reedy d51a76f668 Merge with 3.4 2014-06-20 17:49:25 -04:00
Terry Jan Reedy 5d82895c5e Issue #21770: Call function instead of module. Patch by Claudiu Popa. 2014-06-20 17:49:10 -04:00
Charles-François Natali 6315ffa339 Merge. 2014-06-20 22:41:21 +01:00
Terry Jan Reedy af9eb9628d Issue #21768: fix NameError in test_pydescr. Patch by Claudiu Popa. 2014-06-20 15:16:35 -04:00
Terry Jan Reedy fe928de955 Issue #21768: fix type in test_pydoc, patch by Claudiu Popa. 2014-06-20 14:59:11 -04:00
Victor Stinner 0e6f52a211 asyncio, Tulip issue 105: in debug mode, log callbacks taking more than 100 ms
to be executed.
2014-06-20 17:34:15 +02: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 f4a1ffd84b (Merge 3.4) asyncio: Fix pyflakes errors
- Add a missing import
- Remove an unused import
- Remove unused variables
2014-06-18 03:27:28 +02:00
Victor Stinner 64d750b36b asyncio: Fix pyflakes errors
- Add a missing import
- Remove an unused import
- Remove unused variables
2014-06-18 03:25:23 +02:00
Victor Stinner 2b8c7a7729 (Merge 3.4) asyncio: Refactor tests: add a base TestCase class 2014-06-18 01:37:31 +02:00
Victor Stinner c73701de72 asyncio: Refactor tests: add a base TestCase class 2014-06-18 01:36:32 +02:00
Victor Stinner 185ad2d447 (Merge 3.4) asyncio: Refactor test__run_once_logging() to not rely on the exact
number of calls to time.monotonic(). Use a "fast select" and a "slow select"
instead.
2014-06-18 01:22:31 +02:00
Victor Stinner d6f02fc649 asyncio: Refactor test__run_once_logging() to not rely on the exact number of
calls to time.monotonic(). Use a "fast select" and a "slow select" instead.
2014-06-18 01:22:15 +02:00
Victor Stinner c82a4d897f (Merge 3.4) asyncio: Set __qualname__ attribute of CoroWrapper in @coroutine
decorator on Python 3.5.

- Drop __slots__ optimization of CoroWrapper to be able to set the __qualname__
  attribute.
- Add tests on __name__, __qualname__ and __module__ of a coroutine function
  and coroutine object.
- Fix test_tasks when run in debug mode (PYTHONASYNCIODEBUG env var set) on
  Python 3.3 or 3.4
2014-06-18 01:15:27 +02:00
Victor Stinner 8d3e02ef5a asyncio: Set __qualname__ attribute of CoroWrapper in @coroutine decorator on
Python 3.5

- Drop __slots__ optimization of CoroWrapper to be able to set the __qualname__
  attribute.
- Add tests on __name__, __qualname__ and __module__ of a coroutine function
  and coroutine object.
- Fix test_tasks when run in debug mode (PYTHONASYNCIODEBUG env var set) on
  Python 3.3 or 3.4
2014-06-18 01:14:59 +02:00
Victor Stinner adc7bcb93a (Merge 3.4) Issue #21723: asyncio.Queue: support any type of number (ex: float)
for the maximum size. Patch written by Vajrasky Kok.
2014-06-17 23:37:35 +02:00
Victor Stinner 66dc6b0f53 Issue #21723: asyncio.Queue: support any type of number (ex: float) for the
maximum size. Patch written by Vajrasky Kok.
2014-06-17 23:36:21 +02:00
Benjamin Peterson 2ce54c2912 merge 3.4 2014-06-16 23:16:37 -07:00
Benjamin Peterson 9db281662d merge 3.3 2014-06-16 23:16:31 -07:00
Benjamin Peterson 0fd3972a3f merge 3.2 2014-06-16 23:16:06 -07:00
Benjamin Peterson 314dc126ce expect the correct platform-dependent linesep 2014-06-16 23:15:50 -07:00
Victor Stinner 0f69e76204 (Merge 3.4) Issue #21773: Fix TestStdLib.test_pydoc() of test_enum. Patch
written by Claudiu Popa.

The print_diffs() function was not defined, using the assertEqual() is more
reliable.
2014-06-16 22:51:36 +02:00
Victor Stinner 4b0432d190 Issue #21773: Fix TestStdLib.test_pydoc() of test_enum. Patch written by
Claudiu Popa.

The print_diffs() function was not defined, using the assertEqual() is more
reliable.
2014-06-16 22:48:43 +02:00
Victor Stinner 11a584f9ec (Merge 3.4) Sync asyncio with Tulip: Fix test_tasks for Python 3.5
On Python 3.5, generator now gets their name from the function, no more from
the code. So we get the expected "notmuch" name instead of the generic "coro"
name.
2014-06-16 17:12:39 +02:00
Victor Stinner 4802c6ee55 Sync asyncio with Tulip: Fix test_tasks for Python 3.5
On Python 3.5, generator now gets their name from the function, no more from
the code. So we get the expected "notmuch" name instead of the generic "coro"
name.
2014-06-16 17:11:05 +02:00
Victor Stinner 7db27c8ed6 Issue #21205: Fix unit tests 2014-06-16 16:21:57 +02:00
Victor Stinner 40ee30181f Issue #21205: Add a new ``__qualname__`` attribute to generator, the qualified
name, and use it in the representation of a generator (``repr(gen)``). The
default name of the generator (``__name__`` attribute) is now get from the
function instead of the code. Use ``gen.gi_code.co_name`` to get the name of
the code.
2014-06-16 15:59:28 +02:00
Nick Coghlan 26171993fe Merge issue #21669 from 3.4 2014-06-16 19:49:12 +10:00
Nick Coghlan 5b1fdc1e37 Issue #21669: Special case print & exec syntax errors 2014-06-16 19:48:02 +10:00
Gregory P. Smith 8ff4dfe857 fix a BytesWarning in my previous commit. 2014-06-15 20:17:23 -07:00
Gregory P. Smith 9204e09178 fix a BytesWarning in my previous commit. 2014-06-15 20:16:01 -07:00
Gregory P. Smith 1016a6100b Isolate the subprocess test_close_fds_when_max_fd_is_lowered test so
that the rlimit calls happens in a child process rather than the
TestCase process to attempt to fix the gentoo buildbot's "Too many
open files" error.
2014-06-15 17:52:26 -07:00
Gregory P. Smith 634aa68c2b Isolate the subprocess test_close_fds_when_max_fd_is_lowered test so
that the rlimit calls happens in a child process rather than the
TestCase process to attempt to fix the gentoo buildbot's "Too many
open files" error.
2014-06-15 17:51:04 -07:00
Raymond Hettinger f46933a42f merge 2014-06-15 14:50:39 -07:00
Raymond Hettinger 92a4055343 Issue #21774: Fix incorrect variable in xml.dom.minidom 2014-06-15 14:48:19 -07:00
Raymond Hettinger badf5d839d Issue 19898: Add test for dequereviter_new.
(Patch contributed by Claudiu Popa.)
2014-06-14 20:41:22 -07:00
Benjamin Peterson ff180af057 merge 3.4 (#21766) 2014-06-14 18:41:31 -07:00
Benjamin Peterson a8c75fe31a merge 3.3 (#21766) 2014-06-14 18:41:13 -07:00
Benjamin Peterson 6cd1954c5c merge 3.2 (#21766) 2014-06-14 18:40:10 -07:00
Benjamin Peterson 73b8b1cdb8 url unquote the path before checking if it refers to a CGI script (closes #21766) 2014-06-14 18:36:29 -07: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
Terry Jan Reedy cd41e89377 Merge with 3.4 2014-06-13 15:21:01 -04:00
Terry Jan Reedy a40e6b0c94 Issue #21730: Add no-thread skip in test_socket. Patch by Berker Peksag. 2014-06-13 15:20:45 -04:00
Terry Jan Reedy eba3633f34 Merge with 3.4 2014-06-13 14:23:57 -04:00
Terry Jan Reedy bc7c96b9ea Issue #20043: Add direct test for _thread. 2014-06-13 14:23:43 -04:00
Antoine Pitrou 9e82b17e9d Issue #21711: support for "site-python" directories has now been removed from the site module (it was deprecated in 3.4). 2014-06-12 19:41:30 -04:00
Victor Stinner e7efff5bb8 (Merge 3.4) asyncio: Tulip issue 173: Enhance repr(Handle) and repr(Task)
repr(Handle) is shorter for function: "foo" instead of "<function foo at
0x...>". It now also includes the source of the callback, filename and line
number where it was defined, if available.

repr(Task) now also includes the current position in the code, filename and
line number, if available. If the coroutine (generator) is done, the line
number is omitted and "done" is added.
2014-06-12 18:39:42 +02:00
Victor Stinner 307bccc6ff asyncio: Tulip issue 173: Enhance repr(Handle) and repr(Task)
repr(Handle) is shorter for function: "foo" instead of "<function foo at
0x...>". It now also includes the source of the callback, filename and line
number where it was defined, if available.

repr(Task) now also includes the current position in the code, filename and
line number, if available. If the coroutine (generator) is done, the line
number is omitted and "done" is added.
2014-06-12 18:39:26 +02:00
R David Murray 130a566a13 Suppress a couple more DeprecationWarnings in the test suite. 2014-06-11 17:09:43 -04:00
R David Murray 475a476237 Eliminate DeprecationWarning in test_concurrent_futures. 2014-06-11 16:25:05 -04:00
R David Murray 1351ee704b #14758: Fix the fix (fix getaddrinfo in mock_socket)
I forgot to run all the affected tests when I fixed smtpd.
2014-06-11 16:10:10 -04:00
R David Murray 6ffface429 #19840: Add copy_function to shutil.move.
Patch by Claudiu Popa.
2014-06-11 14:40:13 -04:00
R David Murray 6fe56a329d #14758: add IPv6 support to smtpd.
Patch by Milan Oberkirch.
2014-06-11 13:48:58 -04:00
R David Murray 1144da5821 #19662: Eliminate warnings in other test modules that use smtpd.
Eventually these will want to convert to decode_data=False, I think.
2014-06-11 12:27:40 -04:00
R David Murray 554bcbf1b9 #19662: add decode_data to smtpd so you can get at DATA in bytes form.
Otherwise smtpd is restricted to 7bit clean data, since even if the
incoming data is actually utf-8, it will often break things to decode
it before parsing the message.

Patch by Maciej Szulik, with some adjustments (mostly the warning
support).
2014-06-11 11:18:08 -04:00
Giampaolo Rodola' 915d14190e fix issue #17552: add socket.sendfile() method allowing to send a file over a socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo Rodola'· 2014-06-11 03:54:30 +02:00
Serhiy Storchaka b398d33c65 Issue #18039: dbm.dump.open() now always creates a new database when the
flag has the value 'n'.  Patch by Claudiu Popa.
2014-06-10 21:16:00 +03:00
Victor Stinner bb2fc5b2a5 Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoop
Add BaseEventLoop._closed attribute and use it to check if the event loop was
closed or not, instead of checking different attributes in each subclass of
BaseEventLoop.

run_forever() and run_until_complete() methods now raise a RuntimeError('Event loop is
closed') exception if the event loop was closed.

BaseProactorEventLoop.close() now also cancels "accept futures".
2014-06-10 10:23:10 +02: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 eac219436c merge 3.4 (#11709) 2014-06-07 20:17:29 -07:00
Benjamin Peterson 159824ea2a make sure the builtin help function doesn't fail when sys.stdin is not a valid file (closes #11709)
Original patch by Amaury Forgeot d'Arc with a test by bdettmer.
2014-06-07 20:14:26 -07:00
Benjamin Peterson 10e847bbc7 add BufferedIOBase.readinto1 (closes #20578)
Patch by Nikolaus Rath.
2014-06-07 20:06:48 -07:00
Benjamin Peterson 9d19da701d merge 3.4 (#13223) 2014-06-07 16:47:15 -07:00
Benjamin Peterson ed1160b39c don't remove self from example code in the HTML output (closes #13223)
Patch by Víctor Terrón.
2014-06-07 16:44:00 -07:00
Benjamin Peterson edb07d28fb merge 3.4 (#21463) 2014-06-07 15:09:36 -07:00
Benjamin Peterson 3c2dca67ac in ftp cache pruning, avoid changing the size of a dict while iterating over it (closes #21463)
Patch by Skyler Leigh Amador.
2014-06-07 15:08:04 -07:00
Benjamin Peterson 3e439797ba merge 3.4 (#21642) 2014-06-07 12:39:51 -07:00
Benjamin Peterson c416162302 allow the keyword else immediately after (no space) an integer (closes #21642) 2014-06-07 12:36:39 -07:00
Guido van Rossum 2aebd4a816 Replace deprecated time.clock() with time.time(). Fixes issue #20475. 2014-06-04 11:45:05 -07:00
Victor Stinner 17f3663497 Issue #21326: Add asyncio.BaseEventLoop.is_closed() method
Add BaseEventLoop._closed attribute and use it to check if the event loop was
closed or not, instead of checking different attributes in each subclass of
BaseEventLoop.

run_forever() and run_until_complete() now raises a RuntimeError('Event loop is
closed') exception if the event loop was closed.

BaseProactorEventLoop.close() now also cancels "accept futures".
2014-06-04 01:06:24 +02:00
Victor Stinner 8526a945a0 (Merge 3.4) Fix asyncio tests on Windows: wait for the subprocess exit
Before, regrtest failed to remove the temporary test directory because the
process was still running in this directory.
2014-06-04 00:42:17 +02:00
Victor Stinner 3f9535b7f8 Fix asyncio tests on Windows: wait for the subprocess exit
Before, regrtest failed to remove the temporary test directory because the
process was still running in this directory.
2014-06-04 00:42:04 +02:00
Victor Stinner c3816b70e0 (Merge 3.4) Issue #21651: Fix ResourceWarning when running asyncio tests on
Windows. Patch written by Claudiu Popa.
2014-06-04 00:23:43 +02:00
Victor Stinner 27d411255a Issue #21651: Fix ResourceWarning when running asyncio tests on Windows.
Patch written by Claudiu Popa.
2014-06-04 00:23:26 +02:00
Victor Stinner b18b2d797b (Merge 3.4) cleanup test_asyncio/test_base_events.py: cm variable was unused 2014-06-04 00:19:21 +02:00
Victor Stinner 8551e0f3e0 cleanup test_asyncio/test_base_events.py: cm variable was unused 2014-06-04 00:18:41 +02:00
Victor Stinner b470f0dd2a Merge 3.4: Issue #21119, fix ResourceWarning in asyncio
* Make sure that socketpair() close sockets on error. Close the listening
  socket if sock.bind() raises an exception.
* asyncio now closes sockets on errors. Fix ResourceWarning:
  create_connection(), create_datagram_endpoint() and create_unix_server()
  methods of event loop now close the newly created socket on error.
2014-06-04 00:13:31 +02:00
Victor Stinner a9fa2664ab Issue #21119: asyncio: Make sure that socketpair() close sockets on error
Close the listening socket if sock.bind() raises an exception.
2014-06-04 00:12:28 +02:00
Victor Stinner 223a624158 Issue #21119: asyncio now closes sockets on errors
Fix ResourceWarning: create_connection(), create_datagram_endpoint() and
create_unix_server() methods of event loop now close the newly created socket
on error.
2014-06-04 00:11:52 +02:00
Vinay Sajip 4e9ae15967 Closes #21643: Merged fix from 3.4. 2014-06-03 16:48:39 +01:00
Vinay Sajip b9b965f6dd Issue #21643: Updated test and fixed logic bug in lib64 symlink creation. 2014-06-03 16:47:51 +01:00
Zachary Ware e7e1375e57 Issue #18492: Merge with 3.4 2014-06-02 16:04:25 -05:00
Zachary Ware 66f2928479 Issue #18492: Allow all resources when tests are not run by regrtest.py.
This changeset also includes cleanup allowed by this behavior change.
2014-06-02 16:01:29 -05: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 8dd49fe09f Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled
does not crash.
2014-06-02 21:36:59 +02:00
Victor Stinner 8ff373714c (Merge 3.4) Issue #21636: Fix test_logging, skip UNIX stream (AF_UNIX) tests on
Windows. Patch written by Claudiu Popa.
2014-06-02 14:43:24 +02:00
Victor Stinner ec5a860e60 Issue #21636: Fix test_logging, skip UNIX stream (AF_UNIX) tests on Windows.
Patch written by Claudiu Popa.
2014-06-02 14:41:51 +02:00
Victor Stinner f849f46487 (Merge 3.4) Issue #21634: Fix pystone micro-benchmark: use floor division
instead of true division to benchmark integers instead of floating point
numbers. Set pystone version to 1.2. Patch written by Lennart Regebro.
2014-06-02 14:18:15 +02:00
Victor Stinner d4d39c761c Issue #21634: Fix pystone micro-benchmark: use floor division instead of true
division to benchmark integers instead of floating point numbers. Set pystone
version to 1.2. Patch written by Lennart Regebro.
2014-06-02 14:16:44 +02:00
Gregory P. Smith f2538e1bae Skip test_subprocess test_close_fds_when_max_fd_is_lowered on FreeBSD
when fdescfs is not mounted on /dev/fd.
2014-06-01 15:28:11 -07:00
Gregory P. Smith d04f699498 Skip test_subprocess test_close_fds_when_max_fd_is_lowered on FreeBSD
when fdescfs is not mounted on /dev/fd.
2014-06-01 15:27:28 -07:00
Gregory P. Smith 69b778df5d Attempt to fix the "too many open files" errors on several of the
buildbots that the new test_close_fds_when_max_fd_is_lowered test causes.
It now leaves 10 more low fd's available.
2014-06-01 15:16:16 -07:00
Gregory P. Smith 8fed4deb44 Attempt to fix the "too many open files" errors on several of the
buildbots that the new test_close_fds_when_max_fd_is_lowered test causes.
It now leaves 10 more low fd's available.
2014-06-01 15:15:44 -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 ffd529cde1 Explicitly wait for the child instead of letting a destructor do it. 2014-06-01 13:46:54 -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
Vinay Sajip 1feedb43be Closes #21583: Improved test_logging. Thanks to Diana Joan Clarke for the patch. 2014-05-31 08:19:12 +01:00
Brett Cannon 2a17bde930 Issue #20383: Introduce importlib.util.module_from_spec().
Along the way, dismantle importlib._bootstrap._SpecMethods as it was
no longer relevant and constructing the new function required
partially dismantling the class anyway.
2014-05-30 14:55:29 -04:00
Serhiy Storchaka 17158306d8 Test correct getXXX methods in Tkinter bigmem tests.
Tk.getint is just int, true Tk wrapper is available as Tk.tk.getint.
2014-05-30 15:55:12 +03:00
Serhiy Storchaka aecfa9ead9 Test correct getXXX methods in Tkinter bigmem tests.
Tk.getint is just int, true Tk wrapper is available as Tk.tk.getint.
2014-05-30 15:54:35 +03: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 88c56cbba5 Add tests for getint, getdouble and getboolean methods of the tkapp object. 2014-05-30 14:08:49 +03:00
Serhiy Storchaka 9f1f4f40e4 Add tests for getint, getdouble and getboolean methods of the tkapp object. 2014-05-30 14:07:38 +03:00
Raymond Hettinger 35db43955c Issue #13742: Add key and reverse parameters to heapq.merge() 2014-05-30 02:28:36 -07:00
Gregory P. Smith e7bfe13635 Fix issue #14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a struct.unpack
error bubble up as this "bad data" appears in many real world zip files in the
wild and is ignored by other zip tools.
2014-05-29 23:42:47 -07:00
Gregory P. Smith 0af8a86be8 Fix issue #14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a struct.unpack
error bubble up as this "bad data" appears in many real world zip files in the
wild and is ignored by other zip tools.
2014-05-29 23:42:14 -07:00
Serhiy Storchaka af984de923 Issue #21493: Added test for ntpath.expanduser(). Original patch by
Claudiu Popa.
2014-05-28 18:14:03 +03:00
Serhiy Storchaka ffc1e6d42b Issue #21493: Added test for ntpath.expanduser(). Original patch by
Claudiu Popa.
2014-05-28 18:11:29 +03:00
Andrew Svetlov a5f6ef8457 Fix for raising exception not derived from BaseException in _SelectorSslTransport.resume_reading 2014-05-27 21:25:31 +03:00
Andrew Svetlov 3207a03035 Fix for raising exception not derived from BaseException in _SelectorSslTransport.resume_reading 2014-05-27 21:24:43 +03:00
Raymond Hettinger 79cae680a3 merge 2014-05-26 00:44:35 -07:00
Raymond Hettinger dea46ec965 Issue #21481: Teach argparse equality tests to return NotImplemented when comparing to unknown types. 2014-05-26 00:43:27 -07:00
Raymond Hettinger aa92d342f1 merge 2014-05-26 00:14:14 -07:00
Raymond Hettinger dd5e53a086 Issue 8743: Improve interoperability between sets and the collections.Set abstract base class. 2014-05-26 00:09:04 -07:00
Raymond Hettinger 2d452ee166 Issue 15246: Improve test coverage for collections.abc.Set. (Contributed by James King). 2014-05-25 18:28:39 -07:00
Raymond Hettinger 62f4dad816 Issue 21137: Better repr for threading.Lock() 2014-05-25 18:22:35 -07:00
Raymond Hettinger d58a0b6876 merge 2014-05-25 17:28:38 -07:00
Raymond Hettinger 978c6abced Issue 13355: Make random.triangular degrade gracefully when low == high. 2014-05-25 17:25:27 -07:00
Serhiy Storchaka 89b49a9e30 Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok. 2014-05-25 16:22:20 +03:00
Serhiy Storchaka 7df417d50a Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok. 2014-05-25 16:21:45 +03:00
Serhiy Storchaka 2f8dca735e Issue #20197: Added support for the WebP image type in the imghdr module.
Patch by Fabrice Aneche and Claudiu Popa.
2014-05-25 11:45:37 +03:00
Brett Cannon 17f9cc07f3 Merge for issue #14710 2014-05-23 12:32:30 -04:00
Brett Cannon 8447c703d1 Issue #14710: Fix both pkgutil.find_loader() and get_loader() to not
raise an exception when a module doesn't exist.

Thanks to Pavel Aslanov for the bug report.
2014-05-23 12:30:37 -04:00
Serhiy Storchaka c083537b87 Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
2014-05-23 16:15:06 +03:00
Serhiy Storchaka 065266450e Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
2014-05-23 16:13:33 +03:00
Antoine Pitrou 5c8008e59d Issue #21523: Fix over-pessimistic computation of the stack effect of some opcodes in the compiler.
This also fixes a quadratic compilation time issue noticeable when compiling
code with a large number of "and" and "or" operators.
2014-05-23 11:47:32 +02:00
Antoine Pitrou 9961405ed1 Issue #21523: Fix over-pessimistic computation of the stack effect of some opcodes in the compiler.
This also fixes a quadratic compilation time issue noticeable when compiling
code with a large number of "and" and "or" operators.
2014-05-23 11:46:03 +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
Victor Stinner 1c4398f880 (Merge 3.4) asyncio: test_base_events: use mock.Mock instead of
unittest.mock.Mock to simplify the synchronization with Trollius
2014-05-20 15:57:32 +02:00
Victor Stinner 93668f4459 asyncio: test_base_events: use mock.Mock instead of unittest.mock.Mock to
simplify the synchronization with Trollius
2014-05-20 15:57:08 +02:00
Brian Quinlan 20efceb757 Issue #21362: concurrent.futures does not validate that max_workers is proper 2014-05-17 13:51:10 -07:00
Eric Snow 3497c0bf95 Issue #21503: Use test_both() consistently in test_importlib. 2014-05-16 11:40:40 -06:00
Eric Snow d50cee2045 Fix a small typo in test_importlib. 2014-05-16 11:22:05 -06:00
Victor Stinner 0d4e01ca07 Issue #13916: Fix surrogatepass error handler on Windows 2014-05-16 14:46:20 +02:00
Serhiy Storchaka 88d8fb6af6 Issue #13916: Disallowed the surrogatepass error handler for non UTF-*
encodings.
2014-05-15 14:37:42 +03: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
Serhiy Storchaka b9183bb4fd Issue #21075: fileinput.FileInput now reads bytes from standard stream if
binary mode is specified.  Patch by Sam Kimbrel.
2014-05-14 21:11:08 +03:00
Serhiy Storchaka 946cfc3e23 Issue #21075: fileinput.FileInput now reads bytes from standard stream if
binary mode is specified.  Patch by Sam Kimbrel.
2014-05-14 21:08:33 +03: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
Eric Snow e1c9e5270a Merge from 3.4 (for #21499). 2014-05-13 12:18:07 -06:00
Eric Snow 2f46a0e8be Issue #21499: Ignore __builtins__ in several test_importlib.test_api tests. 2014-05-13 12:15:42 -06:00
Guido van Rossum c7188e2690 Merge 3.4->default: Fix test-order-dependend asyncio test failure caused by rev 2af5a52b9b87 (in this branch). 2014-05-13 09:21:33 -07:00
Guido van Rossum 7664eb0297 Fix test-order-dependend asyncio test failure caused by rev 909ea8cc86bbab92dbb6231668f403b7360f30fa. 2014-05-13 09:19:39 -07:00
doko@ubuntu.com 987831c945 Merge from 3.4:
- Issue #17756: Fix test_code test when run from the installed location.
2014-05-13 11:30:17 +02:00
doko@ubuntu.com 15bec9cb3f - Issue #17756: Fix test_code test when run from the installed location. 2014-05-13 11:28:12 +02:00
Antoine Pitrou 43e3d9409d Issue #19775: Add a samefile() method to pathlib Path objects.
Initial patch by Vajrasky Kok.
2014-05-13 10:50:15 +02:00
Victor Stinner 66113bb74a (Merge 3.4) Issue #21422: Add a test to check that bool << int and bool >> int
return an int
2014-05-12 22:43:07 +02:00
Victor Stinner 7fe1049fcb Issue #21422: Add a test to check that bool << int and bool >> int return an int 2014-05-12 22:35:40 +02:00
Antoine Pitrou 5fb195f854 Issue #16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an (address, netmask) tuple argument, so as to easily construct network objects from existing addresses. 2014-05-12 20:36:46 +02:00
Guido van Rossum 3b5162d05d Merge 3.4->default: asyncio: Fix upstream issue 168: StreamReader.read(-1) from pipe may hang if data exceeds buffer limit. 2014-05-12 10:05:04 -07:00
Guido van Rossum bf88ffba5e asyncio: Fix upstream issue 168: StreamReader.read(-1) from pipe may hang if data exceeds buffer limit. 2014-05-12 10:04:37 -07:00
Raymond Hettinger 234fb2d503 Issue 21424: Apply the nlargest() optimizations to nsmallest() as well. 2014-05-11 14:21:23 -07:00
Antoine Pitrou 5e6b5f2f26 Try to fix issue #21425 workaround for shared library builds 2014-05-11 19:13:43 +02:00
Antoine Pitrou ffef2447ee Try to fix issue #21425 workaround for shared library builds 2014-05-11 19:13:43 +02:00
Antoine Pitrou 5006a56e39 Fix printing out error message when test fails and run with -bb 2014-05-11 19:05:50 +02:00
Antoine Pitrou dab4e8a02d Fix printing out error message when test fails and run with -bb 2014-05-11 19:05:23 +02:00
Antoine Pitrou 4f23472fc2 Remove debugging output 2014-05-11 17:29:57 +02:00
Antoine Pitrou 6b4b8d0722 Try workaround for test issues in #21425 2014-05-11 16:59:16 +02:00
Antoine Pitrou bb62c18ec9 Try workaround for test issues in #21425 2014-05-11 16:59:16 +02:00
Antoine Pitrou ffd72737d3 Fix debugging output to work with -W 2014-05-11 16:36:22 +02:00
Antoine Pitrou c1b22d9c22 Fix debugging output to work with -bb 2014-05-11 16:24:45 +02:00
Antoine Pitrou 0a44a0b827 Add debugging output for #21425 2014-05-11 16:09:15 +02:00
Antoine Pitrou 1c33280c95 Issue #21425: Fix flushing of standard streams in the interactive interpreter. 2014-05-11 13:43:31 +02:00
Antoine Pitrou 9845c7ebc5 Issue #21425: Fix flushing of standard streams in the interactive interpreter. 2014-05-11 13:42:17 +02: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
Eli Bendersky f84866c9af Issue #19655: Add tests for the new asdl parser.
This unit test runs only for source builds of Python, similarly to test_tools.
2014-05-09 19:03:25 -07:00
Brett Cannon 732ac654c8 Issue #19721: Consolidate test_importlib utility code into a single
module.
2014-05-09 14:32:57 -04:00
Brett Cannon 91795c8e34 Issue #20776: Flesh out tests for importlib.machinery.PathFinder. 2014-05-09 13:38:11 -04: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
Guido van Rossum 5dcad2c8f3 Merge 3.4->default: asyncio: Fix the second half of issue #21447: race in _write_to_self(). 2014-05-06 14:45:39 -07:00
Guido van Rossum 3d139d8ed6 asyncio: Fix the second half of issue #21447: race in _write_to_self(). 2014-05-06 14:42:40 -07:00
Tim Golden e0bd2c5fad Issue21440 Use support.rmtree in test_zipfile & test_tarfile 2014-05-06 13:24:26 +01: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 53d2c41f77 Issue #19414: Have the OrderedDict mark deleted links as unusable.
This gives an earlier and more visible failure if a link is deleted
during iteration.
2014-05-03 21:58:45 -07:00
Ned Deily 71ac07f8ba Issue #18604: merge from 3.4 2014-05-03 19:25:34 -07:00
Ned Deily 88b5b6ddf6 Issue #18604: Skip the Tk instantiation test on OS X because it can
cause GUI tests to segfault in Cocoa Tk when run under regrtest -j
(multiple threads running subprocesses).
2014-05-03 19:24:05 -07:00
Benjamin Peterson 98baa14109 merge 3.4 2014-05-03 20:18:56 -04:00
Benjamin Peterson 3d678e3b12 use with blocks to make sure files are closed 2014-05-03 20:18:50 -04:00
Benjamin Peterson 644bb49a45 merge 3.4 (#21357) 2014-05-03 20:16:59 -04:00
Benjamin Peterson f24600eb64 improve test coverage of filecmp (closes #21357)
Patch by Diana Clarke.
2014-05-03 20:07:16 -04:00
Zachary Ware cb2ad801ac Closes #18604: Merge with 3.4 2014-05-02 10:52:12 -05:00
Zachary Ware ceced6bfea Issue #18604: Consolidated checks for GUI availability.
test_support._is_gui_available is now defined the same way on every
platform, and now includes the Windows-specific check that had been in the
Windows version of _is_gui_available and the OSX-specific check that was
in tkinter.test.support.check_tk_availability.  Also, every platform
checks whether Tk can be instantiated (if the platform-specific checks
passed).
2014-05-02 10:51:07 -05:00
Stefan Krah 6b794b8b59 Fix typo and tests without docstrings. 2014-05-01 17:42:33 +02:00
Stefan Krah 5de1f82464 Issue #21407: _decimal now supports function signatures. 2014-05-01 15:53:42 +02:00
Stefan Krah b151f8f60b Issue #10650: Remove the non-standard 'watchexp' parameter from the
Decimal.quantize() method in the Python version.  It had never been
present in the C version.
2014-04-30 19:15:38 +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
Jesus Cea ae43046b61 MERGE: Closes issue #21316: mark test_devpoll to be meaningfull only for Solaris 2014-04-29 18:18:58 +02:00
Jesus Cea da25109fbc Closes issue #21316: mark test_devpoll to be meaningfull only for Solaris 2014-04-29 18:18:37 +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 3f73e4c715 Fix failure in test_poplib after issue #20951. 2014-04-29 10:27:09 +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 b4bebdafe3 Issue #20951: SSLSocket.send() now raises either SSLWantReadError or SSLWantWriteError on a non-blocking socket if the operation would block. Previously, it would return 0.
Patch by Nikolaus Rath.
2014-04-29 10:03:28 +02:00
Giampaolo Rodola' 7971286b6e merge heads 2014-04-29 02:04:14 +02:00
Giampaolo Rodola' 8af740c46a fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr__ cheap inheritance hack. 2014-04-29 02:03:40 +02:00
Antoine Pitrou 05da1ef40a Issue #18727: improve test coverage of the csv module by testing for DictWriter.writerows.
Patch by Muhammad Jehanzeb.
2014-04-29 01:58:06 +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