-
-
Notifications
You must be signed in to change notification settings - Fork 970
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
Python 3.13.0b3: AttributeError: 'functools.partial' object has no attribute '__name__' #2638
Closed
1 task done
Comments
This is according to the documentation:
https://docs.python.org/3/library/functools.html#partial-objects |
mgorny
added a commit
to mgorny/starlette
that referenced
this issue
Jul 21, 2024
Fix `routing.get_name()` to use the `__name__` attribute only if it is actually present, rather than assuming that all routine and class types have it, and use the fallback to class name otherwise. This is necessary for `functools.partial()` that's not guaranteed to have a `__name__`, and in fact does not have one starting with Python 3.13.0b3. Given that the `__name__` used to be `partial` before, this change effectively preserves the old behavior for `partial`s across all Python implementations. Fixes encode#2638
3 tasks
mgorny
added a commit
to mgorny/starlette
that referenced
this issue
Jul 21, 2024
Fix `routing.get_name()` to use the `__name__` attribute only if it is actually present, rather than assuming that all routine and class types have it, and use the fallback to class name otherwise. This is necessary for `functools.partial()` that doesn't have a `__name__` attribute, but is recognized as a routine starting with Python 3.13.0b3. Since for older versions of Python, it would have used the fallback anyway, this doesn't really change the behavior there. Fixes encode#2638
mgorny
added a commit
to mgorny/starlette
that referenced
this issue
Jul 24, 2024
Fix `routing.get_name()` to use the `__name__` attribute only if it is actually present, rather than assuming that all routine and class types have it, and use the fallback to class name otherwise. This is necessary for `functools.partial()` that doesn't have a `__name__` attribute, but is recognized as a routine starting with Python 3.13.0b3. Since for older versions of Python, it would have used the fallback anyway, this doesn't really change the behavior there. Fixes encode#2638
nixroxursox
pushed a commit
to nixroxursox/starlette
that referenced
this issue
Sep 30, 2024
…ncode#2648) Fix `routing.get_name()` to use the `__name__` attribute only if it is actually present, rather than assuming that all routine and class types have it, and use the fallback to class name otherwise. This is necessary for `functools.partial()` that doesn't have a `__name__` attribute, but is recognized as a routine starting with Python 3.13.0b3. Since for older versions of Python, it would have used the fallback anyway, this doesn't really change the behavior there. Fixes encode#2638
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This appears to be a new regression in Python 3.13.0b3 (vs. 3.13.0b2).
Important
The text was updated successfully, but these errors were encountered: