Skip to content

Conversation

@bharel
Copy link
Owner

@bharel bharel commented May 7, 2019

No description provided.

LorenzMende and others added 30 commits April 10, 2019 10:19
The script needs to be updated to support win 10/ 1803 chcp.com command (output has trailing dot)





https://bugs.python.org/issue34144
The random module now prefers the lean internal _sha512 module over hashlib
for seed(version=2) to optimize import time.

Signed-off-by: Christian Heimes <[email protected]>
Set CUSTOMIZED_OSX_COMPILER to True to disable
_osx_support.customize_compiler().
* better __init__.py explanation in tutorial

* Update Doc/tutorial/modules.rst

Co-Authored-By: methane <[email protected]>
Disable the job to unblock the CI until the issue is properly
understood.
…H-12770)

Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.

Add unit tests on _PyObject_IsFreed().
Commit 57b1a28 fixed doctest, but example code is not
match with document.
Just skip doctest for the block.
Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().
"make tags" and "make TAGS" now also parse Modules/_io/*.c
and Modules/_io/*.h.
Fix test_sys.test_getallocatedblocks() when tracemalloc is enabled.
If the name of Python memory allocators cannot get read, consider
that pymalloc is disabled.

Fix the following error:

./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks

ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest)
------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_sys.py", line 770, in test_getallocatedblocks
    alloc_name = _testcapi.pymem_getallocatorsname()
RuntimeError: cannot get allocators name
On AIX, sys.platform doesn't contain the major version anymore.
Always return 'aix', instead of 'aix3' .. 'aix7'.  Since
older Python versions include the version number, it is recommended to
always use sys.platform.startswith('aix').
…H-12786)

In development mode (-X dev) and in debug build, the io.IOBase
destructor now logs close() exceptions. These exceptions are silent
by default in release mode.
gh-12360)

This is effectively an un-revert of #11617 and #12024 (reverted in #12159). Portions of those were merged in other PRs (with lower risk) and this represents the remainder. Note that I found 3 different bugs in the original PRs and have fixed them here.
For BufferedReader and BufferedWriter, seek and tell operations are
optional (they may or may not exist based on the underlying stream). For
BufferedRandom, they are mandatory: a BufferedRandom should not be
constructed over an unseekable underlying stream. Document this.
This enables using the `--preset-iot` option with the PC/layout script, but does not enable IoT builds as part of any normal release.
Add -fmax-type-align=8 to CFLAGS when clang compiler is detected.

The pymalloc memory allocator aligns memory on 8 bytes. On x86-64,
clang expects alignment on 16 bytes by default and so uses MOVAPS
instruction which can lead to segmentation fault. Instruct clang that
Python is limited to alignemnt on 8 bytes to use MOVUPS instruction
instead: slower but don't trigger a SIGSEGV if the memory is not
aligned on 16 bytes.

Sadly, the flag must be expected to CFLAGS and not just
CFLAGS_NODIST, since third party C extensions can have the same
issue.
Add a new _PyObject_CheckConsistency() function which can be used to
help debugging. The function is available in release mode.

Add a 'check_content' parameter to _PyDict_CheckConsistency().
Omit serialno field from debug hooks on Python memory allocators to
reduce the memory footprint by 5%.

Enable tracemalloc to get the traceback where a memory block has been
allocated when a fatal memory error is logged to decide where to put
a breakpoint.

Compile Python with PYMEM_DEBUG_SERIALNO defined to get back the
field.
scoder and others added 26 commits May 6, 2019 17:36
* Doc/c-api/exceptions.rst: fix grammar

skip issue
skip news

* Use ", in that case"

Co-Authored-By: blueyed <[email protected]>
In addition, fix some other minor violations of C99.
Classes that define __str__ the same as __repr__ can
just inherit it from object.
…3124)

Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default.  This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a failure.

Fixing the network servers is a separate issue.
…t of read([size]) (GH-11521)

unittest.mock.mock_open() results now respects the argument of read([size])

Co-Authored-By: remilapeyre <[email protected]>
Python 3.8.0a4
Instead of attempting to acquire and release them all across fork
which was leading to deadlocks in some applications that had chained
their own handlers while holding multiple locks.
*Moved from python/asyncio#493.*

This PR fixes issue python/asyncio#480, as explained in [this comment](python/asyncio#480 (comment)).

The `_SelectorDatagramTransport.sendto` method has to be modified ~~so `_sock.sendto` is used in all cases (because it is tricky to reliably tell if the socket is connected or not). Could that be an issue for connected sockets?~~ *EDIT* ... so `_sock.send` is used only if `_sock` is connected.

It also protects `socket.getsockname` against `OSError` in `_SelectorTransport`. This might happen on Windows if the socket is not connected (e.g. for UDP broadcasting).


https://bugs.python.org/issue31922
(lint cleanup) This import causes an argument parameter to shadow the global import name.
…eld (GH-10340)

When the future returned by shield is cancelled, its completion callback of the
inner future is not removed. This makes the callback list of inner inner future
grow each time a shield is created and cancelled.

This change unregisters the callback from the inner future when the outer
future is cancelled.



https://bugs.python.org/issue35125
@bharel bharel merged commit 9d2e344 into bharel:master May 7, 2019
bharel pushed a commit that referenced this pull request Sep 9, 2020
```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    #1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
    #2 0xe0305b in cfunction_call Objects/methodobject.c:546
```

Signed-off-by: Christian Heimes <[email protected]>
bharel pushed a commit that referenced this pull request Jan 19, 2021
* bpo-40791: Make compare_digest more constant-time.

The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization.

(This is change #1 from https://bugs.python.org/issue40791 .)
bharel pushed a commit that referenced this pull request Oct 18, 2023
…es (#1… (python#108688)

This reverts commit 08447b5.

Revert also _ctypes.c changes of the PyDict_ContainsString() change,
commit 6726626.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.