-
-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Description
Reproduced on top of f9f0127. Interestingly enough, the failure doesn't happen if trio is not installed.
$ uv pip install -e . pytest httpx sure trio
Resolved 20 packages in 437ms
Built httpretty @ file:///tmp/httpretty
Prepared 1 package in 177ms
░░░░░░░░░░░░░░░░░░░░ [0/20] Installing wheels... warning: Installed 20 packages in 9ms
+ anyio==4.11.0
+ attrs==25.4.0
+ certifi==2025.10.5
+ h11==0.16.0
+ httpcore==1.0.9
+ httpretty==1.1.4 (from file:///tmp/httpretty)
+ httpx==0.28.1
+ idna==3.11
+ iniconfig==2.3.0
+ mock==5.2.0
+ outcome==1.3.0.post0
+ packaging==25.0
+ pluggy==1.6.0
+ pygments==2.19.2
+ pytest==8.4.2
+ six==1.17.0
+ sniffio==1.3.1
+ sortedcontainers==2.4.0
+ sure==2.0.1
+ trio==0.31.0
$ pytest tests/bugfixes/nosetests/test_414_httpx.py::test_httpx
========================================================= test session starts =========================================================
platform linux -- Python 3.13.9, pytest-8.4.2, pluggy-1.6.0
rootdir: /tmp/httpretty
plugins: anyio-4.11.0
collected 1 item
tests/bugfixes/nosetests/test_414_httpx.py F [100%]
============================================================== FAILURES ===============================================================
_____________________________________________________________ test_httpx ______________________________________________________________
@httpretty.activate(verbose=True, allow_net_connect=False)
def test_httpx():
"#414 httpx support"
httpretty.register_uri(httpretty.GET, "https://blog.falcao.it/",
body="Posts")
> response = httpx.get('https://blog.falcao.it')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/bugfixes/nosetests/test_414_httpx.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.13/site-packages/httpx/_api.py:195: in get
return request(
.venv/lib/python3.13/site-packages/httpx/_api.py:102: in request
with Client(
.venv/lib/python3.13/site-packages/httpx/_client.py:688: in __init__
self._transport = self._init_transport(
.venv/lib/python3.13/site-packages/httpx/_client.py:731: in _init_transport
return HTTPTransport(
.venv/lib/python3.13/site-packages/httpx/_transports/default.py:150: in __init__
import httpcore
.venv/lib/python3.13/site-packages/httpcore/__init__.py:1: in <module>
from ._api import request, stream
.venv/lib/python3.13/site-packages/httpcore/_api.py:7: in <module>
from ._sync.connection_pool import ConnectionPool
.venv/lib/python3.13/site-packages/httpcore/_sync/__init__.py:1: in <module>
from .connection import HTTPConnection
.venv/lib/python3.13/site-packages/httpcore/_sync/connection.py:14: in <module>
from .._synchronization import Lock
.venv/lib/python3.13/site-packages/httpcore/_synchronization.py:12: in <module>
import trio
.venv/lib/python3.13/site-packages/trio/__init__.py:25: in <module>
from . import abc, from_thread, lowlevel, socket, to_thread
.venv/lib/python3.13/site-packages/trio/socket.py:16: in <module>
from . import _socket
.venv/lib/python3.13/site-packages/trio/_socket.py:545: in <module>
class SocketType:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
class SocketType:
def __init__(self) -> None:
# make sure this __init__ works with multiple inheritance
super().__init__()
# and only raises error if it's directly constructed
if type(self) is SocketType:
raise TypeError(
"SocketType is an abstract class; use trio.socket.socket if you "
"want to construct a socket object",
)
def detach(self) -> int:
raise NotImplementedError
def fileno(self) -> int:
raise NotImplementedError
def getpeername(self) -> AddressFormat:
raise NotImplementedError
def getsockname(self) -> AddressFormat:
raise NotImplementedError
@overload
def getsockopt(self, level: int, optname: int) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
def getsockopt(
self,
level: int,
optname: int,
buflen: int | None = None,
) -> int | bytes:
raise NotImplementedError
@overload
def setsockopt(self, level: int, optname: int, value: int | Buffer) -> None: ...
@overload
def setsockopt(
self,
level: int,
optname: int,
value: None,
optlen: int,
) -> None: ...
def setsockopt(
self,
level: int,
optname: int,
value: int | Buffer | None,
optlen: int | None = None,
) -> None:
raise NotImplementedError
def listen(self, backlog: int = min(_stdlib_socket.SOMAXCONN, 128)) -> None:
raise NotImplementedError
def get_inheritable(self) -> bool:
raise NotImplementedError
def set_inheritable(self, inheritable: bool) -> None:
raise NotImplementedError
if sys.platform == "win32" or (
not TYPE_CHECKING and hasattr(_stdlib_socket.socket, "share")
):
def share(self, process_id: int) -> bytes:
raise NotImplementedError
def __enter__(self) -> Self:
raise NotImplementedError
def __exit__(
self,
exc_type: type[BaseException] | None,
exc_value: BaseException | None,
traceback: TracebackType | None,
) -> None:
raise NotImplementedError
@property
def family(self) -> AddressFamily:
raise NotImplementedError
@property
def type(self) -> SocketKind:
raise NotImplementedError
@property
def proto(self) -> int:
raise NotImplementedError
@property
def did_shutdown_SHUT_WR(self) -> bool:
"""Return True if the socket has been shut down with the SHUT_WR flag"""
raise NotImplementedError
def __repr__(self) -> str:
raise NotImplementedError
def dup(self) -> SocketType:
raise NotImplementedError
def close(self) -> None:
raise NotImplementedError
async def bind(self, address: AddressFormat) -> None:
raise NotImplementedError
def shutdown(self, flag: int) -> None:
raise NotImplementedError
def is_readable(self) -> bool:
"""Return True if the socket is readable. This is checked with `select.select` on Windows, otherwise `select.poll`."""
raise NotImplementedError
async def wait_writable(self) -> None:
"""Convenience method that calls trio.lowlevel.wait_writable for the object."""
raise NotImplementedError
async def accept(self) -> tuple[SocketType, AddressFormat]:
raise NotImplementedError
async def connect(self, address: AddressFormat) -> None:
raise NotImplementedError
def recv(self, buflen: int, flags: int = 0, /) -> Awaitable[bytes]:
raise NotImplementedError
def recv_into(
self,
buffer: Buffer,
nbytes: int = 0,
flags: int = 0,
) -> Awaitable[int]:
raise NotImplementedError
# return type of socket.socket.recvfrom in typeshed is tuple[bytes, Any]
def recvfrom(
self,
bufsize: int,
flags: int = 0,
/,
) -> Awaitable[tuple[bytes, AddressFormat]]:
raise NotImplementedError
# return type of socket.socket.recvfrom_into in typeshed is tuple[bytes, Any]
def recvfrom_into(
self,
buffer: Buffer,
nbytes: int = 0,
flags: int = 0,
) -> Awaitable[tuple[int, AddressFormat]]:
raise NotImplementedError
if sys.platform != "win32" or (
not TYPE_CHECKING and hasattr(_stdlib_socket.socket, "recvmsg")
):
def recvmsg(
self,
bufsize: int,
ancbufsize: int = 0,
flags: int = 0,
/,
) -> Awaitable[tuple[bytes, list[tuple[int, int, bytes]], int, object]]:
raise NotImplementedError
if sys.platform != "win32" or (
not TYPE_CHECKING and hasattr(_stdlib_socket.socket, "recvmsg_into")
):
def recvmsg_into(
self,
buffers: Iterable[Buffer],
ancbufsize: int = 0,
flags: int = 0,
/,
) -> Awaitable[tuple[int, list[tuple[int, int, bytes]], int, object]]:
raise NotImplementedError
def send(self, bytes: Buffer, flags: int = 0, /) -> Awaitable[int]:
raise NotImplementedError
@overload
async def sendto(
self,
data: Buffer,
address: tuple[object, ...] | str | Buffer,
/,
) -> int: ...
@overload
async def sendto(
self,
data: Buffer,
flags: int,
address: tuple[object, ...] | str | Buffer,
/,
) -> int: ...
async def sendto(self, *args: object) -> int:
raise NotImplementedError
if sys.platform != "win32" or (
not TYPE_CHECKING and hasattr(_stdlib_socket.socket, "sendmsg")
):
> @_wraps(_stdlib_socket.socket.sendmsg, assigned=(), updated=())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AttributeError: type object 'socket' has no attribute 'sendmsg'
.venv/lib/python3.13/site-packages/trio/_socket.py:758: AttributeError
======================================================= short test summary info =======================================================
FAILED tests/bugfixes/nosetests/test_414_httpx.py::test_httpx - AttributeError: type object 'socket' has no attribute 'sendmsg'
========================================================== 1 failed in 0.41s ==========================================================Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels