- 23 Nov, 2018 3 commits
-
-
Victor Stinner authored
bpo-34523, bpo-35290: C locale coercion now resets the Python internal "force ASCII" mode. This change fix the filesystem encoding on FreeBSD CURRENT, which has a new "C.UTF-8" locale, when the UTF-8 mode is disabled. Add _Py_ResetForceASCII(): _Py_SetLocaleFromEnv() now calls it.
-
Victor Stinner authored
-
Victor Stinner authored
Add pycore_fileutils.h and pycore_object.h to Makefile.pre.in and to the pythoncore project of PCbuild/.
-
- 22 Nov, 2018 11 commits
-
-
Victor Stinner authored
Partially revert commit 5f2df88b: add "#undef Yield" to .c files after including Python-ast.h. Fix the warning: winbase.h(102): warning C4005: 'Yield': macro redefinition
-
Victor Stinner authored
If _PyObject_Dump() detects that the object is freed, don't try to dump it (exit immediately). Enhance also _PyObject_IsFreed(): it now detects if the pointer itself looks like freed memory.
-
Victor Stinner authored
os_read_impl() now also truncates the size to _PY_READ_MAX on macOS, to avoid to allocate a larger buffer even if _Py_read() is limited to _PY_READ_MAX bytes (ex: INT_MAX on macOS).
-
Victor Stinner authored
When iterating using asdl_seq_LEN(), use 'Py_ssize_t' type instead of 'int' for the iterator variable, to avoid downcast on 64-bit platforms. _Py_asdl_int_seq_new() now also ensures that the index is greater than or equal to 0.
-
Victor Stinner authored
CryptGenRandom() maximum size is PY_DWORD_MAX, not INT_MAX. Use DWORD type for the 'chunk' variable Co-Authored-By: Jeremy Kloth <jeremy.kloth@gmail.com>
-
Victor Stinner authored
Explicit cast a pointer difference (intptr_t) to int to fix two warnings on 64-bit Windows: Modules\pyexpat.c(1181): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data Modules\pyexpat.c(1192): warning C4244: 'initializing': conversion from '__int64' to 'int', possible loss of data
-
Victor Stinner authored
Fixed the following compiler warning in multibytecodec.c: warning C4244: '=': conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data Cast Py_ssize_t to unsigned char: the maximum value is checked on the previous line.
-
Victor Stinner authored
Don't pass void* to Python macros: use _PyObject_CAST().
-
Victor Stinner authored
Don't pass complex expressions but regular variables to Python macros. * _datetimemodule.c: split single large "if" into two "if" in date_new(), time_new() and datetime_new(). * _pickle.c, load_extension(): flatten complex "if" expression into more regular C code. * _ssl.c: addbool() now uses a temporary bool_obj to only evaluate the value once. * weakrefobject.c: replace "Py_INCREF(result = proxy);" with "result = proxy; Py_INCREF(result);"
-
Victor Stinner authored
Add _PyObject_CAST() and _PyVarObject_CAST() macros to cast argument to PyObject* and PyVarObject* properly.
-
Victor Stinner authored
* Add _PyObject_ASSERT_FROM() and _PyObject_ASSERT_FAILED_MSG() macros. * PyObject_GC_Track() now calls _PyObject_ASSERT_FAILED_MSG(), instead of Py_FatalError(), if the object is already tracked, to dump more information on error. * _PyObject_GC_TRACK() no longer checks if the object is already tracked at runtime, use an assertion instead for best performances; PyObject_GC_Track() still checks at runtime. * pycore_object.h now includes pycore_pystate.h. * Convert _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() macros to inline functions.
-
- 21 Nov, 2018 6 commits
-
-
Victor Stinner authored
Enhance _PyObject_AssertFailed() * Exchange 'expr' and 'msg' parameters * 'expr' and 'func' arguments can now be NULL
-
Victor Stinner authored
Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
-
Victor Stinner authored
Call setitimer() before each test method, instead of once per test case, to ensure that signals are sent in each test method. Previously, only the first method of a testcase class got signals. Changes: * Replace setUpClass() with setUp() and replace tearDownClass() with tearDown(). * tearDown() now ensures that at least one signal has been sent. * Replace support.run_unittest() with unittest.main() which has a nicer CLI and automatically discover test cases.
-
Zhiming Wang authored
I'll watch for 404 on the old URL and will setup an HTTP redirection if needed.
-
Victor Stinner authored
In verbose mode, test_c_locale_coercion now dumps global variables at startup.
-
Julien Palard authored
-
- 20 Nov, 2018 9 commits
-
-
Victor Stinner authored
Partially revert commit 1a6be91e, move back PyGC API from the internal API to the C API: * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK _PyObject_GC_TRACK(o) and _PyObject_GC_UNTRACK(o) remain in the internal API.
-
Brendan Gerrity authored
-
Serhiy Storchaka authored
-
Serhiy Storchaka authored
Fixes assertion failures in _datetimemodule.c introduced in the previous fix (see bpo-31752). Rather of trying to handle an int subclass as exact int, let it to use overridden special methods, but check the result of divmod().
-
Serhiy Storchaka authored
-
Serhiy Storchaka authored
-
Julien Palard authored
-
Victor Stinner authored
locale.localeconv() now sets temporarily the LC_CTYPE locale to the LC_MONETARY locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads. Changes: * locale.localeconv() can now set LC_CTYPE to LC_MONETARY to decode monetary fields. * Add LocaleInfo.grouping_buffer: copy localeconv() grouping string since it can be replaced anytime if a different thread calls localeconv(). * _Py_GetLocaleconvNumeric() now requires a "struct lconv *" structure, so locale.localeconv() now longer calls localeconv() twice. Moreover, the function now requires all arguments to be non-NULL. * Rename STATIC_LOCALE_INFO_INIT to LocaleInfo_STATIC_INIT. * Move _Py_GetLocaleconvNumeric() definition from fileutils.h to pycore_fileutils.h. pycore_fileutils.h now includes locale.h. * The _locale module is now built with Py_BUILD_CORE defined.
-
Sanyam Khurana authored
-
- 19 Nov, 2018 1 commit
-
-
Donald Stufft authored
-
- 18 Nov, 2018 2 commits
-
-
Zackery Spytz authored
coro->cr_origin wasn't initialized if compute_cr_origin() failed in PyCoro_New(), which would cause a crash during the coroutine's deallocation. https://bugs.python.org/issue35269
-
Steve Dower authored
-
- 17 Nov, 2018 3 commits
-
-
Windson yang authored
Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.c#L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.h#L702 https://bugs.python.org/issue25438
-
Steve Dower authored
-
-
- 16 Nov, 2018 5 commits
-
-
Stefano Rivera authored
[Issue 28401](https://bugs.python.org/issue28401): Don't attempt to import the stable API extensions, they are not supported in PyDEBUG builds (which don't implement that ABI). https://bugs.python.org/issue28401
-
Zackery Spytz authored
This missed PyErr_NoMemory() could cause a SystemError when calling _symtable.symtable().
-
-
-
wim glenn authored
-