summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-011-2/+2
| | | | | | * Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-011-2/+4
| | | Only AttributeError should be silenced.
* bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)Jeroen Demeyer2019-07-081-1/+1
|
* 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-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-1/+69
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). ↵sth2019-03-101-1/+1
| | | | (GH-12252)
* bpo-35713: Split _Py_InitializeCore into subfunctions (GH-11650)Victor Stinner2019-01-221-2/+6
| | | | | | | | | | | | | | * Split _Py_InitializeCore_impl() into subfunctions: add multiple pycore_init_xxx() functions * Preliminary sys.stderr is now set earlier to get an usable sys.stderr ealier. * Move code into _Py_Initialize_ReconfigureCore() to be able to call it from _Py_InitializeCore(). * Split _PyExc_Init(): create a new _PyBuiltins_AddExceptions() function. * Call _PyExc_Init() earlier in _Py_InitializeCore_impl() and new_interpreter() to get working exceptions earlier. * _Py_ReadyTypes() now returns _PyInitError rather than calling Py_FatalError(). * Misc code cleanup
* bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)Gregory P. Smith2018-11-131-1/+1
| | | | Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER. Project based C Preprocessor namespacing at its finest. :P
* Disable getc_unlocked() with MemorySanitizer. (GH-10499)Gregory P. Smith2018-11-131-1/+2
| | | | clang's MemorySanitizer understand getc() but does not understand getc_unlocked(). Workaround: Don't use it on msan builds.
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-3/+3
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-29548: Fix some inefficient call API usage (GH-97)INADA Naoki2017-02-161-27/+14
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-2/+1
| | | | possible. Patch is writen with Coccinelle.
* Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-1/+1
| | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
* Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-5/+3
| | | | UTF-8 represenatation of Unicode objects.
* Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-221-1/+1
| | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* PyFile_WriteObject() now uses fast callVictor Stinner2016-08-191-9/+2
| | | | | Issue #27128: PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the creation of a temporary tuple.
* (Merge 3.4) Issue #25182: Fix compilation on WindowsVictor Stinner2015-09-301-3/+6
|\
| * Issue #25182: Fix compilation on WindowsVictor Stinner2015-09-301-3/+6
| | | | | | | | Restore also errno value before calling PyErr_SetFromErrno().
* | Issue #25182: The stdprinter (used as sys.stderr before the io module isSerhiy Storchaka2015-09-301-4/+21
|\ \ | |/ | | | | imported at startup) now uses the backslashreplace error handler.
| * Issue #25182: The stdprinter (used as sys.stderr before the io module isSerhiy Storchaka2015-09-301-6/+22
| | | | | | | | imported at startup) now uses the backslashreplace error handler.
* | stdprinter_write(): mention the encodingVictor Stinner2015-03-241-3/+4
| |
* | Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handleVictor Stinner2015-03-191-17/+6
|/ | | | | | | | EINTR error and special cases for Windows. These functions now truncate the length to PY_SSIZE_T_MAX to have a portable and reliable behaviour. For example, read() result is undefined if counter is greater than PY_SSIZE_T_MAX on Linux.
* Issue #1772673: The type of `char*` arguments now changed to `const char*`.Serhiy Storchaka2013-10-191-2/+2
|
* Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-2/+2
|\ | | | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-2/+2
| | | | | | | | error messages and comments.
| * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-2/+2
| |\ | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
| | * Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-191-2/+2
| | | | | | | | | | | | | | | | | | when result of PyLong_AsLong() narrowed to int without checks. This is a backport of changesets 13e2e44db99d and 525407d89277.
* | | If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.Victor Stinner2013-06-241-1/+1
| | |
* | | Issue #15989: Fix several occurrences of integer overflowSerhiy Storchaka2013-01-141-2/+2
|/ / | | | | | | when result of PyLong_AsLong() narrowed to int without checks.
* | Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-4/+4
| |
* | Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-3/+7
| |
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-1/+2
| | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* | Implement PEP 393.Martin v. Löwis2011-09-281-11/+6
| |
* | Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon2011-02-221-2/+2
|/
* Issue #9015, #9611: stdprinter.write() clamps the length to 2^31-1 on WindowsVictor Stinner2011-01-041-2/+8
|
* Issue #9425: PyFile_FromFd() ignores the name argumentVictor Stinner2010-08-131-11/+3
| | | | | This function is only by imp.find_module() which does return the filename in a separated variable.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-372/+372
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* PyFile_FromFd() uses PyUnicode_DecodeFSDefault() instead ofVictor Stinner2010-04-301-1/+1
| | | | | PyUnicode_FromString() to support surrogates in the filename and use the right encoding
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Make stdprinter_write static.Martin v. Löwis2008-06-131-1/+1
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-6/+6
|
* Add an errors parameter to open() and TextIOWrapper() to specify error handling.Guido van Rossum2007-12-031-3/+4
|
* Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases ↵Christian Heimes2007-12-021-1/+1
| | | | in intobject.h
* Fix for #1415 pythonw.exe fails because std streams a missingChristian Heimes2007-11-131-1/+1
| | | | | | After a long discussion about the problem with Windows GUI apps Guido decided that sys.stdin, stdout and stderr should be None when the C runtime library returns invalid file descriptors for the standard streams. So far the only known cases are Windows GUI apps and scripts started with pythonw on Windows. The OS restrictions are tight enough to catch the problem on other OSes.
* Let's do as Guido says and return None instead of -1Christian Heimes2007-11-121-3/+2
|
* Stop Python code from instantiating a new stdprinter with sys.stderr.__class__()Christian Heimes2007-11-121-11/+90
| | | | Added some more methods and attributes to stdprinter to ease up debugging #1415 on Windows. It also makes the object more file like. Now it can be used as a working replacement for an io instance.
* Bug #1415Christian Heimes2007-11-101-2/+2
| | | | | | On Windows fileno(stdout) and fileno(stderr) can return an invalid file descriptor number (-2 on my machine). It happens only for pythonw.exe but not for python.exe. Catch the problem ASAP in PyFile_NewStdPrinter(). I've also removed the call to PyErr_BadInternalCall(). It was causing a seg fault because the exceptions aren't available yet.
* Merging the py3k-pep3137 branch back into the py3k branch.Guido van Rossum2007-11-061-1/+1
| | | | | | | | | | | | | | No detailed change log; just check out the change log for the py3k-pep3137 branch. The most obvious changes: - str8 renamed to bytes (PyString at the C level); - bytes renamed to buffer (PyBytes at the C level); - PyString and PyUnicode are no longer compatible. I.e. we now have an immutable bytes type and a mutable bytes type. The behavior of PyString was modified quite a bit, to make it more bytes-like. Some changes are still on the to-do list.
* Minor correction to the stdprinter object.Guido van Rossum2007-10-301-2/+4
|