Skip to content

Preserve numeric zero in named URI parameters - #159

Open
bensynapse wants to merge 1 commit into
python-hyper:mainfrom
bensynapse:fix-numeric-zero-parameters
Open

bensynapse wants to merge 1 commit into
python-hyper:mainfrom
bensynapse:fix-numeric-zero-parameters

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

expand("{?offset}", offset=0) currently returns ?offset=. Semicolon expansion also drops =0.
Quote scalar values before checking emptiness so integer, float and complex zero keep their text.
Empty strings and undefined variables keep their existing behavior.

Added 24 zero cases across ?, & and ;, plus empty string and None checks.
All 24 cases fail against the unchanged base.

Tox passes 60 tests on CPython 3.9 to 3.14 and PyPy 3.11.
tox -e pep8,pre-commit also passes. The source archive and wheel build successfully and pass twine check.

Numeric zero was treated as an empty value in query and semicolon
expansions. Keep its quoted text so offset=0 stays in the expanded URI.

This branch has not been deployed

No deployments
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.

1 participant