-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failures with Python 3.13: TypeError: argument list must be a tuple #408
Comments
I haven't done any work on 3.13 yet. Normally I wait until the beta phase to test, since there’s otherwise a lot of churn (as you already noted with this vectorcall thing). If Fedora needs this sooner, please open a PR to test on 3.13 and try to fix the issues. (Also, consider sponsoring... 😉). |
I edited my report, reinstalling Python 3.13 solved the |
I will try fixing the failures, but I open this issue anyway in case you have an idea right now what might be the reason. I don't have the authority to sponsor on behalf of Fedora, sorry. |
Maybe you can buy my books with your learning budget! |
I suspect the failure is caused by python/cpython@4fe22c73770 The time-machine module replaces functions from the CPython time module. The replaced CPython functions might no longer take arg tuples. The are now METH_O |
I have code that works with 3.13. Will make it backward compatible now. |
This code to override PyCFunctionObject *time_clock_gettime_ns = (PyCFunctionObject *) PyObject_GetAttrString(time_module, "clock_gettime_ns");
if (time_clock_gettime_ns != NULL) {
state->original_clock_gettime_ns = time_clock_gettime_ns->m_ml->ml_meth;
time_clock_gettime_ns->m_ml->ml_meth = _time_machine_clock_gettime_ns;
Py_DECREF(time_clock_gettime_ns);
} Why not just calling |
The pointer replacement is the whole point of time-machine. Replacing the module level function doesn’t affect imports like |
If you monkey-patch the module, you can do it early. Or you can override the libc function with LD_PRELOAD. If you prefer to modify |
The whole inspiration of time-machine is that those mechanisms are insufficient. It’s really hard or impossible to monkey-patch early enough and I’d be interested to know about other possible techniques if you have any!
Indeed, this is what all the other methods do. There were previously forks for calling convention changes until Python 3.7 support was dropped, see 6ca4673, ab7a388. |
Python Version
3.13.0a2
pytest Version
7.4.3
Package Version
2.13.0 (main)
Description
Hello. In Fedora, we are trying to build everything with pre-releases of Python 3.13. Currently, we have 3.13.0a2.
Many projects have moved from freezegun to time-machine and we cannot test them unless we have a working time-machine first.
To reproduce the test failures we see in Fedora, I cloned this repository and did:
The text was updated successfully, but these errors were encountered: