| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The curses module used mkstemp() + fopen() to create a temporary file in
/tmp. The /tmp directory does not exist on Android. The tmpfile()
function simplifies the task a lot. It creates a temporary file in a
correct directory, takes care of cleanup and returns FILE*.
tmpfile is supported on all platforms (C89, POSIX 2001, Android,
Windows).
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
| |
Patch by Aviv Palivoda.
|
|
|
|
| |
(#255) (#255)
|
|
|
|
| |
Add a comment to prevent further attempts to avoid a copy for
optimization.
|
|
|
|
|
|
|
|
|
|
| |
sock_addr_t is used to define the minimum size of any socket address on
the stack. Let's make sure that an AF_ALG address always fits. Coverity
complains because in theory, AF_ALG might be larger than any of the other
structs. In practice it already fits.
Closes Coverity CID 1398948, 1398949, 1398950
Signed-off-by: Christian Heimes <christian@python.org>
|
|
|
| |
no longer affects a partial object after creation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows AMD64. (#168)
* Fixed bpo-29565: Corrected ctypes passing of large structs by value.
Added code and test to check that when a structure passed by value
is large enough to need to be passed by reference, a copy of the
original structure is passed. The callee updates the passed-in value,
and the test verifies that the caller's copy is unchanged. A similar
change was also added to the test added for bpo-20160 (that test was
passing, but the changes should guard against regressions).
* Reverted unintended whitespace changes.
|
| |
|
|
|
|
|
|
| |
bltinmodule.c: Added in b744ba1 and no longer necessary since d64e8a7
posixmodule.c: Added in d1cd4d4 and no longer necessary since efb00c0
pythonrun.c: Added in 73d538b and no longer necessary since d600951
sysmodule.c: Added in 5467d4c and no longer necessary since a2c17c5
|
| |
|
|
|
| |
IPPROTO_IPV6 is already defined further above in the same way.
|
|
|
|
| |
Set name to "_curses.window" instead of "_curses.curses window" (with
a space!?).
|
|\ |
|
| |
| |
| |
| |
| | |
Issue #29100: Fix datetime.fromtimestamp() regression introduced in Python
3.6.0: check minimum and maximum years.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Issue #29452: Use METH_FASTCALL calling convention for index(), insert() and
rotate() methods of collections.deque to avoid the creation a temporary tuple
to pass position arguments. Speedup on deque methods:
* d.rotate(): 1.10x faster
* d.rotate(1): 1.24x faster
* d.insert(): 1.18x faster
* d.index(): 1.24x faster
|
| |
| |
| |
| | |
_PyArg_NoPositional() now are macros.
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/ |
|
| |\ |
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
| | | |
|
|\ \ \
| |/ /
| | |
| | | |
the match object. Based on patch by WGH.
|
| |\ \
| | |/
| | |
| | | |
the match object. Based on patch by WGH.
|
| | |
| | |
| | |
| | | |
the match object. Based on patch by WGH.
|
| | |
| | |
| | |
| | | |
Based on patch by Georg Brandl.
|
| | |
| | |
| | |
| | | |
Original patch by Georg Brandl.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Issue #29300: Rename struct.unpack() second parameter from "inputstr" to
"buffer", and use the Py_buffer type.
Fix also unit tests on struct.unpack() which passed a Unicode string instead of
a bytes string as struct.unpack() second parameter. The purpose of
test_trailing_counter() is to test invalid format strings, not to test the
buffer parameter.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* The struct module now requires contiguous buffers.
* Convert most functions and methods of the _struct module to Argument Clinic
* Use "Py_buffer" type for the "buffer" argument. Argument Clinic is
responsible to create and release the Py_buffer object.
* Use "PyStructObject *" type for self to avoid explicit conversions.
* Add an unit test on the _struct.Struct.unpack_from() method to test passing
arguments as keywords.
* Rephrase docstrings.
* Rename "fmt" argument to "format" in docstrings and the documentation.
As a side effect, functions and methods which used METH_VARARGS calling
convention like struct.pack() now use the METH_FASTCALL calling convention
which avoids the creation of temporary tuple to pass positional arguments and
so is faster. For example, struct.pack("i", 1) becomes 1.56x faster (-36%)::
$ ./python -m perf timeit \
-s 'import struct; pack=struct.pack' 'pack("i", 1)' \
--compare-to=../default-ref/python
Median +- std dev: 119 ns +- 1 ns -> 76.8 ns +- 0.4 ns: 1.56x faster (-36%)
Significant (t=295.91)
Patch co-written with Serhiy Storchaka.
|
| | |
| | |
| | |
| | |
| | | |
_Pickle_FastCall() has a surprising API: it decrements the reference counter of
its second argument.
|
| | |
| | |
| | |
| | |
| | | |
method when unpickle collections.deque and other list-like objects.
This can speed up unpickling to 2 times.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
possible but Coccinelle couldn't find opportunity.
|
| | |
| | |
| | |
| | | |
possible. Patch is writen with Coccinelle.
|