← baseline_full_v2

httpx_3672

failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · encode/httpx

Task input

Server connection handling.

* Add `HTTPParser.keep_alive`.
* Server... always read request to completion on keep alives.
* `HTTPParser.complete` -> `.reset`
* Close streams on server exit.
* Don't raise `KeyboardException` on server exit.

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Test output

show
F
=================================== FAILURES ===================================
_________________________________ test_parser __________________________________

    def test_parser():
        stream = httpx.DuplexStream(
            b"HTTP/1.1 200 OK\r\n"
            b"Content-Length: 12\r\n"
            b"Content-Type: text/plain\r\n"
            b"\r\n"
            b"hello, world"
        )
    
        p = httpx.HTTPParser(stream, mode='CLIENT')
        p.send_method_line(b"POST", b"/", b"HTTP/1.1")
        p.send_headers([
            (b"Host", b"example.com"),
            (b"Content-Type", b"application/json"),
            (b"Content-Length", b"23"),
        ])
        p.send_body(b'{"msg": "hello, world"}')
        p.send_body(b'')
    
        assert stream.input_bytes() == (
            b"HTTP/1.1 200 OK\r\n"
            b"Content-Length: 12\r\n"
            b"Content-Type: text/plain\r\n"
            b"\r\n"
            b"hello, world"
        )
        assert stream.output_bytes() == (
            b"POST / HTTP/1.1\r\n"
            b"Host: example.com\r\n"
            b"Content-Type: application/json\r\n"
            b"Content-Length: 23\r\n"
            b"\r\n"
            b'{"msg": "hello, world"}'
        )
    
        protocol, code, reason_phase = p.recv_status_line()
        headers = p.recv_headers()
        body = p.recv_body()
        terminator = p.recv_body()
    
        assert protocol == b'HTTP/1.1'
        assert code == 200
        assert reason_phase == b'OK'
        assert headers == [
            (b'Content-Length', b'12'),
            (b'Content-Type', b'text/plain'),
        ]
        assert body == b'hello, world'
        assert terminator == b''
    
        assert not p.is_idle()
>       p.reset()
E       AttributeError: 'HTTPParser' object has no attribute 'reset'

tests/test_parsers.py:70: AttributeError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed in 0.06s