summaryrefslogtreecommitdiffstats
path: root/Modules/_io
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-038-146/+38
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* [security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)Serhiy Storchaka2017-06-281-2/+1
| | | | | | | Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
* bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (#2285)Serhiy Storchaka2017-06-271-8/+1
| | | | | Raise a ValueError if the second argument is NULL and the wchar_t\* string contains null characters.
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-107-92/+92
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* bpo-30601: Fix a refleak in WindowsConsoleIO (#2003)Victor Stinner2017-06-081-3/+2
| | | | | Fix a reference leak in _io._WindowsConsoleIO: PyUnicode_FSDecoder() always initialize decodedname when it succeed and it doesn't clear input decodedname object.
* Fix bpo-30526: Add TextIOWrapper.reconfigure() and a ↵Antoine Pitrou2017-06-032-1/+96
| | | | | | | | | | TextIOWrapper.write_through attribute (#1922) * Fix bpo-30526: Add TextIOWrapper.reconfigure() * Apply Nick's improved wording * Update Misc/NEWS
* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when ↵Segev Finer2017-06-021-1/+1
| | | | | | | | WriteConsoleW fails (#1912) * bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails * bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails
* bpo-30228: FileIO seek() and tell() set seekable (#1384)Victor Stinner2017-05-021-15/+21
| | | | | | | FileIO.seek() and FileIO.tell() method now set the internal seekable attribute to avoid one syscall on open() (in buffered or text mode). The seekable property is now also more reliable since its value is set correctly on memory allocation failure.
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-4/+9
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-168-29/+29
|
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-8/+17
| | | | present (#1130)
* bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)Serhiy Storchaka2017-03-3016-174/+59
| | | if pass `accept={int, NoneType}`.
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-303-12/+7
|
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-1/+1
| | | | | | | | | | | * bpo-6532: Make the thread id an unsigned integer. From C API side the type of results of PyThread_start_new_thread() and PyThread_get_thread_ident(), the id parameter of PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState changed from "long" to "unsigned long". * Restore a check in thread_get_ident().
* bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ↵Serhiy Storchaka2017-03-214-4/+4
| | | | (#748)
* bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514)Serhiy Storchaka2017-03-193-8/+45
|
* bpo-29730: replace some calls to PyNumber_Check and improve some error ↵Oren Milman2017-03-123-7/+16
| | | | messages (#650)
* bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485)Serhiy Storchaka2017-03-124-11/+11
|
* bpo-29741: Clean up C implementations of BytesIO and StringIO. (#606)orenmn2017-03-104-120/+68
| | | Some BytesIO methods now accept not just int subclasses but other int-like types.
* Merge from 3.6Steve Dower2017-02-051-1/+13
|\
| * Adds precheck for console filename to fix Windows 7.Steve Dower2017-02-051-1/+13
| |
* | Merge issue #28164 and issue #29409Steve Dower2017-02-042-37/+51
|\ \ | |/
| * Issue #28164: Correctly handle special console filenames (patch by Eryk Sun)Steve Dower2017-02-041-20/+47
| |
| * Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)Steve Dower2017-02-041-17/+14
| |
* | Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | | | | | possible. Patch is writen with Coccinelle.
* | Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-175-38/+82
| | | | | | | | | | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
* | Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-178-56/+120
| | | | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments.
* | Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywordsVictor Stinner2017-01-172-2/+2
| | | | | | | | Issue #29286.
* | Merge doc fixes from 3.6Martin Panter2017-01-141-1/+1
|\ \ | |/
| * Merge doc fixes from 3.5Martin Panter2017-01-141-1/+1
| |\
| | * Fix grammar, typos and markup in documentation and code commentsMartin Panter2017-01-141-1/+1
| | | | | | | | | | | | | | | | | | * Indent versionchanged at method level, not class level * Mark up ``--help`` to avoid generating an en dash * Use forward slash in Unix command line with a dollar sign ($) prompt
* | | Issue #28768: Fix implicit declaration of function _setmode. Patch by ↵Steve Dower2016-12-281-0/+3
|\ \ \ | |/ / | | | | | | Masayuki Yamamoto
| * | Issue #28768: Fix implicit declaration of function _setmode. Patch by ↵Steve Dower2016-12-281-0/+3
| | | | | | | | | | | | Masayuki Yamamoto
* | | Use _PyObject_CallMethodIdObjArgs() in _ioVictor Stinner2016-12-095-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
* | | Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string only use the format 'O' for objects, like "(O)". _PyObject_CallMethodIdObjArgs() avoids the code to parse a format string and avoids the creation of a temporary tuple.
* | | Merge from 3.6.Serhiy Storchaka2016-12-071-1/+1
|\ \ \ | |/ /
| * | Merge from 3.5.Serhiy Storchaka2016-12-071-1/+1
| |\ \ | | |/
| | * Change order of io.UnsupportedOperation base classes.Serhiy Storchaka2016-12-071-1/+1
| | | | | | | | | | | | This makes tests passing after changes by issue #5322.
* | | Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-202-2/+2
| | | | | | | | | | | | UTF-8 represenatation of Unicode objects.
* | | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-202-3/+3
|\ \ \ | |/ / | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| * | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-202-3/+3
| | | | | | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* | | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-162-4/+4
|\ \ \ | |/ / | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-162-4/+4
| |\ \ | | |/ | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| | * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
| | | | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | | Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator whenSerhiy Storchaka2016-11-031-12/+5
|\ \ \ | |/ / | | | | | | | | | the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
| * | Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator whenSerhiy Storchaka2016-11-031-12/+5
| |\ \ | | |/ | | | | | | | | | the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
| | * Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator whenSerhiy Storchaka2016-11-031-12/+5
| | | | | | | | | | | | | | | the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
* | | Issue #23214: Implement optional BufferedReader, BytesIO read1() argumentMartin Panter2016-10-204-18/+37
|/ /
* | Issue #28162: Fixes Ctrl+Z handling in console readall()Steve Dower2016-10-081-20/+29
| |
* | Issue #28217: Adds _testconsole module to test console input. Fixes some ↵Steve Dower2016-10-032-12/+45
| | | | | | | | issues found by the tests.