Commit graph

408 commits

Author SHA1 Message Date
Sanyam Khurana
1b74f9b77a bpo-22671: Clarify and test default read method implementations (#4568)
Original patch written by Martin Panter, enhanced by Sanyam Khurana.
2017-12-11 14:42:09 +01:00
benfogle
9703f092ab bpo-31976: Fix race condition when flushing a file is slow. (#4331) 2017-11-10 22:03:40 +01:00
Victor Stinner
8c663fd60e
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.

Same change for MB and GB which become MiB and GiB.

Change the output of Tools/iobench/iobench.py.

Round also the size of the documentation from 5.5 MB to 5 MiB.
2017-11-08 14:44:44 -08:00
Victor Stinner
9abee722d4 bpo-31479: Always reset the signal alarm in tests (#3588)
* bpo-31479: Always reset the signal alarm in tests

Use "try: ... finally: signal.signal(0)" pattern to make sure that
tests don't "leak" a pending fatal signal alarm.

* Move two more alarm() calls into the try block

Fix also typo: replace signal.signal(0) with signal.alarm(0)

* Move another signal.alarm() into the try block
2017-09-19 09:36:54 -07:00
Antoine Pitrou
a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Oren Milman
ba7d736521 bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171) 2017-08-29 11:58:27 +03:00
Oren Milman
a5b4ea15b6 bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (#3201) 2017-08-25 21:14:54 +03:00
Oren Milman
1d1d3e9db8 bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119) 2017-08-20 18:35:36 +03:00
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