Hai Shi
46874c26ee
bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)
Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
6 years ago
Serhiy Storchaka
1f21eaa15e
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
* 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.
6 years ago
Serhiy Storchaka
41c57b3353
bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)
Only AttributeError should be silenced.
6 years ago
Jeroen Demeyer
762f93ff2e
bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267)
7 years ago
Jeroen Demeyer
196a530e00
bpo-37483: add _PyObject_CallOneArg() function ( #14558 )
7 years ago
Jeroen Demeyer
530f506ac9
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
7 years ago
Steve Dower
b82e17e626
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
7 years ago
sth
8b91edadc0
bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). (GH-12252)
7 years ago
Victor Stinner
6d43f6f081
bpo-35713: Split _Py_InitializeCore into subfunctions (GH-11650)
* 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
7 years ago
Gregory P. Smith
3015fb8ce4
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.
Project based C Preprocessor namespacing at its finest. :P
7 years ago
Gregory P. Smith
e6c77d8301
Disable getc_unlocked() with MemorySanitizer. (GH-10499)
clang's MemorySanitizer understand getc() but does not understand
getc_unlocked(). Workaround: Don't use it on msan builds.
7 years ago
Siddhesh Poyarekar
55edd0c185
bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (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.
8 years ago
INADA Naoki
72dccde884
bpo-29548: Fix some inefficient call API usage (GH-97)
9 years ago
Serhiy Storchaka
228b12edcc
Issue #28999 : Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
9 years ago
Victor Stinner
7bfb42d5b7
Issue #28858 : Remove _PyObject_CallArg1() macro
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.
9 years ago
Serhiy Storchaka
85b0f5beb1
Added the const qualifier to char* variables that refer to readonly internal
UTF-8 represenatation of Unicode objects.
9 years ago
Victor Stinner
559bb6a713
Rename _PyObject_FastCall() to _PyObject_FastCallDict()
Issue #27809 :
* Rename _PyObject_FastCall() function to _PyObject_FastCallDict()
* Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1()
macros calling _PyObject_FastCallDict()
9 years ago
Victor Stinner
9def0901e2
PyFile_WriteObject() now uses fast call
Issue #27128 : PyFile_WriteObject() now calls _PyObject_FastCall() to avoid the
creation of a temporary tuple.
9 years ago
Victor Stinner
89719e1daf
Issue #25182 : Fix compilation on Windows
Restore also errno value before calling PyErr_SetFromErrno().
10 years ago
Serhiy Storchaka
a59018c7ab
Issue #25182 : The stdprinter (used as sys.stderr before the io module is
imported at startup) now uses the backslashreplace error handler.
10 years ago
Victor Stinner
454bd3a277
stdprinter_write(): mention the encoding
11 years ago
Victor Stinner
66aab0c4b5
Issue #23708 : Add _Py_read() and _Py_write() functions to factorize code handle
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.
11 years ago
Serhiy Storchaka
c679227e31
Issue #1772673 : The type of `char*` arguments now changed to `const char*`.
12 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
12 years ago
Victor Stinner
14b9b11098
If MS_WIN64 is defined, MS_WINDOWS is also defined: #ifdef can be simplified.
13 years ago
Serhiy Storchaka
74f49ab28b
Issue #15989 : Fix several occurrences of integer overflow
when result of PyInt_AsLong() or PyLong_AsLong() narrowed
to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
13 years ago
Serhiy Storchaka
441d30fac7
Issue #15989 : Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
13 years ago
Serhiy Storchaka
7898043868
Issue #15989 : Fix several occurrences of integer overflow
when result of PyLong_AsLong() narrowed to int without checks.
13 years ago
Benjamin Peterson
5ca88d2b18
get the core to compile --disable-unicode
13 years ago
Gregory P. Smith
b2ac4d693a
Fixes issue #12268 for file readline, readlines and read() and readinto methods.
They 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.
14 years ago
Antoine Pitrou
02a380105d
Issue #14505 : Fix file descriptor leak when deallocating file objects created with PyFile_FromString().
14 years ago
Ezio Melotti
eace3a7261
#14161 : fix compile error under Windows.
14 years ago
Ezio Melotti
11f8b6872a
#14161 : fix the __repr__ of file objects to escape the file name.
14 years ago
Martin v. Löwis
bd928fef42
Rename _Py_identifier to _Py_IDENTIFIER.
14 years ago
Nadeem Vawda
36248154a9
Issue #13159 : Replace FileIO's quadratic-time buffer growth algorithm with a linear-time one.
Also fix the builtin file class and the bz2 module, which used the same algorithm.
14 years ago
Martin v. Löwis
1ee1b6fe0d
Use identifier API for PyObject_GetAttrString.
14 years ago
Martin v. Löwis
afe55bba33
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
14 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
14 years ago
Victor Stinner
63c22fac72
Issue #7732 : Fix a crash on importing a module if a directory has the same name
than a Python module (e.g. "__init__.py"): don't close the file twice.
PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
14 years ago
Brett Cannon
b94767ff44
Issue #8914 : fix various warnings from the Clang static analyzer v254.
15 years ago
Victor Stinner
dc5554008f
Issue #9015 , #9611 : stdprinter.write() clamps the length to 2^31-1 on Windows
15 years ago
Antoine Pitrou
638cee62d5
Issue #9295 : Fix a crash under Windows when calling close() on a file
object with custom buffering from two threads at once.
15 years ago
Benjamin Peterson
bf775542b0
iterators passed to writelines() can close their files; don't segfault #10125
15 years ago
Victor Stinner
caafd77060
Issue #4947 : The write() method of sys.stdout and sys.stderr uses their
encoding and errors attributes instead of using utf-8 in strict mode, to get
the same behaviour than the print statement.
16 years ago
Victor Stinner
3603cc5fdb
Issue #9425 : PyFile_FromFd() ignores the name argument
This function is only by imp.find_module() which does return the filename in a
separated variable.
16 years ago
Antoine Pitrou
5de1594e28
Merged revisions 81275 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81275 | antoine.pitrou | 2010-05-17 21:56:59 +0200 (lun., 17 mai 2010) | 4 lines
Issue #7079 : Fix a possible crash when closing a file object while using
it from another thread. Patch by Daniel Stutzbach.
........
16 years ago
Antoine Pitrou
83137c2e16
Issue #7079 : Fix a possible crash when closing a file object while using
it from another thread. Patch by Daniel Stutzbach.
16 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines
Recorded merge of revisions 81029 via svnmerge from
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.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
Recorded merge of revisions 81029 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
c7c96a90bc
Recorded merge of revisions 81029 via svnmerge from
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.
........
16 years ago