summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33578: Add getstate/setstate for CJK codec (GH-6984)Christopher Thorne2018-11-011-0/+28
| | | | | | | | This implements getstate and setstate for the cjkcodecs multibyte incremental encoders/decoders, primarily to fix issues with seek/tell. The encoder getstate/setstate is slightly tricky as the "state" is pending bytes + MultibyteCodec_State but only an integer can be returned. The approach I've taken is to encode this data into a long, similar to how .tell() encodes a "cookie_type" as a long. https://bugs.python.org/issue33578
* bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. ↵Xiang Zhang2018-10-311-0/+10
| | | | | | (GH-10217) _io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range value to the bitwise struct field.
* bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842)Alexey Izbyshev2018-10-201-1/+1
| | | | | | | | | If buffering=1 is specified for open() in binary mode, it is silently treated as buffering=-1 (i.e., the default buffer size). Coupled with the fact that line buffering is always supported in Python 2, such behavior caused several issues (e.g., bpo-10344, bpo-21332). Warn that line buffering is not supported if open() is called with binary mode and buffering=1.
* bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an ↵Zackery Spytz2018-07-171-0/+10
| | | | exception set (GH-8282)
* bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)Zackery Spytz2018-06-291-0/+11
|
* Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)Victor Stinner2018-06-261-1/+1
| | | This reverts commit 8fbbdf0c3107c3052659e166f73990b466eacbb0.
* bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)Victor Stinner2018-06-221-1/+1
| | | | | | | | * Add support.MS_WINDOWS: True if Python is running on Microsoft Windows. * Add support.MACOS: True if Python is running on Apple macOS. * Replace support.is_android with support.ANDROID * Replace support.is_jython with support.JYTHON * Cleanup code to initialize unix_shell
* bpo-33760: Fix file leaks in test_io. (GH-7361)Serhiy Storchaka2018-06-041-0/+4
|
* bpo-32964: Reuse a testing implementation of the path protocol in tests. (#5930)Serhiy Storchaka2018-03-021-11/+14
|
* bpo-32228: Reset raw_pos after unwinding the raw stream (#4858)Nitish Chandra2018-01-281-0/+17
| | | Ensure that ``truncate()`` preserves the file position (as reported by ``tell()``) after writes longer than the buffer size.
* bpo-32593: Drop FreeBSD 9 and older support (#5232)Victor Stinner2018-01-221-2/+0
| | | Drop support of FreeBSD 9 and older.
* bpo-15216: io: TextIOWrapper.reconfigure() accepts encoding, errors and ↵INADA Naoki2017-12-211-0/+117
| | | | newline (GH-2343)
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-29240: PEP 540: Add a new UTF-8 Mode (#855)Victor Stinner2017-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | * Add -X utf8 command line option, PYTHONUTF8 environment variable and a new sys.flags.utf8_mode flag. * If the LC_CTYPE locale is "C" at startup: enable automatically the UTF-8 mode. * Add _winapi.GetACP(). encodings._alias_mbcs() now calls _winapi.GetACP() to get the ANSI code page * locale.getpreferredencoding() now returns 'UTF-8' in the UTF-8 mode. As a side effect, open() now uses the UTF-8 encoding by default in this mode. * Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding in the UTF-8 Mode. * Update subprocess._args_from_interpreter_flags() to handle -X utf8 * Skip some tests relying on the current locale if the UTF-8 mode is enabled. * Add test_utf8mode.py. * _Py_DecodeUTF8_surrogateescape() gets a new optional parameter to return also the length (number of wide characters). * pymain_get_global_config() and pymain_set_global_config() now always copy flag values, rather than only copying if the new value is greater than the old value.
* bpo-22671: Clarify and test default read method implementations (#4568)Sanyam Khurana2017-12-111-2/+51
| | | Original patch written by Martin Panter, enhanced by Sanyam Khurana.
* bpo-31976: Fix race condition when flushing a file is slow. (#4331)benfogle2017-11-101-1/+30
|
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-5/+5
| | | | | | | | | | | 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.
* bpo-31479: Always reset the signal alarm in tests (#3588)Victor Stinner2017-09-191-0/+3
| | | | | | | | | | | | | * 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
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-12/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171)Oren Milman2017-08-291-0/+20
|
* bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. (#3201)Oren Milman2017-08-251-0/+8
|
* bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal ↵Oren Milman2017-08-201-0/+1
| | | | tuples. (#3119)
* Fix bpo-30526: Add TextIOWrapper.reconfigure() and a ↵Antoine Pitrou2017-06-031-0/+51
| | | | | | | | | | TextIOWrapper.write_through attribute (#1922) * Fix bpo-30526: Add TextIOWrapper.reconfigure() * Apply Nick's improved wording * Update Misc/NEWS
* bpo-30107: don't dump core on expected test_io crash (#1235)Victor Stinner2017-04-211-0/+5
| | | | | | | | | | | | | | 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']
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-0/+16
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-0/+1
| | | | present (#1130)
* bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514)Serhiy Storchaka2017-03-191-0/+20
|
* Issue #26926: Merge 3.6Xavier de Gaye2016-11-171-1/+4
|\
| * Issue #26926: Skip some test_io tests on platforms without large file supportXavier de Gaye2016-11-171-1/+4
| |
* | Issue #23214: Implement optional BufferedReader, BytesIO read1() argumentMartin Panter2016-10-201-2/+14
|/
* Use sequence repetition instead of bytes constructor with integer argument.Serhiy Storchaka2016-09-111-1/+1
|
* Fixes expected error when getting encoding while shutting down.Steve Dower2016-09-091-1/+1
|
* Fix expected error message in PyTextIOWrapperTestSteve Dower2016-09-081-1/+1
|
* Issue #27959: Prevent ImportError from escaping codec search functionSteve Dower2016-09-071-2/+1
|
* new and exciting shutdown error on windowsBenjamin Peterson2016-09-071-1/+2
|
* Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+2
|\
| * Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+2
| |
* | Issue #27186: Update os.fspath()/PyOS_FSPath() to check the returnBrett Cannon2016-06-241-1/+1
| | | | | | | | | | | | | | type of __fspath__(). As part of this change, also make sure that the pure Python implementation of os.fspath() is tested.
* | Issue #27066: Fixed SystemError if a custom opener (for open()) returns aBarry Warsaw2016-06-081-0/+16
|\ \ | |/ | | | | negative number without setting an exception.
| * Issue #27066: Fixed SystemError if a custom opener (for open()) returnsBarry Warsaw2016-06-081-0/+16
| | | | | | | | a negative number without setting an exception.
* | issue27186: add open/io.open; patch by Jelle ZijlstraEthan Furman2016-06-041-0/+26
| |
* | Issue #20699: Merge io bytes-like fixes from 3.5Martin Panter2016-05-281-14/+64
|\ \ | |/
| * Issue #20699: Document that “io” methods accept bytes-like objectsMartin Panter2016-05-281-14/+64
| | | | | | | | | | | | | | | | 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.
* | Issue #22854: Merge test fix from 3.5Martin Panter2016-03-311-1/+1
|\ \ | |/
| * Issue #22854: Fix logic for skipping testMartin Panter2016-03-311-1/+1
| |
* | Issue #22854: Merge Windows pipe skipping from 3.5Martin Panter2016-03-311-7/+7
|\ \ | |/
| * Issue #22854: Skip pipe seek tests on WindowsMartin Panter2016-03-311-2/+7
| |
* | Issue #22854: Skip pipe seekable() tests on WindowsMartin Panter2016-03-311-1/+6
| |
* | Issue #22854: Merge UnsupportedOperation fixes from 3.5Martin Panter2016-03-311-11/+105
|\ \ | |/
| * Issue #22854: Clarify documentation about UnsupportedOperation and add testsMartin Panter2016-03-311-11/+105
| | | | | | | | | | Also change BufferedReader.writable() and BufferedWriter.readable() to always return False.