[issue45382] platform() is not able to detect windows 11

2022-01-22 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29004 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30817 ___ Python tracker <https://bugs.python.org/issu

[issue45382] platform() is not able to detect windows 11

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 30817 to log "ver" and "wmic os get Caption,Version /value" command output in test.pythoninfo. I would like to check if Windows Server 2022 is deployed on CI used by Python :-) I'm trying to understand why bpo-41682

[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: > See also bpo-46476: Not all memory allocated by _Py_Quicken() is released at > Python exit. If you apply my workaround for bpo-46476: https://bugs.python.org/issue46476#msg411321 Python no longer leaks any memory block at exit for the simplest c

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-22 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29006 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30817 ___ Python tracker <https://bugs.python.org/issu

[issue45382] platform() is not able to detect windows 11

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset b0898f4aa90d9397e23aef98a2d6b82445ee7455 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo logs more Windows versions (GH-30817) https://github.com/python/cpython/commit/b0898f4aa90d9397e23aef98a2d6b8

[issue46478] DirEntry.stat() of os.scandir() has no dir_fd parameter

2022-01-22 Thread STINNER Victor
New submission from STINNER Victor : I read the Rust CVE-2022-21658 vulnerability of std::fs::remove_dir_all: https://blog.rust-lang.org/2022/01/20/cve-2022-21658.html It's a race condition if an attacker replaces a directory with a symlink while Rust is removing the parent directory,

[issue46240] Incorrect hint about forgetting a comma

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: Ah, thanks for the backport :-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46478] DirEntry.stat() of os.scandir() has no dir_fd parameter

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: Oh, I didn't test os.scandir() properly. If you pass a file descriptor to os.scandir(), it yields DirEntry entries with contains the directory FD. Ignore my request, Python works as expected :-D -- resolution: -> not a bug stage: -&g

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: The problem is that the optimization no longer checks for pending signals in TARGET(CALL_NO_KW_BUILTIN_FAST). The patch below fix my issue. I guess that other opcode needs an additional CHECK_EVAL_BREAKER(). diff --git a/Python/ceval.c b/Python/ceval.c

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-22 Thread STINNER Victor
STINNER Victor added the comment: It seems like the following target miss CHECK_EVAL_BREAKER(): TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_FAST) TARGET(CALL_NO_KW_METHOD_DESCRIPTOR_O) TARGET(CALL_NO_KW_BUILTIN_FAST) TARGET(CALL_NO_KW_BUILTIN_O) TARGET(CALL_NO_KW_BUILTIN_CLASS_1) CHECK_EVAL_BREAKER

[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: The automated backport to Python 3.9 failed. Miro asked me to close the PR: https://github.com/python/cpython/pull/29964 Can someone backport the fix to 3.9? (create a PR) -- ___ Python tracker <ht

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: > Is this a bug? In Python 3.10, the code works. In Python 3.11, it fails. It's a behavior change. IMO this change is unwanted. I expect that signals are handled "as soon as possible", *especially* if we receive it "during" an o

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: It's also interesting to note that the implementation of os.kill() and signal.raise_signal() do *not* call PyErr_CheckSignal(). The following signal functions *do* call call PyErr_CheckSignal(): * signal.signal() * signal.pause() * signal.pthread

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: > Signal handling in Python is asynchronous. > https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers See my previous comment: "CHECK_EVAL_BREAKER() matters for signals, but also multithreading (drop the GIL), a

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: > See branch https://github.com/kumaraditya303/cpython/commits/fix-code Oh nice, I like this new _Py_Deepfreeze_Fini() function :-) I suggest to create a function specific to only clear immortal code objects. In my experience, it's important to

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-23 Thread STINNER Victor
STINNER Victor added the comment: Aha. Maybe for now, the memory of immortal code objects can be deallocated in pymain_free(). It's the last function called before Python exit the process. -- ___ Python tracker <https://bugs.python.org/is

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-24 Thread STINNER Victor
STINNER Victor added the comment: Releasing memory in pymain_free() is a good start! At least it fix the issue for the "python" command. So people running a memory debugger like Valgrind will no longer see any leak at "python" exit. Kumar: Do you want to w

[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-24 Thread STINNER Victor
STINNER Victor added the comment: I don't want to change the default. Keeping fast startup time is a nice goal! I'm asking to make it configurable for my own development workflow: build Python as fast as possible. It is easy to hack Makefile.am.in and Python/frozen.c to freeze le

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: Converting further static types to heap types require a discussion. See what the Python Steering Council wrote at Feb 8, 2021: "The Steering Council discussed the ongoing work on porting types in the standard library to heap-types and the subinterp

[issue42238] Deprecate suspicious.py?

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: IMO moving this small script into the separated project https://github.com/JulienPalard/sphinxlint will help people who are not core developers to contribute and it makes the tool usable by projects outside CPython. So yeah, it's a good thing! Also,

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: Test fixed on Windows 2022 by: commit 1c705fda8f9902906edd26d46acb0433b0b098e1 Author: Kumar Aditya <59607654+kumaraditya...@users.noreply.github.com> Date: Tue Jan 25 02:34:47 2022 +0530 fixed flaky test (GH

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset f9ff0bf515e0fa162889aca508e755cc65d85079 by Miss Islington (bot) in branch '3.9': bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30861) https://github.com/python/cpyt

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 75d88b91e6b1320ae0511eaf72e860bea913a3eb by Miss Islington (bot) in branch '3.10': bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30860) https://github.com/python/cpyt

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: Thanks Kumar for the fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42238] Deprecate suspicious.py?

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > It currently looks like this: https://github.com/JulienPalard/sphinxlint but > should obviously be moved to github.com/python/ if we adopt this direction. If you want to move the project under the https://github.com/psf/ organization, the PSF ha

[issue41682] [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: This failing test was one of my most hated test because it failed randomly for almost 2 years. I'm happy that it has been fixed :-) Regularly, I'm asking for help to fix test_asyncio: * October 2020: https://mail.python.org/archives/l

[issue5322] object.__new__ argument calling autodetection faulty

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: Python has the same behavior since Python 2.6. While it annoys a few persons, the majority doesn't care. I suggest to close the issue. It's easy to workaround limitation that object.__new__() which doesn't ac

[issue40735] test_nntplib depends on unreliable external servers

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: IMO for now it's better to *always* skip test_nnptlib tests which rely on external servers and close related issues. * https://bugs.python.org/issue19613 (test_article_head_body) * https://bugs.python.org/issue19756 (test_capabilities) These issues are

[issue41682] [Windows] : Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > I'm sorry, Victor. As a maintainer of the Python CIs, The Night's Watch (*), it's my fault that I didn't skip these tests earlier. Honestly, it's ok to skip a bunch of tests or even remove them if there is no active maintainer.

[issue33205] GROWTH_RATE prevents dict shrinking

2022-01-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker <https://bugs.python.org/issue33205> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > Regarding C extensions, I think clear documentation that extension authors > need to check for signals in any code that might run for a few hundred > microseconds or longer is the best approach. Python 3.10 doesn't require it. If you want to

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: Fedora downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=2043555 We should make sure that Python can be built with -fsigned-char *and* with -funsigned-char: build Python, but also run its test suite

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > Modules/audioop.c uses __CHAR_UNSIGNED__, but the absence or presence of the > symbol does not affect behavior This comment is really weird since audioop explicitly uses "signed char" and "unsigned char". Maybe to avoid any ris

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29073 pull_request: https://github.com/python/cpython/pull/30890 ___ Python tracker <https://bugs.python.org/issue45

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > When writing to a pipe, wmic.exe hard codes using the process OEM code page > (i.e. CP_OEMCP). If it matters, running wmic.exe with subprocess should use > encoding='oem' instead of text=True. Oh ok, I wrote PR 30890 to fix the wmic.exe

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset cef0a5458f254c2f8536b928dee25862ca90ffa6 by Victor Stinner in branch 'main': bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890) https://github.com/python/cpython/commit/cef0a5458f254c2f8536b928dee258

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-25 Thread STINNER Victor
New submission from STINNER Victor : test_peg_generator takes between 5 and 16 minutes on the Windows CI run on Python pull requests. Example of timings on my PR https://github.com/python/cpython/pull/30890 * GitHub Action win32: 8 min 16 sec * GitHub Action win64: 16 min 38 sec * Azure

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29074 pull_request: https://github.com/python/cpython/pull/30891 ___ Python tracker <https://bugs.python.org/issue45

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: To test if a C type is signed or not, I wrote this macro: // Test if a C type is signed. // // Usage: assert(_Py_CTYPE_IS_SIGNED(char)); // fail if 'char' type is unsigned #define _Py_CTYPE_IS_SIGNED(T) (((T)-1) < 0) I planned to use it to rais

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: My audioop.c change which looks to be wrong (useless): diff --git a/Modules/audioop.c b/Modules/audioop.c index 3aeb6f04f13..4c04b17ce7f 100644 --- a/Modules/audioop.c +++ b/Modules/audioop.c @@ -1948,6 +1941,13 @@ audioop_exec(PyObject* module

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4a57fa296b92125e41220ecd201eb2e432b79fb0 by Victor Stinner in branch '3.10': [3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891) https://github.com/python/cpython/commit/4a57fa296b92125e41220ecd201eb2

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: > In which case it would be generally helpful to start the longest-running > tests first. Currently, most CI run "make buildbottest" which uses -r option of libregrtest: randomize tests order. -- __

[issue45382] platform() is not able to detect windows 11

2022-01-25 Thread STINNER Victor
STINNER Victor added the comment: I don't understand why we have to handle XML or JSON and encoding... just to get a version number. Why did Microsoft make it so complicated? sys.getwindowsversion() which exposes GetVersionEx() looks fine

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: IMO making the assumption that "char" is signed or not in C code is bad. If Python has code like that, it must be signed to explicitly use one of these types: unsigned char or uint8_t, signed char or int8_t. Hopefully, Python can now use C99 si

[issue46513] AC_C_CHAR_UNSIGNED from configure.ac confuses GCC 12+ by defining __CHAR_UNSIGNED__

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In short, I did my checks on my side, and the merged change now LGTM. Thanks Christian for fixing it ;-) -- ___ Python tracker <https://bugs.python.org/issue46

[issue45382] platform() is not able to detect windows 11

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker <https://bugs.python.org/issue45382> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46524] test_peg_generator takes 8 minutes on Windows

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > Would it be possible to skip these tests when no changes to the parser > related code are made to speed up tests? Maybe, some CIs could export an environment variable which contains the list of modified files, and then each file would be able to

[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29102 pull_request: https://github.com/python/cpython/pull/30923 ___ Python tracker <https://bugs.python.org/issue35

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
New submission from STINNER Victor : While working on the PEP 674 implementation, I noticed that PyDescr_NAME() and PyDescr_TYPE() macros are used as l-value by two projects: M2Crypto and mecab-python3. Both are code generated by SWIG. M2Crypto-0.38.0/src/SWIG/_m2crypto_wrap.c and mecab

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: pydescr_set_type.patch: Python patch to add PyDescr_SET_TYPE() and PyDescr_SET_NAME() functions. -- keywords: +patch Added file: https://bugs.python.org/file50585/pydescr_set_type.patch ___ Python tracker <ht

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: pydescr_new.patch: Python patch adding the PyDescr_New() function. -- Added file: https://bugs.python.org/file50586/pydescr_new.patch ___ Python tracker <https://bugs.python.org/issue46

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: pythoncapi_compat_pydescr_new.patch: pythoncapi_compat patch adding PyDescr_New() function with tests. -- Added file: https://bugs.python.org/file50587/pythoncapi_compat_pydescr_new.patch ___ Python tracker

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: swig_pydescr_new.patch: SWIG patch adding PyDescr_New() and using it. -- Added file: https://bugs.python.org/file50588/swig_pydescr_new.patch ___ Python tracker <https://bugs.python.org/issue46

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : Removed file: https://bugs.python.org/file50588/swig_pydescr_new.patch ___ Python tracker <https://bugs.python.org/issue46538> ___ ___ Pytho

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : Added file: https://bugs.python.org/file50589/swig_pydescr_new.patch ___ Python tracker <https://bugs.python.org/issue46538> ___ ___ Python-bug

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: Since making PyDescrObject opaque is not really worth it, I close this issue. I mean, it's worth it, but there are more important structures like PyObject, PyTypeObject or PyListObject. -- resolution: -> rejected stage: -> resolved s

[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset d4a85f104bf9d2e368f25c9a567eaaa2cc39a96a by Victor Stinner in branch 'main': bpo-35134: Add Include/cpython/descrobject.h (GH-30923) https://github.com/python/cpython/commit/d4a85f104bf9d2e368f25c9a567eaa

[issue46538] [C API] Make the PyDescrObject structure opaque

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > The problem of the PyDescr_SET_NAME() and PyDescr_SET_Type() approach is that > SWIG code is outdated: it doesn't initialized the PyDescrObject.d_qualname > member added to Python 3.3 (bpo-13577, commit > 9d57481f043cb9b94bfc45c1ee04

[issue46538] [C API] Make the PyDescrObject structure opaque: PyDescr_NAME() and PyDescr_TYPE()

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- title: [C API] Make the PyDescrObject structure opaque -> [C API] Make the PyDescrObject structure opaque: PyDescr_NAME() and PyDescr_TYPE() ___ Python tracker <https://bugs.python.org/issu

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > In the PyPI top 5000, I found two projects using PyDescr_TYPE() and > PyDescr_NAME() as l-value: M2Crypto and mecab-python3. In both cases, it was > code generated by SWIG I created bpo-46538 "[C API] Make the PyDescrObject structure opa

[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > Should the immutable flag also be applied to the heap types converted in and > before Python 3.9 before closing this issue? I don't think that Python 3.9 should be changed. It's too late. IMO this issue is not important enough to introduce

[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In Python 3.11, 68 heap types have the Py_TPFLAGS_IMMUTABLETYPE flag: * _blake2.blake2b * _blake2.blake2s * _bz2.BZ2Compressor * _bz2.BZ2Decompressor * _csv.Dialect * _csv.reader * _csv.writer * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In Python 3.11, 41 types are declared explicitly with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag: * _curses_panel.panel * _dbm.dbm * _gdbm.gdbm * _hashlib.HASH * _hashlib.HASHXOF * _hashlib.HMAC * _md5.md5 * _multibytecodec.MultibyteCodec * _sha1.sha1

[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: Can we close this issue? Or is there a remaining task? -- ___ Python tracker <https://bugs.python.org/issue43916> ___ ___ Pytho

[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29108 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30929 ___ Python tracker <https://bugs.python.org/issu

[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: Ok, I reproduced the issue. I wrote PR 30929 to fix it. The issue only occurs when cross-compiling Python with GCC and a German locale. I can reproduce the issue on Fedora 35: $ LC_ALL=de_DE gcc -E -v Es werden eingebaute Spezifikationen verwendet

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > datatable-1.0.0.tar.gz I created https://github.com/h2oai/datatable/pull/3231 -- ___ Python tracker <https://bugs.python.org/issu

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > pickle5-0.0.12: pickle5/_pickle.c This project is a backport targeting Python 3.7 and older. I'm not sure if it makes sense to update to it to Python 3.11. It's the same for pysha3 which targets

[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: FYI distutils.unixccompiler has a private _is_gcc() function: def _is_gcc(self, compiler_name): # clang uses same syntax for rpath as gcc return any(name in compiler_name for name in ("gcc", "g++", "c

[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset a9503ac39474a9cb1b1935ddf159c0d9672b04b6 by Victor Stinner in branch 'main': bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929) https://github.com/python/cpython/commit/a9503ac39474a9cb1b1935ddf159c0

[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: The workaround for this bug is to build Python using the command: LC_ALL=C make rather than running: make -- ___ Python tracker <https://bugs.python.org/issue38

[issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- title: GCC detection in setup.py is broken -> setup.py: GCC detection is broken when cross-compiling with a German locale ___ Python tracker <https://bugs.python.org/issu

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: TODO: * Macros still accessing directly PyTypeObject members: * PyHeapType_GET_MEMBERS() * PySequence_ITEM() * _PyObject_SIZE() * _PyObject_VAR_SIZE() * PyType_SUPPORTS_WEAKREFS() * Try again to apply "bpo-40170: PyType_HasFeature() now a

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: I searched for "_PyGC_FINALIZED" in top 5000 PyPI projects. It seems like only Cython is impacted. ddtrace and guppy3 use directly the internal C API. == Cython 0.29.26 == * Cython/Compiler/ModuleNode.py: finalised_check = '!_PyGC_FINALIZ

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: I searched for "_PyObject_DebugMallocStats" in top 5000 PyPI projects. There is a single project using it: guppy3. Extract of guppy3 src/heapy/xmemstats.c: ... dlptr__PyObject_DebugMallocStats = addr_of_symbol("_PyObject_DebugMallocStat

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: In the top 5000 PyPI projects, the _PyObject_SIZE() and _PyObject_VAR_SIZE() functions are used by 7 projects: * Cython-0.29.26 * frozendict-2.2.0: implement "sizeof" function, found in copies of Objects/dictobject.c file * JPype1-1.3.0 * nu

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29117 pull_request: https://github.com/python/cpython/pull/30938 ___ Python tracker <https://bugs.python.org/issue40

[issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot

2022-01-26 Thread STINNER Victor
New submission from STINNER Victor : s390x Fedora Clang 3.x buildbot: https://buildbot.python.org/all/#/builders/3/builds/1385 This change may be caused by this buildbot configuration change: https://github.com/python/buildmaster-config/commit/8fbb7492d4509df074750bc1a8ea69812ff53aae --- 0:05

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29119 pull_request: https://github.com/python/cpython/pull/30940 ___ Python tracker <https://bugs.python.org/issue40

[issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: These 2 tests seem to check for RecursionError. See my notes: https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion -- ___ Python tracker <https://bugs.python.org/issue46

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29121 pull_request: https://github.com/python/cpython/pull/30942 ___ Python tracker <https://bugs.python.org/issue40

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset af32b3ef1fbad3c2242627a14398320960a0cb45 by Victor Stinner in branch 'main': bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938) https://github.com/python/cpython/commit/af32b3ef1fbad3c2242627a1439832

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 by Victor Stinner in branch 'main': bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940) https://github.com/python/cpython/commit/6b491b9dc0b0fdfd1f07ea4e215123

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29122 pull_request: https://github.com/python/cpython/pull/30943 ___ Python tracker <https://bugs.python.org/issue40

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > * guppy3-3.1.2: src/sets/bitset.c and src/sets/nodeset.c I created: https://github.com/zhuyifei1999/guppy3/pull/40 -- ___ Python tracker <https://bugs.python.org/issu

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > * scipy-1.7.3: scipy/_lib/boost/boost/python/object/make_instance.hpp This is a vendored the Boost.org python module which has already been fixed in boost 1.78.0 (commit: January 2021) by: https://github.com/boostorg/python/com

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor
STINNER Victor added the comment: > recordclass-0.16.3: lib/recordclass/_dataobject.c + code generated by Cython I created: https://bitbucket.org/intellimath/recordclass/pull-requests/1/python-311-support-use-py_set_size -- ___ Python trac

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset c7f810b34d91a5c2fbe0a8385562015d2dd961f2 by Kumar Aditya in branch 'main': bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853) https://github.com/python/cpython/commit/c7f810b34d91a5c2fbe0a838556201

[issue46476] Not all memory allocated by _Py_Quicken() is released at Python exit

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: Thanks Kumar! Your change fixed my issue: $ ./python -I -X showrefcount -c pass [-5 refs, 0 blocks] Python no longer leaks memory at exit: it "leaks" exactly *zero* memory block. The negative reference count is likely caused by

[issue46449] Deep-freezed modules create inconsistency in sys.gettotalrefcount() (_Py_Reftotal)

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: The bpo-46476 added _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() functions: commit c7f810b34d91a5c2fbe0a8385562015d2dd961f2. If we need to ajust _Py_RefTotal manually, *maybe* it can be done there? I don't understand well how static/immortal

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: Thanks to recent enhancements, epecially in bpo-46417, the last memory blocks are now released at Python exit! The initial issue has been fixed!!! This bug was 15 years old! Current main branch: $ ./python -I -X showrefcount -c pass [-5 refs, 0 blocks] &q

[issue43916] Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: > 3.9 is still affected; we should fix those types first. I'm against backporting the new type flag, but we can try to set explicitly tp_set to NULL *after* calling PyType_Ready(). -- ___ Python tracker

[issue46551] Provide number of workers option for fast PGO build time

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: > When I tested with run -m test --pgo -j8, it doesn't affect to optimized > result with fast build time. You only test libregrtest.main and libregrtest.runtest_mp modules which don't execute code. Does it mean that running tests is useless

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: I used the following shell command to search remaining static types: --- grep -E 'static PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c") --- I found 86 static types in 17 files: * PC/_msi.c: * msidb_Type * msiview_

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: And I found 135 more static types with this command: --- grep -E '^PyTypeObject [a-zA-Z_0-9]+ *(;|= *{|) *$' $(find -name "*.c") --- Types: Objects/cellobject.c: PyCell_Type Objects/sliceobject.c: PyEllipsis_Type Objects/sliceobject.c:

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: > And I found 135 more static types with this command Of these 135 static types, most are cleared since bpo-46417 was implemented: * 103 types are cleared by _PyTypes_FiniTypes() * 15 types are cleared by _PyIO_Fini() * the remaining 17 types are not clea

[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-27 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29143 pull_request: https://github.com/python/cpython/pull/30964 ___ Python tracker <https://bugs.python.org/issue46

[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6c6a153dee132116611f2d5df0689a5a605f62b6 by Victor Stinner in branch 'main': bpo-46417: signal: move siginfo_type to the module state (GH-30964) https://github.com/python/cpython/commit/6c6a153dee132116611f2d5df0689a

[issue46417] Clear static types in Py_Finalize() for embedded Python

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: I close the issue. I cleared most static types at exit. Following work can be done in bpo-40077 or other issues. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Pytho

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 0575551f69ba9c999835bfb176a543d468083c03 by Victor Stinner in branch 'main': bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943) https://github.com/python/cpython/commit/0575551f69ba9c999835bfb176a543

<    1   2   3   4   5   6   7   8   9   10   >