Skip to content

Commit

Permalink
Merge branch 'master' into test_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
T-256 authored Oct 31, 2023
2 parents 32f5649 + 1d73150 commit e37faf1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/third_party_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As HTTPX usage grows, there is an expanding community of developers building too

### Hishel

[GitHub](https://github.com/karosis88/hishel) - [Documentation](https://karosis88.github.io/hishel/)
[GitHub](https://github.com/karpetrosyan/hishel) - [Documentation](https://hishel.com/)

An elegant HTTP Cache implementation for HTTPX and HTTP Core.

Expand Down
5 changes: 4 additions & 1 deletion httpx/_auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import hashlib
import netrc
import os
import re
import time
Expand Down Expand Up @@ -148,6 +147,10 @@ class NetRCAuth(Auth):
"""

def __init__(self, file: typing.Optional[str] = None):
# Lazily import 'netrc'.
# There's no need for us to load this module unless 'NetRCAuth' is being used.
import netrc

self._netrc_info = netrc.netrc(file)

def auth_flow(self, request: Request) -> typing.Generator[Request, Response, None]:
Expand Down
3 changes: 1 addition & 2 deletions httpx/_multipart.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import binascii
import io
import os
import typing
Expand Down Expand Up @@ -200,7 +199,7 @@ def __init__(
boundary: typing.Optional[bytes] = None,
) -> None:
if boundary is None:
boundary = binascii.hexlify(os.urandom(16))
boundary = os.urandom(16).hex().encode("ascii")

self.boundary = boundary
self.content_type = "multipart/form-data; boundary=%s" % boundary.decode(
Expand Down

0 comments on commit e37faf1

Please sign in to comment.