Skip to content

Python 3.13.0b3: AttributeError: 'functools.partial' object has no attribute '__name__' #2638

@musicinmybrain

Description

@musicinmybrain
$ gh repo clone encode/starlette
$ cd starlette
$ python3.13 --version
Python 3.13.0b3
$ python3.13 -m venv _e
$ . _e/bin/activate
(_e) $ pip install -r requirements.txt
(_e) $ pip install -e .
(_e) $ python -m pytest
_e/lib64/python3.13/site-packages/trio/_path.py:164: in generate_forwards
    raise TypeError(attr_name, type(attr))
E   TypeError: ('parser', <class 'module'>)
(_e) $ pip install --upgrade trio
(_e) $ python -m pytest
==================================================================================================== ERRORS ====================================================================================================
____________________________________________________________________________________ ERROR collecting tests/test_routing.py ____________________________________________________________________________________
tests/test_routing.py:135: in <module>
    Route("/", endpoint=functools.partial(partial_endpoint, "foo")),
starlette/routing.py:227: in __init__
    self.name = get_name(endpoint) if name is None else name
starlette/routing.py:103: in get_name
    return endpoint.__name__
E   AttributeError: 'functools.partial' object has no attribute '__name__'. Did you mean: '__ne__'?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================================================================== 1 error in 0.64s ===============================================================================================

This appears to be a new regression in Python 3.13.0b3 (vs. 3.13.0b2).


Important

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions