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:
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:
> 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:
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:
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:
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:
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:
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:
> 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:
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:
> 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:
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:
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:
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
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:
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
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
Change by Petr Viktorin :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45474>
___
___
Pyth
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
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
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:
> 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 :
--
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:
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
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 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:
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 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:
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 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:
> 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:
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:
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:
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:
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:
> 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:
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:
> 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:
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:
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:
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:
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:
Hooray!
Congratulations, and thanks for your work and determination to get this done :)
--
___
Python tracker
<https://bugs.python.org/issue42
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:
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
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:
I argued for keeping colorsys: RGB/HLS/HSV are useful in several fields.
Colorsys is a nice low-power battery to have around for e.g. picking a color
for highlighting any kind of output.
YIQ is the odd one out: it describes actual color, rather than
New submission from Petr Viktorin :
Parsing a script with non-UTF-8 encoding and a missing close parenthesis, like
a file with the following 2 lines:
# encoding: ascii
(
... crashes with:
python: Parser/pegen.c:408: get_error_line: Assertion `p->tok->fp == NULL ||
p->tok->
Change by Petr Viktorin :
--
title: Pegen's nice error reporting crashes non-UTF-8 files -> Pegen's nice
error reporting crashes with non-UTF-8 files
___
Python tracker
<https://bugs.pytho
Petr Viktorin added the comment:
Wow! Thank you for the quick fix!
--
___
Python tracker
<https://bugs.python.org/issue45848>
___
___
Python-bugs-list mailin
Change by Petr Viktorin :
--
keywords: +patch
nosy: +petr.viktorin
nosy_count: 7.0 -> 8.0
pull_requests: +27958
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29578
___
Python tracker
<https://bugs.p
Petr Viktorin added the comment:
I think it's a good idea, but without the "will be disallowed in Python 3.13"
part -- we should tell people that it's discouraged, but there's not much point
in removing it.
But there's no consensus whether that's a good wa
Petr Viktorin added the comment:
New changeset 8ed1495ad900dd815ff8fb97926da5312aaa23f9 by Eric Snow in branch
'main':
bpo-45783: Preserve file moves and deletions in the tests for the freeze tool.
(GH-29527)
https://github.com/python/cpython/commit/8ed1495ad900dd815ff8fb97926da5
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Petr Viktorin added the comment:
> YUV is a common color encoding system. It's used by the JPEG image format and
> MPEG video format for example.
As far as I understand it, the YUV/RGB conversion used by JPEG is not the same
as the one used by MPEG, and neither of those is the
Change by Petr Viktorin :
--
resolution: -> fixed
status: -> closed
___
Python tracker
<https://bugs.python.org/issue34451>
___
___
Python-bugs-list
Petr Viktorin added the comment:
Yes. This is a minor bug in the deprecated distutils module.
--
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Petr Viktorin added the comment:
Now, is this a bugfix, or a new feature?
I lean toward calling it a bugfix and backporting to earlier versions.
--
___
Python tracker
<https://bugs.python.org/issue45
Petr Viktorin added the comment:
The NUL check was around for a long time, available to be used (XKCD-1172
style) as a simple check against reading binary files. The change did break
tests of distutils.
Maybe it deserves a What's New entry?
--
nosy: +petr.vik
Petr Viktorin added the comment:
*docutils, not distutils
--
___
Python tracker
<https://bugs.python.org/issue27580>
___
___
Python-bugs-list mailing list
Unsub
Change by Petr Viktorin :
--
pull_requests: +28180
pull_request: https://github.com/python/cpython/pull/29956
___
Python tracker
<https://bugs.python.org/issue43
Petr Viktorin added the comment:
Sadly, the backport is non-trivial. I'm putting on my TODO list, but I doubt
I'll get to it soon :(
--
___
Python tracker
<https://bugs.python.o
Petr Viktorin added the comment:
+1, PyUnicodeObject/PyASCIIObject is excluded from the limited API since Python
3.2, so it wasn't possible to use this macro.
--
___
Python tracker
<https://bugs.python.org/is
Petr Viktorin added the comment:
Antoine has a good point. We can freeze the Py_buffer struct. If it needs to be
extended in the future, it'll need a new set of functions and names -- and
perhaps a versioning scheme. We'll know more about the problem when/if it
Petr Viktorin added the comment:
The current struct is also likely to continue covering most future uses.
If we decide to add PyBufferEx functions but continue providing the current
ones (with the current struct), most users won't be affected. (But it'll be a
bit more work f
Petr Viktorin added the comment:
Thank you for the fix!
--
nosy: +petr.viktorin
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Petr Viktorin added the comment:
The change silently disables 2 tests, see comment here:
https://github.com/python/cpython/commit/66cd041df8dfadd001ae298292e16f0271c0d139#diff-ba7d7a4a1a0050e1f497b71b5cd50afcR365
(I think it's better to reopen this bug, than to open a new one, so al
Petr Viktorin added the comment:
It seems that the test actually requires >4GB disk space, because it's copying
a 2GB file from one place to another.
Also, it's using a temporary directory. On Fedora /tmp is memory-backed by
default, it doesn't use regular disk space
Petr Viktorin added the comment:
The test passes with a 8GB /tmp, but not a 6GB one.
That could suggest the test needs 3*2GB disk space for temporary files, plus
something extra.
--
___
Python tracker
<https://bugs.python.org/issue37
Petr Viktorin added the comment:
A refcount problem possibly caused by the fix:
https://bugs.python.org/issue39016
--
nosy: +petr.viktorin
___
Python tracker
<https://bugs.python.org/issue28
Change by Petr Viktorin :
--
pull_requests: +17047
pull_request: https://github.com/python/cpython/pull/17573
___
Python tracker
<https://bugs.python.org/issue28
Petr Viktorin added the comment:
Steve, I would like to add your reproducer (weird.py) to CPython's test suite,
to make sure this doesn't happen again.
Would you be willing to sign the contributor agreement, so we can use your code
in Python?
The instructions are h
Petr Viktorin added the comment:
lookup_maybe_method should not return a borrowed reference. It increfs its
return value.
--
nosy: +petr.viktorin
___
Python tracker
<https://bugs.python.org/issue39
Petr Viktorin added the comment:
The goal now should be to find a reasonably small reproducer.
I'm trying to compile PySide to see what it does, but it's a big project and
I'm a bit lost.
Christian, you said in an e-mail that you have a workaround -
Petr Viktorin added the comment:
Thanks!
(note: unfortunately I'll probably not have time for CPython until next week,
but further investigation is on my list.)
--
___
Python tracker
<https://bugs.python.org/is
New submission from Petr Viktorin :
As per PEP 590, in Python 3.9 the Vectorcall API will be public, i.e. without
leading underscores.
--
messages: 359506
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: Public API for Vectorcall (PEP 590
Change by Petr Viktorin :
--
components: +C API
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue39245>
___
___
Python-bugs-list mailin
Petr Viktorin added the comment:
issue39245 tracks making the API public in Python 3.9.
--
___
Python tracker
<https://bugs.python.org/issue36974>
___
___
Pytho
Change by Petr Viktorin :
--
keywords: +patch
pull_requests: +17303
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17893
___
Python tracker
<https://bugs.python.org/issu
Petr Viktorin added the comment:
Thanks for the report. I'll draft something better.
--
___
Python tracker
<https://bugs.python.org/issue39161>
___
___
Change by Petr Viktorin :
--
pull_requests: +17306
pull_request: https://github.com/python/cpython/pull/17896
___
Python tracker
<https://bugs.python.org/issue37
Change by Petr Viktorin :
--
pull_requests: +17311
pull_request: https://github.com/python/cpython/pull/17893
___
Python tracker
<https://bugs.python.org/issue37
Change by Petr Viktorin :
--
keywords: +patch
pull_requests: +17312
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17896
___
Python tracker
<https://bugs.python.org/issu
Petr Viktorin added the comment:
> There is also one aspect where i586 builds end up with different .pyc files
> than x86_64 builds. And then we randomly chose one of them for our "noarch"
> python module packages and hope they work everywhere (including on arm and
&
Change by Petr Viktorin :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue39161>
___
___
Pyth
Petr Viktorin added the comment:
Thank you, Mihail and Karthikeyan!
--
nosy: +petr.viktorin
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/i
Petr Viktorin added the comment:
New changeset aabdeb766b7fa581e7de01f3c953b12792f0736d by Petr Viktorin (David
Carlier) in branch 'master':
bpo-38960: DTrace build fix for FreeBSD. (GH-17451)
https://github.com/python/cpython/commit/aabdeb766b7fa581e7de01f3c953b12792f0736d
-
Petr Viktorin added the comment:
> What is the problem between _Py_IDENTIFIER and multi-phase initialisation
> modules?
AFAIK there is no problem now, except possibly a race condition when
initializing the identifiers.
It seems it's too easy to conflate porting to multi-phase ini
Petr Viktorin added the comment:
PR for removing __version__ from mock:
https://github.com/python/cpython/pull/17977
--
nosy: +petr.viktorin
___
Python tracker
<https://bugs.python.org/issue31
Change by Petr Viktorin :
--
stage: patch review -> needs patch
___
Python tracker
<https://bugs.python.org/issue31826>
___
___
Python-bugs-list mai
Petr Viktorin added the comment:
IMO, PyCFunction* should be a CPython-specific implementation detail: alternate
implementations of the C-API don't need to support them, and extension authors
should be fine without using them. (And if not, more efforts like PEP 590
Vectorcall should ma
Petr Viktorin added the comment:
I'm with Stefan on "Definitely 3.8". It's a bug fix (for a rarely used feature).
--
___
Python tracker
<https://bug
Change by Petr Viktorin :
--
pull_requests: +17834
pull_request: https://github.com/python/cpython/pull/18460
___
Python tracker
<https://bugs.python.org/issue39
Change by Petr Viktorin :
--
pull_requests: +17837
pull_request: https://github.com/python/cpython/pull/18464
___
Python tracker
<https://bugs.python.org/issue37
Petr Viktorin added the comment:
New changeset ffd9753a944916ced659b2c77aebe66a6c9fbab5 by Petr Viktorin in
branch 'master':
bpo-39245: Switch to public API for Vectorcall (GH-18460)
https://github.com/python/cpython/commit/ffd9753a944916ced659b2c77aebe6
Petr Viktorin added the comment:
New changeset f3fda374685dffa31ebda9e681e00ef7032b8a1d by Victor Stinner in
branch 'master':
bpo-38644: Rephrase What's New entry (GH-18461)
https://github.com/python/cpython/commit/f3fda374685dffa31ebda9e681e00ef7032b8a1d
--
nosy:
Change by Petr Viktorin :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Petr Viktorin added the comment:
The current return type already is Py_ssize_t, exactly for the reason you
mention – compatibility with all other "argument count" values in Python. (It
would be more correct to use unsigned, but that ship has sailed.)
The *argument* type is unsig
301 - 400 of 907 matches
Mail list logo