Commit Graph

18859 Commits

Author SHA1 Message Date
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
Senthil Kumaran bc07ac5180 Fix localhost checking in FileHandler. Raised in #21970. 2014-07-22 00:15:20 -07: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 47ae763d28 Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:19 +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 0dee8ad579 asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:33 +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 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 ddc8c8db1c asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:14 +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 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 2b0a610297 Issue #21918: Convert test_tools.py to a sub-package of test. 2014-07-16 14:26:09 -05:00
Victor Stinner accef5ce36 asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:13 +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 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 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 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 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 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 7aee3ecd57 Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
Patch by Zachary Ware.
2014-07-11 20:42:18 +03: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 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 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 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 eb43214427 Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. 2014-07-10 11:18:00 -05: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 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 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 fd5d1b51d6 asynchat: PEP8-ify the code 2014-07-08 00:16:54 +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 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
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 6f1435c939 Issue #21881: Just omit tests for platform-specific NaN representation in test_tcl. 2014-07-07 14:57:08 +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 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
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
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 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
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
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
Zachary Ware d9de794c23 Issue #18258: Fix test discovery for test_codecmaps_*. 2014-07-01 19:55:04 -05: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 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
Berker Peksag 67ef591045 Issue #14235: Use importlib.reload() in test_cmd.test_coverage. 2014-06-30 04:04:52 +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 f951d28ac8 asyncio: sync with Tulip, add a new asyncio.coroutines module 2014-06-29 00:46:45 +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
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 b9a301a348 asyncio: Fix unit tests on Windows, escape filenames in regex 2014-06-28 00:12:02 +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 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 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 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 c4cca45baf asyncio: Oops, restore a removed test 2014-06-27 12:23:41 +02: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
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 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 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 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 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 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 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 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 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 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 c0f964fd55 inspect: Validate that __signature__ is None or an instance of Signature.
Closes #21801.
2014-06-23 10:21:04 -07: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 1580fe3fce asyncio, Tulip issue 172: only log selector timing in debug mode 2014-06-23 00:31:08 +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 7b7120e159 asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUG
environment variable is set
2014-06-23 00:12:14 +02:00
Raymond Hettinger fabefc3c5b Issue 21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks(). 2014-06-21 11:57:36 -07: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 5d82895c5e Issue #21770: Call function instead of module. Patch by Claudiu Popa. 2014-06-20 17:49:10 -04: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
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 c73701de72 asyncio: Refactor tests: add a base TestCase class 2014-06-18 01:36:32 +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 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 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 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 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 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
Nick Coghlan 5b1fdc1e37 Issue #21669: Special case print & exec syntax errors 2014-06-16 19:48:02 +10:00
Gregory P. Smith 9204e09178 fix a BytesWarning in my previous commit. 2014-06-15 20:16:01 -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 92a4055343 Issue #21774: Fix incorrect variable in xml.dom.minidom 2014-06-15 14:48:19 -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
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 bc7c96b9ea Issue #20043: Add direct test for _thread. 2014-06-13 14:23:43 -04: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
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 f10063e3c3 Issue #21310: Fixed possible resource leak in failed open(). 2014-06-09 13:32:34 +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 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 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 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 c416162302 allow the keyword else immediately after (no space) an integer (closes #21642) 2014-06-07 12:36:39 -07: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 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 8551e0f3e0 cleanup test_asyncio/test_base_events.py: cm variable was unused 2014-06-04 00:18:41 +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 b9b965f6dd Issue #21643: Updated test and fixed logic bug in lib64 symlink creation. 2014-06-03 16:47:51 +01: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 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 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 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 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 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 ffd529cde1 Explicitly wait for the child instead of letting a destructor do it. 2014-06-01 13:46:54 -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
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 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 9f1f4f40e4 Add tests for getint, getdouble and getboolean methods of the tkapp object. 2014-05-30 14:07:38 +03: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 ffc1e6d42b Issue #21493: Added test for ntpath.expanduser(). Original patch by
Claudiu Popa.
2014-05-28 18:11:29 +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 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 dd5e53a086 Issue 8743: Improve interoperability between sets and the collections.Set abstract base class. 2014-05-26 00:09:04 -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 7df417d50a Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok. 2014-05-25 16:21:45 +03: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 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 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
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
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 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 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 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 2f46a0e8be Issue #21499: Ignore __builtins__ in several test_importlib.test_api tests. 2014-05-13 12:15:42 -06: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 15bec9cb3f - Issue #17756: Fix test_code test when run from the installed location. 2014-05-13 11:28:12 +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
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
Antoine Pitrou 5e6b5f2f26 Try to fix issue #21425 workaround for shared library builds 2014-05-11 19:13:43 +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 6b4b8d0722 Try workaround for test issues in #21425 2014-05-11 16:59:16 +02:00
Antoine Pitrou 9845c7ebc5 Issue #21425: Fix flushing of standard streams in the interactive interpreter. 2014-05-11 13:42:17 +02: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 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 3d139d8ed6 asyncio: Fix the second half of issue #21447: race in _write_to_self(). 2014-05-06 14:42:40 -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
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 3d678e3b12 use with blocks to make sure files are closed 2014-05-03 20:18:50 -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 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 8fb74a35da Issue #21374: Fix pickling of DecimalTuple. 2014-04-29 18:24:50 +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 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 871dfc41d3 Issue #13204: Calling sys.flags.__new__ would crash the interpreter, now it raises a TypeError. 2014-04-28 13:07:06 +02:00
Guido van Rossum 94ba146d11 asyncio: Add __weakref__ slots to Handle and CoroWrapper. Upstream issue #166. 2014-04-27 10:44:22 -07:00
Benjamin Peterson e3083d3ad5 make operations on closed dumb databases raise a consistent exception (closes #19385)
Patch by Claudiu Popa.
2014-04-26 16:56:52 -04:00
Antoine Pitrou e472aeafc3 Issue #21207: Detect when the os.urandom cached fd has been closed or replaced, and open it anew. 2014-04-26 14:33:03 +02:00
Zachary Ware dca807b8f5 Issue #21346: Fix typo, make message consistent in test_itertools.
Pointed out by Brian Kearns.
2014-04-24 13:22:05 -05:00
Gregory P. Smith ab2719f904 fix the test on windows which has different return codes from killed
children.
2014-04-23 08:38:36 -07:00
Gregory P. Smith d65ba51e24 subprocess's Popen.wait() is now thread safe so that multiple threads
may be calling wait() or poll() on a Popen instance at the same time
without losing the Popen.returncode value.  Fixes issue #21291.
2014-04-23 00:27:17 -07:00
Antoine Pitrou cb5ec77d33 Issue #21127: Path objects can now be instantiated from str subclass instances (such as numpy.str_).
Thanks to Antony Lee for the report and preliminary patch.
2014-04-23 00:34:15 +02:00
Senthil Kumaran 6117e5d8e3 urllib.response object to use _TemporaryFileWrapper (and _TemporaryFileCloser)
facility. Provides a better way to handle file descriptor close.

Address issue #15002 . Patch contributed by Christian Theune.
2014-04-20 09:41:29 -07:00
R David Murray 9077d24d7f #12220: improve minidom error when URI contains spaces.
Fix by 'amathew', test by Marek Stepniowski.
2014-04-20 00:46:05 -04:00
Eric Snow 658af31372 Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing. 2014-04-19 00:13:23 -06:00
Guido van Rossum 0cbc76880f asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream #163). 2014-04-15 12:06:34 -07:00
doko@ubuntu.com 4a173bc4ed Fixes for KFreeBSD and the Hurd:
- Issue #21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.

- Issue #21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.

- Issue #21275: Fix a socket test on KFreeBSD.
2014-04-17 19:47:16 +02:00
Benjamin Peterson fa873f66c6 remove superfluous and useless line 2014-04-16 16:16:37 -04:00
Benjamin Peterson c844b00dec use the called property of the run_pip mock rather than an assertion method that doesn't exist 2014-04-16 16:06:39 -04:00
Antoine Pitrou c043061667 Try to fix buildbot failures on old OpenSSLs (< 1.0.0) - followup to issue #21015 2014-04-16 18:33:39 +02:00
Andrew Kuchling 45278a898c #1704474: mark refleak test as specific to CPython
Patch by Christian Hudon.
2014-04-15 16:44:43 -04:00
Senthil Kumaran d943fdee87 Run test_urllib2_localnet tests using unittest.main().
Capture threads in the setUpModule and cleanup threads in the tearDownModule.
2014-04-15 16:36:43 -04:00
doko@ubuntu.com 9574355ff3 - Issue #21223: Pass test_site/test_startup_imports when some of the extensions
are built as builtins.
2014-04-15 20:37:54 +02:00
Yury Selivanov 09cc169a03 asyncio.tasks: Make sure CoroWrapper.send proxies one argument correctly
Issue #21209.
2014-04-15 12:01:16 -04:00
Vinay Sajip 809f90f369 Reverted 16efa8d27e4c after discussion with Eric. 2014-04-15 13:52:21 +01:00
Vinay Sajip 1e53f8d9bf Issue #21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX. 2014-04-15 11:18:10 +01:00
Eric V. Smith a0d107324d Closed issue #8931: Make alternate formatting for 'c' raise an exception. Patch by Torsten Landschoff. 2014-04-15 03:05:02 -04:00
Yury Selivanov f15f7484bb asyncio.tasks: Fix CoroWrapper to workaround yield-from bug in CPython < 3.4.1
Closes issue #21209.
2014-04-14 22:21:52 -04:00
Senthil Kumaran cfdd0161ac Invoke test_urllibnet tests using unittest.main function 2014-04-14 21:31:41 -04:00
R David Murray afb151a5cc #17498: Defer SMTPServerDisconnected errors until the next command.
Normally an SMTP server will return an error, and smtplib will then issue an
RSET to return the connection to the known starting state.  Some servers,
however, disconnect after issuing certain errors.  When we issue the RSET,
this would result in raising an SMTPServerDisconnected error, *instead* of
returning the error code the user of the library was expecting.  This fix
makes the internal RSET calls ignore the disconnection so that the error code
is returned.  The user of the library will then get the SMTPServerDisconnected
error the next time they try to talk to the server.

Patch by Kushal Das.
2014-04-14 18:21:38 -04:00
Senthil Kumaran 6b3e87d38e merge heads 2014-04-14 16:45:49 -04:00
Eric V. Smith 7ce90743a1 Issue #13598: Add auto-numbering of replacement fields to string.Formatter. 2014-04-14 16:43:50 -04:00
Senthil Kumaran d8e24f1f71 Convert urllib.request parse_proxy doctests to unittests. 2014-04-14 16:32:20 -04:00
Senthil Kumaran 9da047b3a5 Issue #7776: Fix ``Host:'' header and reconnection when using http.client.HTTPConnection.set_tunnel().
Patch by Nikolaus Rath.
2014-04-14 13:07:56 -04:00
Eric V. Smith 2ea9712ee9 Issue #12546: Allow \x00 as a fill character for builtin type __format__ methods. 2014-04-14 11:55:10 -04:00
Benjamin Peterson f6e50b4a81 fix sending tuples to custom generator objects with yield from (closes #21209)
Debugged by Victor.
2014-04-13 23:52:01 -04:00
Benjamin Peterson 584f5cbf16 merge 3.3 2014-04-13 22:31:42 -04:00
Benjamin Peterson 156285c35f merge 3.2 2014-04-13 22:28:16 -04:00
Benjamin Peterson 99b5afab74 in scan_once, prevent the reading of arbitrary memory when passed a negative index
Bug reported by Guido Vranken.
2014-04-13 22:10:38 -04:00
R David Murray d5aa487cce #21169: fix getpass to use replace error handler on UnicodeEncodeError.
If the input stream encoding couldn't encode one or more of the
non-ascii characters in the prompt, it would fail, throwing a
UnicodeEncodeError.  Now if that happens we re-encoding using the
'replace' error handler.

Patch by Kushal Das.
2014-04-13 22:07:39 -04:00
Yury Selivanov 0fceaf45e2 inspect.signautre: Fix functools.partial support. Issue #21117 2014-04-08 11:28:02 -04:00