[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-11-16 Thread Petr Viktorin
Petr Viktorin added the comment: Back to this issue -- do we have any use case other than setting the internal Py_TPFLAGS_DISALLOW_INSTANTIATION flag? If not, I'd like to close this (with apologies for not doing my research and letting Hai Shi do unmerged work). If a use case is fou

[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-11-16 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 9d6215a54c177a5e359c37ecd1c50b594b194f41 by Erlend Egeberg Aasland in branch 'main': bpo-45126: Harden `sqlite3` connection initialisation (GH-28227) https://github.com/python/cpython/commit/9d6215a54c177a5e359c37ecd1c50b

[issue45783] test_freeze fails if a file is removed

2021-11-11 Thread Petr Viktorin
New submission from Petr Viktorin : In Fedora, we remove the bundled wheels; pip & co. are supplied (and kept updated) by the system. I believe this is good practice. However, removing any file from the CPython source checkout makes test_freeze fail: Traceback (most recent call

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-11-02 Thread Petr Viktorin
Petr Viktorin added the comment: Hooray! Congratulations, and thanks for your work and determination to get this done :) -- ___ Python tracker <https://bugs.python.org/issue42

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-11-02 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 401272e6e660445d6556d5cd4db88ed4267a50b3 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Adapt `sqlite3` to multi-phase init (PEP 489) (GH-29234) https://github.com/python/cpython/commit/401272e6e660445d6556d5cd4db88e

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-10-27 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 8f24b7dbcbd83311dad510863d8cb41f0e91b464 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Convert `sqlite3` global state to module state (GH-29073) https://github.com/python/cpython/commit/8f24b7dbcbd83311dad510863d8cb4

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-26 Thread Petr Viktorin
Petr Viktorin added the comment: PEP 630 has motivations and technical notes. What needs to be documented better is how both applies to stdlib. Specifically: - list the behavior changes when static types are converted to heap types (mutability, pickleability, any more?), and document how to

[issue33439] python-config.py should be part of the stdlib

2021-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: It seems it could be moved to sysconfig itself -- the CLI options from python-config would fit there nicely. -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue33

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: > Quoting PEP 630 (active PEP): > > Whenever this PEP mentions extension modules, the advice also applies to > built-in modules, such as the C parts of the standard library. The standard > library is expected to switch to per-module state

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-23 Thread Petr Viktorin
Petr Viktorin added the comment: Pep 640 is Informational, and per PEP 1: Informational PEPs do not necessarily represent a Python community consensus or recommendation, so users and implementers are free to ignore Informational PEPs or follow their advice. (Will reply more tomorrow, I&#

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: > Can I do something for this pending PEP? Ask Victor, he should know more. But as far as I know, no one started on it yet. > I guess the outside user will use it MAYBE. Py_TPFLAGS_DISALLOW_INSTANTIATION is not part of the limited API, so it would b

[issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported

2021-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: Repurposing this bug to track all symbols that don't appear in some configurations. - `Py_FrozenMain` should be added to stable ABI when this is fixed. It was left out of the 3.10 stable ABI for only this reason. See discussion here: https://mail.pytho

[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 276468dddb46c54980c782c09cdb53bd90755752 by Petr Viktorin in branch 'main': bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354) https://github.com/python/cpython/commit/276468dddb46c54980c782c09cdb53

[issue44133] "Py_FrozenMain" symbol is not exported

2021-10-22 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 276468dddb46c54980c782c09cdb53bd90755752 by Petr Viktorin in branch 'main': bpo-43795: Add a test for Stable ABI symbol availability using ctypes (GH-26354) https://github.com/python/cpython/commit/276468dddb46c54980c782c09cdb53

[issue42961] Use-after-free (of a heap type) during finalization

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: as far as I can see, this had the same root cause as bpo-44184, and was fixed in GH-26274. FWIW, the reproducers are missing a `Py_DECREF(type)` after `PyDict_SetItemString`/`PyObject_SetAttrString`; those don't steal the reference. That sent me

[issue44609] Buffer support in the stable ABI

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: That removal was reverted. Thanks for the report! They are still deprecated, which means they may be removed from future API (and only remain in the stable ABI). But I hope that's only considered when the new buffer protocol is available in the stabl

[issue44133] "Py_FrozenMain" symbol is not exported

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: > I'm not sure why, but "Py_FrozenMain" is the *only* impacted symbol of the > whole C API. Apparently, on some platforms `PyModule_Create2` and `PyModule_FromDefAndSpec2` don't appear either. Should I rename the is

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset bfa4237ecfa605ff94e86fa7141f4a8b1f7cc44a by Miss Islington (bot) in branch '3.9': bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) (GH-29120) https://github.com/python/cpyt

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 00ddc1fbd7296ffe066077194a895b175cca26de by Miss Islington (bot) in branch '3.10': bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) (GH-29119) https://github.com/python/cpyt

[issue34451] docs: tutorial/introduction doesn't mention toggle of prompts

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 5a14f71fe869d4a62dcdeb9a8fbbb5884c75060c by Thomas in branch 'main': bpo-34451: Document prompt and output toggle feature in html tutorial (GH-27105) https://github.com/python/cpython/commit/5a14f71fe869d4a62dcdeb9a8fbbb5

[issue45315] `PyType_FromSpec` does not copy the name

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: Since the fix changes the size of PyObject, it can't be backported. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue45315] `PyType_FromSpec` does not copy the name

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 8a310dd5f4242b5d28013c1905c6573477e3b957 by Petr Viktorin in branch 'main': bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (GH-29103) https://github.com/python/c

[issue44220] PyStructSequence_UnnamedField unavailable on Windows

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: It should be available in python3x.dll (e.g. pyhon310.dll). It is not available in python3.dll (the stable ABI), until Python 3.11. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -P

[issue44220] PyStructSequence_UnnamedField unavailable on Windows

2021-10-21 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 2cbf50e8126905b57ba9d0d5aa4e238c817d5a03 by Ken Jin in branch 'main': bpo-44220: Export PyStructSequence_UnnamedField in the limited API (GH-26331) https://github.com/python/cpython/commit/2cbf50e8126905b57ba9d0d5aa4e23

[issue45315] `PyType_FromSpec` does not copy the name

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

[issue45315] `PyType_FromSpec` does not copy the name

2021-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: > the simplest solution is calling `type_set_name`, even if that runs some > unnecessary checks. Unfortunately this won't work, because it sets ht_name to the same value as tp_name. For historical reasons, the two can be different (and often are)

[issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10

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

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

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

[issue45525] PyType_Spec basicsize/itemsize should allow -1 for "inherit"

2021-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: Hm, after sleeping on it, I think I filed this too soon. If you don't have the superclass's C memory layout (and you can't add new C-level state), it's not likely that you want to define a class in C. I can construct theoretical cases wher

[issue45459] Limited API support for Py_buffer

2021-10-20 Thread Petr Viktorin
Petr Viktorin added the comment: No. Limited API is generally not as performant as the non-limited one. It is even documented this way: https://docs.python.org/3/c-api/stable.html#limited-api-scope-and-performance We should not make it *much* slower, but code that can take advantage of

[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

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

[issue45525] PyType_Spec basicsize/itemsize should allow -1 for "inherit"

2021-10-19 Thread Petr Viktorin
New submission from Petr Viktorin : For cases where you aren't adding new C-level state, especially if don't have the superclass' struct available, it would be good to allow inheriting basicsize/itemsize from the superclass. (SuperType->tp_size is not easily usable f

[issue4304] build mode which fails for build failures in extensions

2021-10-19 Thread Petr Viktorin
Petr Viktorin added the comment: This would be nice. Too often when hacking on an extension, test pass just because I don't notice there was a compile error and so I'm testing an older version. -- nosy: +petr.viktorin ___ Python track

[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-19 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +27328 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/29061 ___ Python tracker <https://bugs.python.org/issu

[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-19 Thread Petr Viktorin
Petr Viktorin added the comment: Nothing from marshal.h is part of the limited API, and nothing from there is exported in the stable ABI DLL. The entire file should be in `#ifndef Py_LIMITED_API`, rather than just a part. -- status: closed -> o

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-19 Thread Petr Viktorin
Petr Viktorin added the comment: Ah, sorry, I overlooked the flags. This does beg the question: what else from PyType_Spec will be needed? I guess we don't want to allow additional slots/methods. (Combining them would be hard anyway; if someone needs them they should make a subclass.)

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-10-19 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 09c04e7f0d26f0006964554b6a0caa5ef7f0bd24 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Add module backref to `sqlite3` callback context (GH-28242) https://github.com/python/cpython/commit/09c04e7f0d26f0006964554b6a0caa

[issue45459] Limited API support for Py_buffer

2021-10-19 Thread Petr Viktorin
Petr Viktorin added the comment: > I recommend to get feedback from NumPy, Pillow, and Cython devs first. Could you split this into two PRs: one to add the new API, and another to add things to the limited set? There's no rush to add it to the limited API, esp. since it can

[issue45474] [C API] marshal.h must not use FILE* type in the limited C API

2021-10-15 Thread Petr Viktorin
Petr Viktorin added the comment: Just note that these were *not* part of the limited API, which is defined in Misc/stable_abi.txt rather than the #ifdefs: https://docs.python.org/3.10/c-api/stable.html#stable If they were, the functions would need to remain in the stable ABI

[issue45315] `PyType_FromSpec` does not copy the name

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: > Hm, I haven't find any case who use dynamical tp_name of Type_Spec > temporarily. The use case is creating types entirely on demand, with dynamically created specs. This is useful e.g. for wrapping objects of a different object system, like C

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: The new issue is bpo-45383. There's a sprint newt week; I'll probably get to it then. > But, I am trying to understand the preference for static better. There is > probably something to learn or even important I am missing. The origina

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: Oh! I assumed this bug wasn't resolved, but it is -- in bpo-34784. Sorry, I should have checked! The only thing the proposed PR adds is a way to set ht_module, which actually isn't very useful (it's used for module state access, but PyStru

[issue40512] [subinterpreters] Meta issue: per-interpreter GIL

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: PyStructSequence_NewType exists, and is the same as the proposed PyStructSequence_FromModuleAndDesc except it doesn't take the module (which isn't necessary: PyStructSequence_Desc has no way to define functionality that would need the mo

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset cfb1df3b71501a80ed57739181ec2ed30012c491 by Erlend Egeberg Aasland in branch 'main': bpo-44991: Normalise function and collation callback naming (GH-28209) https://github.com/python/cpython/commit/cfb1df3b71501a80ed57739181ec2e

[issue45413] Add install scheme for virtual environments

2021-10-12 Thread Petr Viktorin
Petr Viktorin added the comment: Starting out with just "venv" doesn't mean we can't add "posix_venv"/"nt_venv" later (if e.g. someone needs to install into a filesystem for another platform). -- nosy: +petr.viktorin __

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-10-05 Thread Petr Viktorin
Petr Viktorin added the comment: > I am slightly surprised we actually care about static C-definitions? And I'm surprised that you're surprised :) AFAIK, supporting dynamically allocated specs/slots was an afterthought. I do agree they should be supported, though! Thanks for fil

[issue41994] Refcount issues in import

2021-09-27 Thread Petr Viktorin
Petr Viktorin added the comment: Please don't use private API. The underscore at the beginning marks the function as private. (This has been the case for a long time; in 3.10 it is finally officially documented: https://docs.python.org/3.10/c-api/stable.html#stable ) It has been remov

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-24 Thread Petr Viktorin
Petr Viktorin added the comment: > But at least if it's available as a slot then a module is *able* to use it > with limited ABI going backwards. A new function doesn't allow that. I think you're confusing PyType_Slot with the tp_* members of type structures. If a Py

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-09-23 Thread Petr Viktorin
Petr Viktorin added the comment: - specs/slots are (usually) constant & static; pointers to types are not always C constant expressions (on Windows, if they come from a different DLL) - specs/slots are (usually) shared across all subinterpreters; types are specific to a single interpr

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-22 Thread Petr Viktorin
Petr Viktorin added the comment: > The ABI is not broken, the only thing that this PR change is the size of the > struct. All the offsets to the members are the same and therefore will be > valid in any compiled code. I'll just note that a change in struct size does technic

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-21 Thread Petr Viktorin
Petr Viktorin added the comment: Subinterpreters are not the only reason to do this (and they're not *my* reason to do it). Adding a way to create PyStructSequence heap will help users of the stable ABI, where reduced performance is a known tradeoff (see https://www.python.org/dev/pep

[issue45155] Add default arguments for int.to_bytes()

2021-09-13 Thread Petr Viktorin
Petr Viktorin added the comment: > I’m not convinced. I’m more concerned with the obscurity of the API. If I > saw its use in some code I was reviewing, I’d look it up, and then I’d know > exactly what it was doing. I know you would. But there are many others who just try things u

[issue45155] Add default arguments for int.to_bytes()

2021-09-10 Thread Petr Viktorin
Petr Viktorin added the comment: Exactly, a platform-dependent default is a bad idea. A default allows using the function without the code author & reviewer even being *aware* that there is a choice, and that is dangerous. -- nosy: +petr.vikt

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: As for the effort to fix this: If we deprecate this, there should be no new users of it in 3.11+. If we deprecate and also fix this, and we happen to introduce bugs or behavior changes, then people that use it now will need to: 1) adapt to the new behavior 2

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: I think a deprecation should be discussed a bit more widely than on bpo, so I opened a thread here: https://discuss.python.org/t/deprecating-sqlite-object-reinitialization/10503 -- ___ Python tracker <ht

[issue45089] [sqlite3] the trace callback does not raise exceptions on error

2021-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: It *would* be possible to improve the documentation, though. Say that it is only meant for debugging, document that exceptions are not propagated, and mention enable_callback_tracebacks. -- assignee: -> docs@python components: +Documentation n

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Petr Viktorin
Petr Viktorin added the comment: This is a minefield. If anyone has a use case for it, I'd *love* to hear it, but to me it seems that proper reinit support will be a lot of work (now and in future maintenance) for no gain. You can always create a new connection object. Consider in

[issue45127] Code objects can contain unmarshallable objects

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: See also bpo-42839 -- ___ Python tracker <https://bugs.python.org/issue45127> ___ ___ Python-bugs-list mailing list Unsub

[issue42839] SourceFileLoader does not (fully) accept path-like objects

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: I just filed the slightly more general bpo-45127. -- nosy: +petr.viktorin ___ Python tracker <https://bugs.python.org/issue42

[issue45127] Code objects can contain unmarshallable objects

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: How to fix this? I guess: * co_filename should be converted to an actual str, or reject subclasses with an exception * for co_consts, the [marshal docs] could be updated to add code objects to "containers". The [code docs] already say co_consts &

[issue45127] Code objects can contain unmarshallable objects

2021-09-07 Thread Petr Viktorin
Change by Petr Viktorin : Added file: https://bugs.python.org/file50269/reproducer_compileall.py ___ Python tracker <https://bugs.python.org/issue45127> ___ ___ Pytho

[issue45127] Code objects can contain unmarshallable objects

2021-09-07 Thread Petr Viktorin
New submission from Petr Viktorin : The `replace` method of `code` allows setting e.g. * co_filename to a subclass of str * co_consts to an arbitrary tuple and possibly more weird cases. This makes code objects unmarshallable. One way to create such a code object is to call

[issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: (Sorry for the extra `and`; I hit Submit too soon) -- ___ Python tracker <https://bugs.python.org/issue45035> ___ ___ Python-bug

[issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: AFAICS: this is a bug, but in deprecated code. Not worth fixing in 3.11, and definitely not worth fixing in a RC, and . People should stop using distutils, and those who can't won't be happy with changes to it. Consider that existing distutils iss

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

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

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 979336de34e3d3f40cf6e666b72a618f6330f3c1 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Pass module state to trace, progress, and authorizer callbacks (GH-27940) https://github.com/python/cpyt

[issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: I believe everything is in order now. -- ___ Python tracker <https://bugs.python.org/issue44860> ___ ___ Python-bugs-list mailin

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: The remaining function_pinboard_* renames are part of PR-27940. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 0474d06008f8c9eba660ed20d336ffdc5c4db121 by Erlend Egeberg Aasland in branch 'main': bpo-44991: Normalise `sqlite3` callback naming (GH-28088) https://github.com/python/cpython/commit/0474d06008f8c9eba660ed20d336ff

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 0474d06008f8c9eba660ed20d336ffdc5c4db121 by Erlend Egeberg Aasland in branch 'main': bpo-44991: Normalise `sqlite3` callback naming (GH-28088) https://github.com/python/cpython/commit/0474d06008f8c9eba660ed20d336ff

[issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: The use case is a "personal stash of Python modules", described here: https://docs.python.org/3/install/#alternate-installation-the-home-scheme We don't need the lib/lib64 distinction here. I'd revert the 3.11 change and

[issue45035] sysconfig's posix_home scheme has different platlib value to distutils's unix_home

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: Here, I'm not sure. What do people use --home for? I don't think we need to match the `/usr/` scheme here. For Python software that's not part of a distro, I think just `lib/` is fine. -- nosy:

[issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: Possibly together with PR28011. -- ___ Python tracker <https://bugs.python.org/issue44860> ___ ___ Python-bugs-list mailin

[issue44860] sysconfig's posix_user scheme has different platlib value to distutils's unix_user

2021-09-07 Thread Petr Viktorin
Petr Viktorin added the comment: Marking as *potential* release blocker for 3.10. Pablo, without this change the newest pip (with [PR 10358]) will not work on Python 3.10 built --with-platlibdir. This configure option was added in 3.9 for distros that separate `/usr/lib` and `/usr/lib64

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-06 Thread Petr Viktorin
Petr Viktorin added the comment: I think you will run into issues with allocating tp_members, because there isn't a good mechanism to for type objects to manage C-level data. But I encourage you to try, so you get a better understanding of the pr

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-08-31 Thread Petr Viktorin
Petr Viktorin added the comment: > Would it be sufficient to hold a reference to the connection object? Yes. -- ___ Python tracker <https://bugs.python.org/issu

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-08-31 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 01dea5f12b31862999217c091399a318f23b460a by Petr Viktorin in branch 'main': bpo-42064: Offset arguments for PyObject_Vectorcall in the _sqlite module (GH-27931) https://github.com/python/cpython/commit/01dea5f12b31862999217c091399a3

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-08-31 Thread Petr Viktorin
Petr Viktorin added the comment: Here's a gotcha you might not be aware of: `create_callback_context` stashes away a pointer to `state`. I don't think we can prove that the `state` will always outlive the callback_context after it'll become possible to deallocate the mo

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread Petr Viktorin
Petr Viktorin added the comment: PyUnicode_KIND does *not* expose the implementation details to the programmer. If the internal representation os strings is switched to use masks and shifts instead of bitfields, PyUnicode_KIND (and others) can be adapted to the new details without breaking

[issue45025] Reliance on C bit fields in C API is undefined behavior

2021-08-30 Thread Petr Viktorin
Petr Viktorin added the comment: The macro PyUnicode_KIND is part of the documented public C API. It accesses the bit field "state.kind" directly. -- ___ Python tracker <https://bugs.python.o

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

2021-08-25 Thread Petr Viktorin
Petr Viktorin added the comment: The general policy is to only improve style for code you touch for some other reasons. You're changing lots of the callback code in bpo-42064, so I reckon making things more readable is fine. -- ___ Python tr

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-08-24 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +26380 pull_request: https://github.com/python/cpython/pull/27931 ___ Python tracker <https://bugs.python.org/issue42

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-08-24 Thread Petr Viktorin
Petr Viktorin added the comment: I think the module could use a more comprehensive review for GIL handling, rather than doing it piecewise in individual PRs. I recommend that any function passed to SQLite (and only those) should - be named `*_callback`, for clarity - acquire the GIL at

[issue42035] [C API] PyType_GetSlot cannot get tp_name

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

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: Now, I wonder if we should also introduce PyType_GetModuleName for __module__, or stop and close this as fixed. -- ___ Python tracker <https://bugs.python.org/issue42

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset fcd651d16fc5ac3d07dd3f57f1001a861a2e7d23 by Hai Shi in branch 'main': bpo-42035: Enhance test_get_type_name() of _testcapi (GH-27649) https://github.com/python/cpython/commit/fcd651d16fc5ac3d07dd3f57f1001a

[issue26871] Change weird behavior of PyModule_AddObject()

2021-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: Since https://github.com/python/cpython/pull/23122, there is PyModule_AddObjectRef doesn't steal a reference. PyModule_AddObject is discouraged in the docs, but not formally deprecated. (As Stefan notes, the leaks are single references in case of a m

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 3e2c643ae0b21f9e596bfd9c8ec99ca546ea8d0f by Hai Shi in branch 'main': bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551) https://github.com/python/cpython/commit/3e2c643ae0b21f9e596bfd9c8

[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-08-17 Thread Petr Viktorin
Petr Viktorin added the comment: > Maybe the old behavior was better: if an extension uses the old API, share > its state between all interpreters. Yes, I think the old behavior was better: if an extension uses the old API, share its state between all interpreters. This is obvious

[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-05 Thread Petr Viktorin
Petr Viktorin added the comment: I see that I wrote "counts" rather than "cycles" before; that line should be: The clear function is used to break reference cycles. In this case, there are no reference cycles to be broken, so it is not called. Thanks to Pablo for the

[issue41103] Removing old buffer support

2021-08-05 Thread Petr Viktorin
Petr Viktorin added the comment: These should be removed from the *limited API*, but stay for the stable ABI. (PEP 652 mentions this can happen but doesn't give details, which will be a bit tricky. These are good candidates for figuring out the process.) I assigned this to myself; I&#

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Petr Viktorin
Petr Viktorin added the comment: I've sent a mail to python-dev: https://mail.python.org/archives/list/python-...@python.org/thread/MGPNI7OSA7UXNOTVDVW2I2GUMXV25FRS/ -- ___ Python tracker <https://bugs.python.org/is

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-04 Thread Petr Viktorin
Petr Viktorin added the comment: The issue this (or lack of communication about it) caused in rc1 is tracked in https://bugs.python.org/issue44823 > @petr.viktorin a whatsnew entry was added, what more notice could have been > provided? Ideally, the python-dev mailing list (or Dis

[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-03 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +26085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27581 ___ Python tracker <https://bugs.python.org/issu

[issue44756] In ./Doc, "make html" and "make build" should depend on "make venv"

2021-08-03 Thread Petr Viktorin
Petr Viktorin added the comment: I'm one of those who disagree with "make html" suddenly downloading code from the internet and running it, but I guess I'm in a minority. I'll switch to using `sphinx-build` directly. Still, I'd have appreciated a hea

[issue44301] Is there a way to provide destructor for module written using C API?

2021-08-03 Thread Petr Viktorin
Petr Viktorin added the comment: You are missing m_free. The clear function is used to break reference counts. In this case, there are no reference counts to be broken, so it is not called. Your custom_clear function is idempotent, so you can use it in both free and clear and let Python

[issue15870] PyType_FromSpec should take metaclass as an argument

2021-08-02 Thread Petr Viktorin
Petr Viktorin added the comment: > 2. Use eval from C to create the class with a metaclass, eg. > class Foo(metaclass=MessageMeta) You can also call (PyObject_Call*) the metaclass with (name, bases, namespace); this should produce a class. Or not: >>> class Foo(

[issue43565] PyUnicode_KIND macro does not has specified return type

2021-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: Thank you for your attention to detail! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43565] PyUnicode_KIND macro does not has specified return type

2021-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 7922546859e746a0f20f53bc80ce0581b72030aa by Miss Islington (bot) in branch '3.9': bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27440) https://github.com/python

[issue43565] PyUnicode_KIND macro does not has specified return type

2021-07-29 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset b5bdc0c407d2d0587e591989e390ada9b9709502 by Miss Islington (bot) in branch '3.10': bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27439) https://github.com/python

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