File tree Expand file tree Collapse file tree
src/specify_cli/extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -428,12 +428,8 @@ def extension_add(
428428
429429 try :
430430 parsed = urlparse (from_url )
431- # Read .hostname inside the try: a bracketed-but-invalid IPv6
432- # authority (e.g. "https://[not-an-ip]/x.zip") parses cleanly under
433- # urlparse() on Python < 3.14 and only raises ValueError lazily on
434- # the first .hostname access (eager at urlparse() on 3.14+). Reading
435- # it here keeps that ValueError inside the guard instead of leaking a
436- # raw traceback past the CLI. Reuse the value below.
431+ # Keep parsing and hostname extraction in the same guard so any
432+ # ValueError is converted to the CLI's normal invalid-URL error.
437433 hostname = parsed .hostname
438434 except ValueError :
439435 console .print (f"[red]Error:[/red] Invalid URL: { _escape_markup (from_url )} " )
You can’t perform that action at this time.
0 commit comments