Skip to content
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

Tests fail on Python 3.12 #13

Closed
icemac opened this issue Jun 5, 2024 · 5 comments · Fixed by #12
Closed

Tests fail on Python 3.12 #13

icemac opened this issue Jun 5, 2024 · 5 comments · Fixed by #12

Comments

@icemac
Copy link
Member

icemac commented Jun 5, 2024

PROBLEM REPORT

What I did:

Run the tests on Python 3.12 via #12

What I expect to happen:

Succeeding tests.

What actually happened:

Test failures with forbidden attributes, see https://github.com/zopefoundation/zope.file/actions/runs/9379282834/job/25823967864?pr=12 for details

What version of Python and Zope/Addons I am using:

  • master branch of zope.file
  • Python 3.12 on ubuntu (GHA)
@icemac
Copy link
Member Author

icemac commented Jun 5, 2024

Note: This repository is not marked as maintained this means it can end up archived if no-one actually needs it.

@icemac
Copy link
Member Author

icemac commented Aug 15, 2024

@zopefoundation/developers Sorry for this brought call: Is someone still using zope.file and is there someone willing to look into the test failues for Python 3.12?

@cjwatson
Copy link

cjwatson commented Aug 15, 2024

I think this may be a zope.security bug. On 3.11, type() of the read and write methods says <class 'builtin_function_or_method'>; on 3.12, it says <class 'builtin_method'>. But, on both versions, types.BuiltinFunctionType and types.BuiltinMethodType are both <class 'builtin_function_or_method'>. builtin_method is a subclass of builtin_function_or_method, but zope.security requires actual type identity.

IMO zope.security's _default_checkers needs tweaking. Somehow.

@cjwatson
Copy link

I haven't actually bisected, but just from blame, my guess is that this is a consequence of the refactoring in python/cpython#104369.

cjwatson added a commit to cjwatson/zope.security that referenced this issue Aug 15, 2024
The type of these objects is a subclass of `types.BuiltinMethodType`, but not
identical to it.  This caused downstream failures on Python >= 3.12 due to
refactoring of the `io` module, such as
zopefoundation/zope.file#13.
cjwatson added a commit to cjwatson/zope.security that referenced this issue Aug 15, 2024
The type of these objects is a subclass of `types.BuiltinMethodType`, but not
identical to it.  This caused downstream failures on Python >= 3.12 due to
refactoring of the `io` module, such as
zopefoundation/zope.file#13.
icemac pushed a commit to zopefoundation/zope.security that referenced this issue Aug 16, 2024
The type of these objects is a subclass of `types.BuiltinMethodType`, but not
identical to it.  This caused downstream failures on Python >= 3.12 due to
refactoring of the `io` module, such as
zopefoundation/zope.file#13.
@icemac
Copy link
Member Author

icemac commented Aug 16, 2024

@cjwatson Thank you for looking into this issue. Your changes in zope.security made GHA green. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants