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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
Change by Petr Viktorin :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45474>
___
___
Pyth
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
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
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
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
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.)
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
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
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
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
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
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
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
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
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
__
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
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
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
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
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
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
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
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
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
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
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
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
Petr Viktorin added the comment:
See also bpo-42839
--
___
Python tracker
<https://bugs.python.org/issue45127>
___
___
Python-bugs-list mailing list
Unsub
Petr Viktorin added the comment:
I just filed the slightly more general bpo-45127.
--
nosy: +petr.viktorin
___
Python tracker
<https://bugs.python.org/issue42
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 &
Change by Petr Viktorin :
Added file: https://bugs.python.org/file50269/reproducer_compileall.py
___
Python tracker
<https://bugs.python.org/issue45127>
___
___
Pytho
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
Petr Viktorin added the comment:
(Sorry for the extra `and`; I hit Submit too soon)
--
___
Python tracker
<https://bugs.python.org/issue45035>
___
___
Python-bug
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
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
Petr Viktorin added the comment:
I believe everything is in order now.
--
___
Python tracker
<https://bugs.python.org/issue44860>
___
___
Python-bugs-list mailin
Petr Viktorin added the comment:
The remaining function_pinboard_* renames are part of PR-27940.
--
___
Python tracker
<https://bugs.python.org/issue44
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
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
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
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:
Petr Viktorin added the comment:
Possibly together with PR28011.
--
___
Python tracker
<https://bugs.python.org/issue44860>
___
___
Python-bugs-list mailin
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
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
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
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
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
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
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
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
Change by Petr Viktorin :
--
pull_requests: +26380
pull_request: https://github.com/python/cpython/pull/27931
___
Python tracker
<https://bugs.python.org/issue42
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
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
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
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
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
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
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
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
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
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
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(
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
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
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
101 - 200 of 907 matches
Mail list logo