Skip to content

Reject a comma in a URL scheme - #200

Open
SashaMIT wants to merge 1 commit into
python-hyper:masterfrom
SashaMIT:scheme-comma
Open

SashaMIT wants to merge 1 commit into
python-hyper:masterfrom
SashaMIT:scheme-comma

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 1, 2026 •

Copy link
Copy Markdown

Purpose

URL(scheme="ht,tp") succeeded, and so did URL.from_text("ht,tp://example.com").

The scheme check says only letters, digits, +, -, and . are allowed. The pattern was [a-zA-Z0-9+-.]. +-. is the range from + to ., and a comma sits in that range. The hyphen is now at the end of the class, so it is a literal.

git+https, a-b, and a.b still pass.

fixes #199

Test plan

  • pytest src/hyperlink/test (101 passed)

The scheme check used "+-." as a character range, so a comma was
accepted. The error text only allows letters, digits, "+", "-", and ".".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A URL scheme accepts a comma

1 participant