Comments (2)
Ah, my awful hack finally broke! I'm surprised it didn't happen sooner...
The relevant CPython commit appears to be python/cpython@dcaf33a, which removes the StgDict
class and replaces all uses of it with regular dict
objects. The extra C data previously stored in StgDict
s is now stored as part of the regular dict
s, using a new standard mechanism added in CPython 3.12.
Thankfully, the fields we care about are still structured almost identically as before - only the location where they are stored has changed. So as long as we can figure out the new location of the data, it should be easy to adjust the patch to work with both the old and new ways.
The way to access the new attached data is using the PyStgInfo_FromType
function from _ctypes/ctypes.h. Unfortunately, that function is static inline
, so we can't call it directly. Instead, ctypes_patch
would have to reimplement the relevant code. Thankfully, it doesn't look too complex.
That said, this would also be a good opportunity to upstream our patch into CPython itself, so it would be properly supported and maintained. Then we could stop doing our risky runtime patching... There is already an open CPython issue for this since 2009 (python/cpython#49960, formerly known as bpo-5710), so clearly others are interested in this too. I don't remember why we didn't try upstreaming this patch earlier - though most likely there is no particular reason and just nobody had the time for it.
from rubicon-objc.
I took a quick poke after I logged this bug, and came to about the same conclusion as you have.
The upstream bug has been on my "I really should do something about that" list for a while. I agree that this would be an ideal opportunity to fix this bug upstream - finally removing this compatibility shim would be awesome.
from rubicon-objc.
Related Issues (20)
- Update CI configuration to test release artefacts
- Improve correspondence between ObjectiveC objects and Python wrappers HOT 17
- New caching logic may inadvertently release objects that are still needed HOT 5
- ctypes.ArgumentError message is split into individual characters
- Warning about deprecated `pkg_resources` API
- Incompatibility with `from __future__ import annotations` HOT 1
- Incompatibility with Python 3.12.0b1 HOT 4
- Scroll blocks eventloop for ios HOT 3
- Can't invoke Protocol methods that collide with object properties HOT 2
- "ImportError: No module named 'rubicon'" if trying to bundle script via py2app. HOT 1
- Sphinx 7.2 dropped support for Python 3.8
- Importing rubicon.objs hangs on pypy HOT 1
- Normalize contribution docs with Briefcase/Toga
- Duplicate elements in repr of `ObjCInstance` HOT 7
- Event loop stalls in network test
- Change the implementation of ObjCStrInstance HOT 2
- Partial method argument order HOT 5
- Improve the error message of partial methods HOT 3
- `SafeChildWatcher` is deprecated in Python 3.14 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubicon-objc.