commit - 20d53c732fce08641a120c1b7d68a751757f4600
commit + 8c92769c9a5b03bc281b333eb2283b0d81d7c974
blob - eec0c72d69bd3c96f2cf1392a59cf4a4deb45576
blob + 44149dcb47d80bccdb2ccc08f0153047b4fa6f91
--- NEWS
+++ NEWS
0.20.43 UNRELEASED
+ * Lazily import url2pathname.
+ (Jelmer Vernooij)
+
* Drop caching of full HTTP response. Attempt #2.
(jelmer Vernooij, Antoine Lambert, #966)
blob - 75c0172028b1033902908ff8f993c50a4915ffff
blob + bb62f2ee37df941a79464f05d15f44d87b2c9062
--- dulwich/client.py
+++ dulwich/client.py
urlunsplit,
urlunparse,
)
-from urllib.request import url2pathname
import dulwich
from dulwich.repo import Repo
+# url2pathname is lazily imported
+url2pathname = None
+
+
logger = logging.getLogger(__name__)
def _win32_url_to_path(parsed) -> str:
- """
- Convert a file: URL to a path.
+ """Convert a file: URL to a path.
https://datatracker.ietf.org/doc/html/rfc8089
"""
else:
raise NotImplementedError("Non-local file URLs are not supported")
+ global url2pathname
+ if url2pathname is None:
+ from urllib.request import url2pathname
return url2pathname(netloc + path)