[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-22 Thread Petr Viktorin
Change by Petr Viktorin : Added file: https://bugs.python.org/file49182/reproducer.c ___ Python tracker <https://bugs.python.org/issue40217> ___ ___ Python-bugs-list m

[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: Ha! I think I found the issue in PySide now. It's different, but it's still a CPython issue. It's actually a variant of the "defining class" problem from PEP 573. It's legal to get the value of a slot, using PyType_GetSlot.

[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-23 Thread Petr Viktorin
Petr Viktorin added the comment: Thank you for responding so quickly! > Petr, do you mind reviewing it? Yes, but I'll only get to it next week. -- ___ Python tracker <https://bugs.python.org

[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-05-26 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +19690 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/20433 ___ Python tracker <https://bugs.python.org/issu

[issue40784] test_sqlite: CheckFuncDeterministic() fails with SQLite 3.32

2020-05-26 Thread Petr Viktorin
Petr Viktorin added the comment: Indeed. The SQLite documentation talks about the limitations that non-deterministic functions have, not about deterministic functions being memoized: https://www.sqlite.org/deterministic.html The flag would be better tested e.g. with a CHECK constraint

[issue23897] Update Python 3 extension module porting guide

2020-05-28 Thread Petr Viktorin
Petr Viktorin added the comment: py3c has an open issue to check that Barry's notes on C extensions are included: https://github.com/encukou/py3c/issues/1 However, C extensions are only a small part of the wiki page. -- ___ Python tracker &

[issue40802] AbstractEventLoop.shutdown_default_executor breaks backwards compatibility

2020-05-28 Thread Petr Viktorin
New submission from Petr Viktorin : In bpo-34037, AbstractEventLoop gained a new abstract method, shutdown_default_executor: https://docs.python.org/dev/library/asyncio-eventloop.html#asyncio.loop.shutdown_default_executor All AbstractEventLoop subclasses need to define this method, otherwise

[issue40724] Support buffer protocol with type specs

2020-05-28 Thread Petr Viktorin
Petr Viktorin added the comment: Yes, it should be possible to wrap them in #if so they aren't part of the stable ABI. -- ___ Python tracker <https://bugs.python.org/is

[issue24416] Have date.isocalendar() return a structseq instance

2020-05-28 Thread Petr Viktorin
Petr Viktorin added the comment: This broke compilation with mingw; see https://bugs.python.org/issue40777 -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue24

[issue40777] _datetimemodule.c:3328:16: error: initializer element is not constant

2020-05-28 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch nosy: +petr.viktorin nosy_count: 1.0 -> 2.0 pull_requests: +19742 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20493 ___ Python tracker <https://bugs.p

[issue40217] The garbage collector doesn't take in account that objects of heap allocated types hold a strong reference to their type

2020-06-01 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue15577] Real argc and argv in embedded interpreter

2020-06-08 Thread Petr Viktorin
Petr Viktorin added the comment: FWIW, another project that needs Py_GetArgcArgv is "setproctitle": https://bugzilla.redhat.com/show_bug.cgi?id=1792059 See also: https://github.com/cherrypy/cherrypy/issues/1506 -- nosy: +petr.viktorin

[issue39372] The header files in Include/ have many declarations with no definition

2020-06-09 Thread Petr Viktorin
Petr Viktorin added the comment: Since the removal of PyNoArgsFunction breaks user code, does it deserve a mention in What's New – Porting to Python 3.9? -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/is

[issue40891] Use pep573 in functools

2020-06-09 Thread Petr Viktorin
Petr Viktorin added the comment: I wrote about the _PyType_GetModuleByDef idea on the capi-sig mailing list: https://mail.python.org/archives/list/capi-...@python.org/thread/T3P2QNLNLBRFHWSKYSTPMVEIL2EEKFJU/ -- ___ Python tracker <ht

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-06-23 Thread Petr Viktorin
Petr Viktorin added the comment: > do we still only support single inheritance at the C level? Not any more. Heap types may have multiple bases, and they can be created at the C level (since Python 3.2, PEP 384). > So, I think we should do something like walking up the hierarchy t

[issue40971] Documentation still mentions 'u' string formatting option

2020-06-30 Thread Petr Viktorin
Petr Viktorin added the comment: AFAICS, Python 3 suports '%u' for printf-style formatting: Python 3.8.3 (default, May 29 2020, 00:00:00) [GCC 10.1.1 20200507 (Red Hat 10.1.1-1)] on linux Type "help", "copyright", "credits" or "license"

[issue40971] Documentation still mentions 'u' string formatting option

2020-06-30 Thread Petr Viktorin
Petr Viktorin added the comment: I'm closing the issue. Please comment or reopen if I missed something. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue41073] [C API] PyType_GetSlot() should accept static types

2020-07-01 Thread Petr Viktorin
Petr Viktorin added the comment: > If we extend PyType_GetSlot() to accept non-heaptype, we need find a way to > judge the max slot of non-heaptype. Static types can have some sub-slots structs but not others. A "max slot" will not help for types that have tp_as_mapping but

[issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault

2020-07-01 Thread Petr Viktorin
Petr Viktorin added the comment: What kind of security-related issues do you mean? A .pyc file is code; it can do anything. Never run untrusted code, be it .py or .pyc. See also: Lib/test/crashers/bogus_code_obj.py -- nosy: +petr.viktorin

[issue41043] Escape the literal part of the path for glob()

2020-07-01 Thread Petr Viktorin
Petr Viktorin added the comment: Would it be worth it to add a "base" keyword argument to glob.glob? -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.o

[issue41191] PyType_FromModuleAndSpec is not mentioned in 3.9 What's new

2020-07-07 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +20518 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21374 ___ Python tracker <https://bugs.python.org/issu

[issue39017] Infinite loop in the tarfile module

2020-07-15 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4 by Rishi in branch 'master': bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) https://github.com/python/cpython/commit/5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4 -

[issue39017] Infinite loop in the tarfile module

2020-07-15 Thread Petr Viktorin
Petr Viktorin added the comment: Larry and Ned, do you want this fix in the security-only releases you manage? PRs for 3.6 ad 3.7 are ready, should you wish to merge them. -- nosy: +larry, ned.deily -miss-islington ___ Python tracker <ht

[issue39017] Infinite loop in the tarfile module

2020-07-15 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +20632 pull_request: https://github.com/python/cpython/pull/21489 ___ Python tracker <https://bugs.python.org/issue39

[issue41168] Lack of proper checking in PyObject_SetAttr leads to segmentation fault

2020-08-11 Thread Petr Viktorin
Petr Viktorin added the comment: Closing; please re-open if you have more info. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin
Petr Viktorin added the comment: Regarding ac46eb4ad6662cf6d771b20d8963658b2186c48c: Module states come and go with the modules that contain them; if a "get_global_ast_state" or "astmodulestate_global" needs to be accessed from outside the module, it shouldn't be

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin
Petr Viktorin added the comment: > Also, option 1 is virtually equivalent to the state of the _ast module prior > to the recent changes except that the symbols are in a shared object instead > of the binary or libpython. The advantage here is not moving them out of the > share

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-08-26 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +21082 pull_request: https://github.com/python/cpython/pull/21973 ___ Python tracker <https://bugs.python.org/issue41

[issue38787] PEP 573: Module State Access from C Extension Methods

2020-08-27 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset d9a966ae08258da2ce2a432c943d8194760f09c4 by Petr Viktorin in branch 'master': bpo-38787: Clarify docs for PyType_GetModule and warn against common mistake (GH-20215) https://github.com/python/cpyt

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: I also looked into Mercurial. They have a large list of modules [0] that don't work with the lazy-loading scheme. I don't think adding one more should be a big problem for them; but we'll reach out to them and confirm that. [0] https:

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: We need this bug solved for 3.9.0 rc2. Łukasz, you're the one to make the call about the approach; how can we make your job easier? My view is: - Victor's PR 21961 is going in the right direction. But, as far as I know (correct me if I'm

[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: IMO, a slot should be exposed if there is some reason for exposing it. bpo-41073 talks about tp_dealloc, which is already exposed as Py_tp_dealloc. Recently, Py_bf_* slots were exposed (but not as part of the limited API), in bpo-40724 which links to the

[issue41631] _ast module: get_global_ast_state() doesn't work with Mercurial lazy import

2020-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: That is interesting. The original post here doesn't mention that the problem occurs in Mercurial's "make all", specifically when building documentation, in the command: /usr/bin/python3.9 gendoc.py "hgrc.5" > hgrc.5.txt

[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-09-09 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 1e2f051a6127904cfee5f9e4021dd6e4a4d51c0f by Hai Shi in branch 'master': bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec in refcounts.dat (GH-22112) https://github.com/python/cpyt

[issue41796] _ast module state should be made per interpreter

2020-09-16 Thread Petr Viktorin
Petr Viktorin added the comment: I started this here: https://github.com/python/cpython/commit/60960cba606573450e76934c954787419524147d Feel free to take that code. -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue41

[issue41797] PyModule_GetState doesn't work with LazyLoader

2020-09-16 Thread Petr Viktorin
New submission from Petr Viktorin : One underlying issue from bpo-41631 is that importlib.util.LazyLoader produces modules that are only fully loaded after an attribute is accessed (through __getattribute__). C-API functions like PyModule_GetState, PyModule_GetDict and such do not get

[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2020-09-16 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue41798> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: The slots are originally intended for defining types (PyType_FromSpec); PyType_GetSlot is not as useful as it could be. tp_name can be exposed, but it needs to also be handled properly PyType_FromSpec -- e.g. raise an error

[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Definitely. Sorry for the delay -- I missed the notification here. -- ___ Python tracker <https://bugs.python.org/issue41

[issue41798] [C API] Revisit usage of the PyCapsule C API with multi-phase initialization API

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Also note that the capsule generally needs to hold references to the objects in exposes, and not rely on the module object to keep things alive. (Module objects with multi-phase init are not unique nor immortal.) _ctypes is an exception, since it doesn't

[issue38787] PEP 573: Module State Access from C Extension Methods

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Thanks Victor, Hai Shi, Pablo, Stefan, Dong-hee Na and Mariatta for reviews! I did not put all the details in the documentation because there are still feature gaps. So, a full write-up is now in the informational PEP 630. -- resolution: -> fi

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Ah, scratch that: PyType_GetSlot returns a function pointer. To be correct, we should to expose a new function like PyType_GetName. It's true that CPython currently doesn't always honor the distinction between data and function pointers, but the

[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Also: PyType_GetSlot should return a function pointer, not data. For some slots (Py_tp_doc, Py_tp_methods, Py_tp_members, Py_tp_getset) that ship has sailed, but for new ones, we should honor the distinction between data and function pointers. The C standard

[issue40703] PyType_FromSpec*() overwrites the type's "__module__"

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Thank you, Stefan! This should have a test as well. I'm willing to mentor someone who wants to get into the C-API, otherwise this has low priority for me. -- resolution: -> fixed stage: test needed -> resolved status: ope

[issue40703] PyType_FromSpec*() overwrites the type's "__module__"

2020-10-20 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: fixed -> status: closed -> open ___ Python tracker <https://bugs.python.org/issue40703> ___ ___ Python-bugs-list

[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-10-20 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41726] Update refcounts info of PyType_FromModuleAndSpec in refcounts.dat

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 38a17d0752781c70fd971f372ddc8d3caf5ded88 by Miss Skeleton (bot) in branch '3.9': bpo-41726: Update the refcounts info of PyType_FromModuleAndSpec in refcounts.dat (GH-22112) (GH-22808) https://github.com/python/cpyt

[issue42100] Add _PyType_GetModuleByDef

2020-10-20 Thread Petr Viktorin
New submission from Petr Viktorin : I would like to add an internal _PyType_GetModuleByDef function to unblock further work on isolating extension modules, as discussed here: https://mail.python.org/archives/list/capi-...@python.org/thread/T3P2QNLNLBRFHWSKYSTPMVEIL2EEKFJU

[issue42100] Add _PyType_GetModuleByDef

2020-10-20 Thread Petr Viktorin
Change by Petr Viktorin : -- components: +C API type: -> enhancement versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue42100> ___ ___ Py

[issue42100] Add _PyType_GetModuleByDef

2020-10-20 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +21789 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22835 ___ Python tracker <https://bugs.python.org/issu

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

2020-10-20 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +petr.viktorin nosy_count: 18.0 -> 19.0 pull_requests: +21792 pull_request: https://github.com/python/cpython/pull/22838 ___ Python tracker <https://bugs.python.org/issue1

[issue40891] Use PEP 573 in functools

2020-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Here is a PR for _PyType_GetModuleByDef: https://github.com/python/cpython/pull/22835 -- ___ Python tracker <https://bugs.python.org/issue40

[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-21 Thread Petr Viktorin
New submission from Petr Viktorin : The "xxlimited" module (Modules/xxlimited.c) was added as part of PEP 384 (Defining a Stable ABI), and is undocumented. As far as I can tell, it was added partly to test the stable ABI, and partly as an example of how to write a module (like

[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: I was too eager in reviewing this :( It turns out `-fno-semantic-interposition` is GCC 5.3, so [builds fail on older GCC](https://buildbot.python.org/all/#/builders/96/builds/216). I'm researching how to make this conditional in autotools. --

[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-22 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +21824 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/22892 ___ Python tracker <https://bugs.python.org/issu

[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset c6d7e82d19c091af698d4e4b3623648e259843e3 by Petr Viktorin in branch 'master': bpo-38980: Only apply -fno-semantic-interposition if available (GH-22892) https://github.com/python/cpython/commit/c6d7e82d19c091af698d4e4b362364

[issue38980] Compile libpython with -fno-semantic-interposition

2020-10-22 Thread Petr Viktorin
Change by Petr Viktorin : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue38980> ___ ___ Pyth

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2020-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: Yes, for some cases the ship has sailed. I don't think we can add unions now -- the stable ABI needs to be stable. -- ___ Python tracker <https://bugs.python.org/is

[issue26515] Update extending/embedding docs to new way to build modules in C

2020-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: There is now PEP 630. Still not done enough to move it out of draft status, but usable for converting simple modules. -- ___ Python tracker <https://bugs.python.org/issue26

[issue3760] PEP 3121 --- PyType_Copy is missing

2020-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: The need is covered by PEP 384's PyType_FromSpec (and later additions, the latest being PyType_FromModuleAndSpec). Thanks for closing! -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/i

[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-27 Thread Petr Viktorin
Petr Viktorin added the comment: Thanks! That's my plan, but when I added tests I realized I need to pt in some general improvements to the stable ABI first. -- ___ Python tracker <https://bugs.python.org/is

[issue42111] Make the xxlimited module an example of best extension module practices

2020-10-27 Thread Petr Viktorin
Change by Petr Viktorin : -- assignee: -> petr.viktorin ___ Python tracker <https://bugs.python.org/issue42111> ___ ___ Python-bugs-list mailing list Un

[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin
New submission from Petr Viktorin : The following PEP 573 were not added to the Windows list of stable ABI symbols (PC/python3dll.c): - PyModule_AddType - PyType_FromModuleAndSpec - PyType_GetModule - PyType_GetModuleState I'd like to add them. Also, the PEP introduces the (METH_FAS

[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin
Petr Viktorin added the comment: Correction: PyModule_AddType is not from PEP 573. I'd like to add it anyway. -- ___ Python tracker <https://bugs.python.org/is

[issue42171] Add PEP 573 to the stable ABI

2020-10-27 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +21925 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23009 ___ Python tracker <https://bugs.python.org/issu

[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-03 Thread Petr Viktorin
Petr Viktorin added the comment: The PyType_Slot documentation says that the pointer may not be NULL: https://docs.python.org/3/c-api/type.html?highlight=pytype_fromspec#c.PyType_Slot.PyType_Slot.pfunc If you change this, why do it only for tp_doc, but for all the slots? NULL should *always

[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-11-03 Thread Petr Viktorin
Petr Viktorin added the comment: > Can we write those info to docs? In case some developer want to exposing slot > in future. Do you mean something like "only expose a slot if you have a reason for exposing it"? That sounds like a tautology. Where in the docs would this go

[issue42100] Add _PyType_GetModuleByDef

2020-11-03 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41618] [C API] How many slots of static types should be exposed in PyType_GetSlot()

2020-11-05 Thread Petr Viktorin
Petr Viktorin added the comment: My views on individual slots: Not a function, shouldn't be used with PyType_Slot: * tp_dict - I'd add a PyType_GetDict if there is a need to get this * tp_mro - I'd add a PyType_GetMRO if there is a need to get this (There are existing sl

[issue41111] Convert a few stdlib extensions to the limited C API

2020-11-05 Thread Petr Viktorin
Petr Viktorin added the comment: > Maybe we can do add new members for the 8 missing slots See: https://bugs.python.org/issue41618?#msg380414 -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issu

[issue41237] Access violation in python39.dll!meth_dealloc on exit

2020-11-09 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue41237> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40137] TODO list when PEP 573 "Module State Access from C Extension Methods" will be implemented

2020-11-10 Thread Petr Viktorin
Petr Viktorin added the comment: It should be possible to get them back using _PyType_GetModuleByDef. -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue40

[issue14935] PEP 384 Refactoring applied to _csv module

2020-11-10 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +petr.viktorin nosy_count: 2.0 -> 3.0 pull_requests: +22122 pull_request: https://github.com/python/cpython/pull/23224 ___ Python tracker <https://bugs.python.org/issu

[issue42171] Add PEP 573 to the stable ABI

2020-11-10 Thread Petr Viktorin
Petr Viktorin added the comment: Added. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42111] Make the xxlimited module an example of best extension module practices

2020-11-10 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +22123 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23226 ___ Python tracker <https://bugs.python.org/issu

[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-10 Thread Petr Viktorin
Petr Viktorin added the comment: The PR entirely removed the note that a slot's value "May not be NULL". In fact, only tp_doc may be NULL. AFAIK, the restriction is still there for other slots. Can that note be added back? -- status:

[issue41073] [C API] PyType_GetSlot() should accept static types

2020-11-10 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-11 Thread Petr Viktorin
Petr Viktorin added the comment: > `May not be NULL` means everthing is possible No, it does not. It only means a slot's value may not be NULL, which is an important difference between slots and entries in the PyTypeObject structure. It's OK that it's mentioned elsewhere,

[issue41832] PyType_FromSpec() should accept tp_doc=NULL

2020-11-14 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 2b39da49974bda523c5c1a8777bbe30dbafdcd12 by Hai Shi in branch 'master': bpo-41832: Restore note about NULL in PyType_Slot.pfunc (GH-23243) https://github.com/python/cpython/commit/2b39da49974bda523c5c1a8777bbe3

[issue42418] PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE

2020-11-21 Thread Petr Viktorin
Petr Viktorin added the comment: I don't understand this issue. Why would Py_TPFLAGS_BASETYPE make the result of PyType_GetModule() wrong? Is the note in the documentation of PyType_GetModule() not clear? A type and its subtypes may be defined in different modules; why would it be wro

[issue42418] PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE

2020-11-24 Thread Petr Viktorin
Petr Viktorin added the comment: > I missed it when I ported some of my code to heap types and multiphase init. I guess PyType_GetModule() is not good for that use case. If your code is open, could you add a link? -- ___ Python tracker <

[issue38347] pathfix.py does not find Python scripts that have '-' in its filename

2020-11-25 Thread Petr Viktorin
Petr Viktorin added the comment: Note that the pathfix comment says: # Directories are searched recursively for files whose name looks # like a python module. Files with a dash are *not* Python modules, since they can't be imported. Should the comment (which is the only documentatio

[issue36937] New _PyObject_MakeTpCall() function

2019-05-21 Thread Petr Viktorin
Petr Viktorin added the comment: Avoiding the duplication makes sense, but without the rest of PEP 590 it could just be a static function in call.c. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36937] New _PyObject_MakeTpCall() function

2019-05-21 Thread Petr Viktorin
Petr Viktorin added the comment: Ah, sorry, I didn't get the message through. I'll merge it with the rest of PEP 590. Adding the symbol doesn't make sense *right* now. -- ___ Python tracker <https://bugs.pyt

[issue36970] Rename _PyObject_FastCallKeywords

2019-05-21 Thread Petr Viktorin
Petr Viktorin added the comment: If and when a function uses the vectorcall protocol (including the argument offset flag), it makes sense to rename it to vectorcall. Doing it before is misleading, IMO. Splitting fixes to unrelated issues (like bpo-36907) from PEP 590 is great, but this one

[issue36995] tp_print -> tp_vectorcall_offset

2019-05-21 Thread Petr Viktorin
Petr Viktorin added the comment: All these issues are quite confusing. If PEP 590 is accepted, all of it will need to be implemented. Why open separate issues for all the parts? -- ___ Python tracker <https://bugs.python.org/issue36

[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 77aa396bb9415428de09112ddf6b34bb843811eb by Petr Viktorin (Jeroen Demeyer) in branch 'master': bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381) https://github.com/python/cpython/commit/77aa396bb9415428de09112ddf6b34

[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: Jeroen, do you want to also do a backport for 3.7? -- ___ Python tracker <https://bugs.python.org/issue36907> ___ ___ Python-bug

[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: We do, but here the test will need to be changed: Python 3.7.3+ (heads/3.7:791e5fcbab, May 22 2019, 13:37:27) [GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for

[issue36936] CALL_FUNCTION_KW opcode: keyword names must be non-empty

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: Closing per discussion in https://github.com/python/cpython/pull/13357 -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35810] Object Initialization does not incref Heap-allocated Types

2019-05-22 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue31862] Port the standard library to PEP 489 multiphase initialization

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 33e71e01e95506cf8d93fd68251fc56352bc7b39 by Petr Viktorin (Marcel Plch) in branch 'master': bpo-31862: Port binascii to PEP 489 multiphase initialization (GH-4108) https://github.com/python/cpython/commit/33e71e01e95506cf8d93fd68251fc5

[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset d092caf096fa48baadfc0900792206bb5aa0192d by Petr Viktorin (Jeroen Demeyer) in branch '3.7': bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381) (GH-13493) https://github.com/python/cpyt

[issue36907] Crash due to borrowed references in _PyStack_UnpackDict()

2019-05-22 Thread Petr Viktorin
Change by Petr Viktorin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37012] Possible crash due to PyType_FromSpecWithBases()

2019-05-22 Thread Petr Viktorin
New submission from Petr Viktorin : If the PyObject_MALLOC() call failed in PyType_FromSpecWithBases(), PyObject_Free() would be called on a static string in type_dealloc(). Fixed by Zackery Spytz in pull request 10304. I'm opening the issue retroactively. -- messages: 343194

[issue37012] Possible crash due to PyType_FromSpecWithBases()

2019-05-22 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +13412 ___ Python tracker <https://bugs.python.org/issue37012> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37012] Possible crash due to PyType_FromSpecWithBases()

2019-05-22 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +13411 ___ Python tracker <https://bugs.python.org/issue37012> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34626] PEP 384's PyType_Spec and PyType_Slot are not documented

2019-05-24 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset f1e17e9f97d9a4e97a5d99574775ee343a3a74fb by Petr Viktorin in branch 'master': bpo-34626: Document creating heap types from the C-API (GH-9154) https://github.com/python/cpython/commit/f1e17e9f97d9a4e97a5d99574775ee

[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-05-28 Thread Petr Viktorin
Petr Viktorin added the comment: It looks like this caused bpo-37072: PyAST_FromNodeObject doesn't ignore flags any more, and when PyNode_Compile passes NULL flags, it crashes. -- nosy: +petr.viktorin ___ Python tracker <https://bugs.py

[issue37072] PyNode_Compile() crashes in Python 3.8.

2019-05-28 Thread Petr Viktorin
Petr Viktorin added the comment: Looks like this is caused by: https://github.com/python/cpython/pull/12086/files#diff-4d35cf8992b795c5e97e9c8b6167cb34R787 PyAST_FromNodeObject doesn't ignore flags any more, so when PyNode_Compile passes NULL flags, it crashes. (This is unfamiliar cod

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