* Fix test_mktime on AIX by adding code to get mktime to behave the
same way as it does on other *nix systems
* Fix test_pthread_getcpuclickid in AIX by adjusting the test case
expectations when running on AIX in 32-bit mode
Patch by Michael Felt.
This test case needs "signed short" bitfields, but the
IBM XLC compiler (on AIX) does not support this.
Skip the code and test when AIX and XLC are used.
Use __xlc__ as identifier to detect the XLC compiler.
Include <pyconfig.h> ealier in Modules/expat/xmltok.c to define
properly _POSIX_C_SOURCE. Python defines _POSIX_C_SOURCE as 200809L,
whereas <features.h> (included indirectly by <string.h>) defines
_POSIX_C_SOURCE as 199506L.
The length check for AF_ALG salg_name and salg_type had a off-by-one
error. The code assumed that both values are not necessarily NULL
terminated. However the Kernel code for alg_bind() ensures that the last
byte of both strings are NULL terminated.
Signed-off-by: Christian Heimes <christian@python.org>
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.
In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.
In addition, check if the list changed size in the loop in array_array_fromlist().
select() calls are retried on EINTR (per PEP 475). However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
* bpo-31572: Get rid of PyObject_HasAttrString() in ctypes.
* Fix error handling for _pack_.
* Don't silence errors when look up in a dict.
* Use _PyObject_LookupAttrId().
* More changes.
* PyInit_time() now returns NULL if an exception is raised.
* Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is
a special prefix for function initializing a module.
init_timezone() doesn't initialize a module and the function is not
exported.
get_gmtoff() now returns time_t instead of int to fix the following
Visual Studio warning:
Modules\timemodule.c(1183): warning C4244: 'return':
conversion from 'time_t' to 'int', possible loss of data
Replace strncpy() with memcpy() in call_readline() to fix the
following warning, the NUL byte is written manually just after:
Modules/readline.c: In function ‘call_readline’:
Modules/readline.c:1303:9: warning: ‘strncpy’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
strncpy(p, q, n);
^~~~~~~~~~~~~~~~
Modules/readline.c:1279:9: note: length computed here
n = strlen(p);
^~~~~~~~~
Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS excluding Argument Clinic generated code.
Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS in Argument Clinic generated code.
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).
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
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.