summaryrefslogtreecommitdiffstats
path: root/Modules/_io/iobase.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)Victor Stinner2020-04-131-2/+1
| | | | | | | | Don't access PyInterpreterState.config member directly anymore, but use new functions: * _PyInterpreterState_GetConfig() * _PyInterpreterState_SetConfig() * _Py_GetConfig()
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)Jeroen Demeyer2019-07-081-9/+8
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-4/+4
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-32388: Remove cross-version binary compatibility requirement in tp_flags ↵Antoine Pitrou2019-05-291-2/+2
| | | | | | | | (GH-4944) It is now allowed to add new fields at the end of the PyTypeObject struct without having to allocate a dedicated compatibility flag in tp_flags. This will reduce the risk of running out of bits in the 32-bit tp_flags value.
* bpo-36763: Implement the PEP 587 (GH-13592)Victor Stinner2019-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a whole new documentation page: "Python Initialization Configuration" * PyWideStringList_Append() return type is now PyStatus, instead of int * PyInterpreterState_New() now calls PyConfig_Clear() if PyConfig_InitPythonConfig() fails. * Rename files: * Python/coreconfig.c => Python/initconfig.c * Include/cpython/coreconfig.h => Include/cpython/initconfig.h * Include/internal/: pycore_coreconfig.h => pycore_initconfig.h * Rename structures * _PyCoreConfig => PyConfig * _PyPreConfig => PyPreConfig * _PyInitError => PyStatus * _PyWstrList => PyWideStringList * Rename PyConfig fields: * use_module_search_paths => module_search_paths_set * module_search_path_env => pythonpath_env * Rename PyStatus field: _func => func * PyInterpreterState: rename core_config field to config * Rename macros and functions: * _PyCoreConfig_SetArgv() => PyConfig_SetBytesArgv() * _PyCoreConfig_SetWideArgv() => PyConfig_SetArgv() * _PyCoreConfig_DecodeLocale() => PyConfig_SetBytesString() * _PyInitError_Failed() => PyStatus_Exception() * _Py_INIT_ERROR_TYPE_xxx enums => _PyStatus_TYPE_xxx * _Py_UnixMain() => Py_BytesMain() * _Py_ExitInitError() => Py_ExitStatusException() * _Py_PreInitializeFromArgs() => Py_PreInitializeFromBytesArgs() * _Py_PreInitializeFromWideArgs() => Py_PreInitializeFromArgs() * _Py_PreInitialize() => Py_PreInitialize() * _Py_RunMain() => Py_RunMain() * _Py_InitializeFromConfig() => Py_InitializeFromConfig() * _Py_INIT_XXX() => _PyStatus_XXX() * _Py_INIT_FAILED() => _PyStatus_EXCEPTION() * Rename 'err' PyStatus variables to 'status' * Convert RUN_CODE() macro to config_run_code() static inline function * Remove functions: * _Py_InitializeFromArgs() * _Py_InitializeFromWideArgs() * _PyInterpreterState_GetCoreConfig()
* bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)Marcin Niemira2019-04-221-1/+6
|
* bpo-18748: io.IOBase destructor now logs close() errors in dev mode (GH-12786)Victor Stinner2019-04-121-3/+15
| | | | | In development mode (-X dev) and in debug build, the io.IOBase destructor now logs close() exceptions. These exceptions are silent by default in release mode.
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an ↵Zackery Spytz2018-07-171-5/+7
| | | | exception set (GH-8282)
* bpo-32571: Avoid raising unneeded AttributeError and silencing it in C code ↵Serhiy Storchaka2018-01-251-25/+13
| | | | | (GH-5222) Add two new private APIs: _PyObject_LookupAttr() and _PyObject_LookupAttrId()
* bpo-31572: Get rid of PyObject_HasAttr() and _PyObject_HasAttrId() in the ↵Serhiy Storchaka2018-01-161-34/+74
| | | | _io module. (#3726)
* 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-161-2/+2
|
* 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-301-11/+4
| | | if pass `accept={int, NoneType}`.
* bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. ↵Serhiy Storchaka2017-03-211-1/+1
| | | | (#748)
* Use _PyObject_CallMethodIdObjArgs() in _ioVictor Stinner2016-12-091-1/+2
| | | | | | | | | 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.
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
|
* Issue #20699: Merge io bytes-like fixes from 3.5Martin Panter2016-05-281-2/+3
|\
| * Issue #20699: Document that “io” methods accept bytes-like objectsMartin Panter2016-05-281-2/+3
| | | | | | | | | | | | | | | | 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 UnsupportedOperation fixes from 3.5Martin Panter2016-03-311-8/+8
|\ \ | |/
| * Issue #22854: Clarify documentation about UnsupportedOperation and add testsMartin Panter2016-03-311-8/+8
| | | | | | | | | | Also change BufferedReader.writable() and BufferedWriter.readable() to always return False.
* | cleanup iobase.cVictor Stinner2016-03-191-1/+1
|/ | | | casting iobase_finalize to destructor is not needed
* Issue #9858: Add missing method stubs to _io.RawIOBase. Patch by Laura ↵Antoine Pitrou2015-05-201-0/+16
| | | | Rupprecht.
* Issue #20175: Converted the _io module to Argument Clinic.Serhiy Storchaka2015-04-161-94/+154
|
* #15840: make docs consistent by saying operations on closed files raise ↵Andrew Kuchling2014-04-161-2/+2
| | | | | | | | | | | | ValueError. Patch by Caelyn McAulay. Neither Caelyn nor I could find any cases in 2.7 or 3.4/5 where an operation on a closed stream raised IOError; generally the C implementations have a macro to check for the stream being closed, and these macros all raised ValueError. If we find any, a new bug should be opened.
* Issue #20037: Avoid crashes when doing text I/O late at interpreter shutdown.Antoine Pitrou2013-12-211-1/+3
|
* Issue #19515: Remove identifiers duplicated in the same file.Victor Stinner2013-11-121-3/+2
| | | | Patch written by Andrei Dorian Duma.
* Issue #19437: Fix _io._IOBase.close(), handle _PyObject_SetAttrId() failureVictor Stinner2013-11-071-3/+8
|
* Issue #18408: Fix iobase_readline(), handle PyByteArray_Resize() failureVictor Stinner2013-10-291-5/+8
|
* Fix use of uninitialized scalar variable, see 3f994367a979Christian Heimes2013-07-301-1/+3
| | | | CID 1058763
* Issue #18112: PEP 442 implementation (safe object finalization).Antoine Pitrou2013-07-301-40/+52
|
* Merge 3.2, Issue #17047: remove doubled words found in 2.7 to 3.4Terry Jan Reedy2013-03-111-1/+1
|\ | | | | | | Modules/*, as reported by Serhiy Storchaka and Matthew Barnett.
| * Issue #17047: remove doubled words found in 2.7 to 3.4 Modules/*,Terry Jan Reedy2013-03-111-1/+1
| | | | | | | | as reported by Serhiy Storchaka and Matthew Barnett.
* | Additional fix for issue #12268: The io module file object write methods noGregory P. Smith2013-02-011-1/+4
|\ \ | |/ | | | | longer abort early when a write system call is interrupted (EINTR).
| * Additional fix for Issue #12268: The io module file object writelines() ↵Gregory P. Smith2013-02-011-1/+4
| | | | | | | | methods no longer abort early when one of its write system calls is interrupted (EINTR).
* | #15796: merge with 3.2.Ezio Melotti2012-09-181-1/+1
|\ \ | |/
| * #15796: Fix \n in readline docstring. Patch by Serhiy Storchaka.Ezio Melotti2012-09-181-1/+1
| |
* | Fixes issue #12268: File readline, readlines and read() or readall() methodsGregory P. Smith2012-06-241-4/+19
|\ \ | |/ | | | | | | | | no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
| * Fixes issue #12268: File readline, readlines and read() or readall() methodsGregory P. Smith2012-06-241-2/+19
| | | | | | | | | | | | no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
* | use new generic __dict__ descriptor implementationsBenjamin Peterson2012-02-201-14/+1
| |
* | Replace {Get,Set,Has}AttrString with *AttrId.Martin v. Löwis2011-10-141-3/+6
| |
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-6/+6
| |
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-8/+19
|/ | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* cast to getterBenjamin Peterson2011-09-061-1/+1
|
* add a __dict__ descr for IOBase (closes #12878)Benjamin Peterson2011-09-031-0/+14
|
* (Merge 3.1) Issue #12175: RawIOBase.readall() now returns None if read()Victor Stinner2011-05-251-0/+8
|\ | | | | | | returns None.