Skip to content

Conversation

@hugovk
Copy link
Contributor

@hugovk hugovk commented Apr 11, 2025

Summary

Fixes #995.

On Python 3.14, we get an AttributeError on import:

❯ python3.14
Python 3.14.0a7 (v3.14.0a7:29af6cee02f, Apr  8 2025, 07:53:42) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httpcore
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import httpcore
  File "/private/tmp/httpcore/httpcore/httpcore/__init__.py", line 140, in <module>
    setattr(__locals[__name], "__module__", "httpcore")  # noqa
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'typing.Union' object has no attribute '__module__' and no __dict__ for setting new attributes. Did you mean: '__reduce__'?

This is caused by SOCKET_OPTION, let's exclude it:

❯ python3.14
Python 3.14.0a7 (v3.14.0a7:29af6cee02f, Apr  8 2025, 07:53:42) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httpcore
>>>

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@zanieb
Copy link
Contributor

zanieb commented Apr 11, 2025

A comment would be good.

@lovelydinosaur lovelydinosaur merged commit b2a796c into encode:master Apr 11, 2025
5 checks passed
@lovelydinosaur
Copy link
Contributor

lovelydinosaur commented Apr 11, 2025

Thanks @hugovk, @zanieb.

A release PR from this point would make sense.

@hugovk hugovk deleted the fix-3.14-SOCKET_OPTION branch April 11, 2025 14:15
@hugovk hugovk mentioned this pull request Apr 11, 2025
3 tasks
@hugovk
Copy link
Contributor Author

hugovk commented Apr 11, 2025

Please see PR #1006.

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 this pull request may close these issues.

3 participants