parent
f3eb3c90fd
commit
0006ed0547
@ -2,6 +2,7 @@
|
||||
The _compat module is used for code which requires branching between different
|
||||
Python environments. It is excluded from the code coverage checks.
|
||||
"""
|
||||
|
||||
import ssl
|
||||
import sys
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ Handlers for Content-Encoding.
|
||||
|
||||
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import codecs
|
||||
|
||||
@ -30,6 +30,7 @@ Our exception hierarchy:
|
||||
x ResponseNotRead
|
||||
x RequestNotRead
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
||||
@ -23,6 +23,7 @@ client = httpx.Client(transport=transport)
|
||||
transport = httpx.HTTPTransport(uds="socket.uds")
|
||||
client = httpx.Client(transport=transport)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
||||
@ -15,6 +15,7 @@ Previously we relied on the excellent `rfc3986` package to handle URL parsing an
|
||||
validation, but this module provides a simpler alternative, with less indirection
|
||||
required.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import ipaddress
|
||||
|
||||
@ -93,12 +93,11 @@ text = "\n---\n\n[Full changelog](https://github.com/encode/httpx/blob/master/CH
|
||||
pattern = 'src="(docs/img/.*?)"'
|
||||
replacement = 'src="https://raw.githubusercontent.com/encode/httpx/master/\1"'
|
||||
|
||||
# https://beta.ruff.rs/docs/configuration/#using-rufftoml
|
||||
[tool.ruff]
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "B", "PIE"]
|
||||
ignore = ["B904", "B028"]
|
||||
|
||||
[tool.ruff.isort]
|
||||
[tool.ruff.lint.isort]
|
||||
combine-as-imports = true
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
|
||||
@ -3,6 +3,7 @@ Integration tests for authentication.
|
||||
|
||||
Unit tests for auth classes also exist in tests/test_auth.py
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import netrc
|
||||
import os
|
||||
|
||||
@ -3,6 +3,7 @@ Unit tests for auth classes.
|
||||
|
||||
Integration tests also exist in tests/client/test_auth.py
|
||||
"""
|
||||
|
||||
from urllib.request import parse_keqv_list
|
||||
|
||||
import pytest
|
||||
|
||||
@ -462,8 +462,8 @@ class TestHeaderParamHTML5Formatting:
|
||||
assert expected in request.read()
|
||||
|
||||
def test_unicode_with_control_character(self):
|
||||
filename = "hello\x1A\x1B\x1C"
|
||||
expected = b'filename="hello%1A\x1B%1C"'
|
||||
filename = "hello\x1a\x1b\x1c"
|
||||
expected = b'filename="hello%1A\x1b%1C"'
|
||||
files = {"upload": (filename, b"<file content>")}
|
||||
request = httpx.Request("GET", "https://www.example.com", files=files)
|
||||
assert expected in request.read()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user