fix(geoip): quote cloakbrowser[geoip] in user-facing error messages
zsh globs the unquoted bracket, so a user copy-pasting the printed install hint hits a shell error. Quote it in both messages; update the test that pinned the old string.
This commit is contained in:
@@ -106,7 +106,7 @@ def resolve_proxy_geo_with_ip(
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"geoip2 is required for geoip=True. Install it with:\n"
|
||||
" pip install cloakbrowser[geoip]"
|
||||
" pip install 'cloakbrowser[geoip]'"
|
||||
) from None
|
||||
|
||||
# Ensure the DB first — the download must NOT be bounded by the resolution
|
||||
@@ -276,7 +276,7 @@ def _resolve_exit_ip(proxy_url: str | None, timeout: float | None = None) -> str
|
||||
return ip
|
||||
except httpx.UnsupportedProtocol:
|
||||
logger.warning(
|
||||
"SOCKS5 proxy requires socksio: pip install cloakbrowser[geoip]"
|
||||
"SOCKS5 proxy requires socksio: pip install 'cloakbrowser[geoip]'"
|
||||
)
|
||||
return None
|
||||
except Exception:
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ def test_resolve_geo_raises_when_geoip2_missing():
|
||||
from importlib import reload
|
||||
import cloakbrowser.geoip as geoip_mod
|
||||
reload(geoip_mod)
|
||||
with pytest.raises(ImportError, match="pip install cloakbrowser"):
|
||||
with pytest.raises(ImportError, match=r"pip install 'cloakbrowser\[geoip\]'"):
|
||||
geoip_mod.resolve_proxy_geo("http://10.50.96.5:8888")
|
||||
# Restore
|
||||
reload(geoip_mod)
|
||||
|
||||
Reference in New Issue
Block a user