Skip to content

Commit 70bebbb

Browse files
jawwad-aliclaude
andcommitted
docs(catalogs): describe both bad-port failure modes accurately
The comment attributed both malformed-port cases to http.client.InvalidURL. Only a non-numeric port raises that (when the connection object is built); an out-of-range port constructs fine and fails later in the socket layer. Measured: example.invalid:notaport -> http.client.InvalidURL: nonnumeric port example.invalid:65536 -> HTTPSConnection() OK, connect() fails Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 0094eb6 commit 70bebbb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/specify_cli/catalogs.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ def _validate_catalog_url(cls, url: str) -> None:
7676
hostname = parsed.hostname
7777
# Accessing ``port`` performs urllib's syntax/range validation;
7878
# ``hostname`` alone does not, so a non-numeric or out-of-range
79-
# port would otherwise pass validation here and escape as a raw
80-
# http.client.InvalidURL at fetch time.
79+
# port would otherwise pass validation here and only fail later,
80+
# at fetch time, as an error this module does not translate --
81+
# a raw http.client.InvalidURL for a non-numeric port, and a
82+
# socket-layer failure for one that is merely out of range.
8183
_ = parsed.port
8284
except ValueError:
8385
raise cls._error(f"Catalog URL is malformed: {url}") from None

0 commit comments

Comments
 (0)