Commit Graph

300 Commits

Author SHA1 Message Date
Antoine Pitrou 3c2817b688 Fix bpo-30526: Add TextIOWrapper.reconfigure() and a TextIOWrapper.write_through attribute (#1922)
* Fix bpo-30526: Add TextIOWrapper.reconfigure()

* Apply Nick's improved wording

* Update Misc/NEWS
2017-06-03 12:32:28 +02:00
Victor Stinner 2a1aed04b0 bpo-30107: don't dump core on expected test_io crash (#1235)
test_io has two unit tests which trigger a deadlock:

* test_daemon_threads_shutdown_stdout_deadlock()
* test_daemon_threads_shutdown_stderr_deadlock()

These tests call Py_FatalError() if the expected bug is triggered
which calls abort(). Use test.support.SuppressCrashReport to prevent
the creation on a core dump, to fix the warning:

Warning -- files was modified by test_io
  Before: []
  After:  ['python.core']
2017-04-21 17:59:23 +02:00
Serhiy Storchaka bf623ae884 bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)
raised an error.

Replace them with using concrete types API that never fails if appropriate.
2017-04-19 20:03:52 +03:00
Xiang Zhang 026435ce49 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) 2017-04-15 12:47:28 +08:00
Serhiy Storchaka a5af6e1af7 bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514) 2017-03-19 19:25:29 +02:00
Xavier de Gaye ac05f88582 Issue #26926: Merge 3.6 2016-11-17 09:22:43 +01:00
Xavier de Gaye 877f036950 Issue #26926: Skip some test_io tests on platforms without large file support 2016-11-17 09:20:28 +01:00
Martin Panter ccb2c0e310 Issue #23214: Implement optional BufferedReader, BytesIO read1() argument 2016-10-20 23:48:14 +00:00
Serhiy Storchaka 5f1a5187f7 Use sequence repetition instead of bytes constructor with integer argument. 2016-09-11 14:41:02 +03:00
Steve Dower 6d5cf8a73e Fixes expected error when getting encoding while shutting down. 2016-09-09 09:21:01 -07:00
Steve Dower 4cf7e482a0 Fix expected error message in PyTextIOWrapperTest 2016-09-07 17:51:30 -07:00
Steve Dower fe8f4c9e87 Issue #27959: Prevent ImportError from escaping codec search function 2016-09-07 09:31:52 -07:00
Benjamin Peterson e2ffe29738 new and exciting shutdown error on windows 2016-09-07 08:54:35 -07:00
Serhiy Storchaka bae75cf3fe Issue #19527: Fixed tests with defined COUNT_ALLOCS. 2016-07-03 22:30:49 +03:00
Serhiy Storchaka a793037d80 Issue #19527: Fixed tests with defined COUNT_ALLOCS. 2016-07-03 22:27:26 +03:00
Brett Cannon c78ca1e044 Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return
type of __fspath__().

As part of this change, also make sure that the pure Python
implementation of os.fspath() is tested.
2016-06-24 12:03:43 -07:00
Barry Warsaw 118598a072 Issue #27066: Fixed SystemError if a custom opener (for open()) returns a
negative number without setting an exception.
2016-06-08 17:54:43 -04:00
Barry Warsaw 480e28538d Issue #27066: Fixed SystemError if a custom opener (for open()) returns
a negative number without setting an exception.
2016-06-08 17:47:26 -04:00
Ethan Furman d62548afed issue27186: add open/io.open; patch by Jelle Zijlstra 2016-06-04 14:38:43 -07:00
Martin Panter c249221dfd Issue #20699: Merge io bytes-like fixes from 3.5 2016-05-28 01:07:08 +00:00
Martin Panter 6bb91f3b6e Issue #20699: Document that “io” methods accept bytes-like objects
This matches the usage of ZipFile and BufferedWriter. This still requires
return values to be bytes() objects.

Also document and test that the write() methods should only access their
argument before they return.
2016-05-28 00:41:57 +00:00
Martin Panter 0fc03186f7 Issue #22854: Merge test fix from 3.5 2016-03-31 21:06:06 +00:00
Martin Panter 3ee147ffbb Issue #22854: Fix logic for skipping test 2016-03-31 21:05:31 +00:00
Martin Panter f810767bd3 Issue #22854: Merge Windows pipe skipping from 3.5 2016-03-31 11:17:08 +00:00
Martin Panter 0950e6aef6 Issue #22854: Skip pipe seek tests on Windows 2016-03-31 10:31:30 +00:00
Martin Panter c0aab1da3b Issue #22854: Skip pipe seekable() tests on Windows 2016-03-31 10:31:30 +00:00
Martin Panter 047f3b7376 Issue #22854: Merge UnsupportedOperation fixes from 3.5 2016-03-31 08:25:59 +00:00
Martin Panter 754aab28ed Issue #22854: Clarify documentation about UnsupportedOperation and add tests
Also change BufferedReader.writable() and BufferedWriter.readable() to always
return False.
2016-03-31 07:21:56 +00:00
Victor Stinner 47b4557679 test_io: ignore DeprecationWarning on bytes path on Windows 2016-03-25 09:07:07 +01:00
Victor Stinner 633ebda3ba Issue #26637: Fix test_io
The import machinery now raises a different exception when it fails at Python
shutdown.
2016-03-25 08:57:16 +01:00
Serhiy Storchaka 94a619d48b Issue #26325: Added test.support.check_no_resource_warning() to check that
no ResourceWarning is emitted.
2016-02-11 13:11:44 +02:00
Serhiy Storchaka a84f6c3dd3 Issue #25523: Merge a-to-an corrections from 3.4. 2015-11-02 14:39:05 +02:00
Serhiy Storchaka d65c9496da Issue #25523: Further a-to-an corrections. 2015-11-02 14:10:23 +02:00
Serhiy Storchaka 0dcd80a6c0 Issue #20557: Use specific asserts in io tests. 2015-08-02 15:17:49 +03:00
Serhiy Storchaka b064f1e94f Issue #20557: Use specific asserts in io tests. 2015-08-02 15:18:28 +03:00
Antoine Pitrou 45d6156154 Issue #9858: Add missing method stubs to _io.RawIOBase. Patch by Laura Rupprecht. 2015-05-20 21:50:59 +02:00
Berker Peksag d10d6ae2fa Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:01:05 +03:00
Berker Peksag ce643913a9 Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
2015-05-06 06:33:17 +03:00
Serhiy Storchaka f24131ff31 Issue #20175: Converted the _io module to Argument Clinic. 2015-04-16 11:19:43 +03:00
Gregory P. Smith 14a88abfcc issue9859: Use an expected failure rather than a skip. 2015-04-14 13:54:09 -07:00
Gregory P. Smith 1bef9075b8 issue9859: rename CPyMatchTest to APIMismatchTest and add @support.cpython_only. 2015-04-14 13:24:34 -07:00
Gregory P. Smith 054b065f6c issue9859: Adds a CPyMatchTest test case to compare the exposed APIs
of the Python io module and the C io module.  They do not currently
match so the failing test is marked with @unittest.skip.
2015-04-14 12:58:05 -07:00
Antoine Pitrou 56452eea39 Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:02:33 +02:00
Antoine Pitrou 85e3ee749c Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:01:21 +02:00
Antoine Pitrou cb46f0ecb0 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:48:19 +02:00
Antoine Pitrou 25f85d4bd5 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:41:47 +02:00
Berker Peksag ea6d5592f2 Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
if they called on a closed object.

Patch by John Hergenroeder.
2015-05-12 17:13:56 +03:00
Serhiy Storchaka 6a69466f61 Backported tests from issue #20175. 2015-04-16 11:54:14 +03:00
Serhiy Storchaka c05e260ecb Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
2015-04-01 13:06:18 +03:00
Serhiy Storchaka 263dcd20a3 Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
2015-04-01 13:01:14 +03:00