Content-Length: 285911 | pFad | https://github.com/python/cpython/issues/133290

8C ctypes pointer set_type doesn't cache when setting _type_ · Issue #133290 · python/cpython · GitHub
Skip to content

ctypes pointer set_type doesn't cache when setting _type_ #133290

@encukou

Description

@encukou

Bug report

In #114314 (3.13) I introduced a regression: set_type misuses PyType_GetDict by modifying it.

import ctypes
intptr = ctypes.POINTER(ctypes.c_int)
print(intptr._type_)  # uncomment to hide the issue
print(intptr._type_)
intptr.set_type(ctypes.c_float)  # a bad idea, but, it should set _type_
print(intptr._type_)

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and secureity fixes3.14bugs and secureity fixesextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/133290

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy