Skip to content

Do not add ':None' port when rebuilding URIs - #446

Draft
amantebriwal4321 wants to merge 1 commit into
openzim:mainfrom
amantebriwal4321:fix/443-none-port
Draft

amantebriwal4321 wants to merge 1 commit into
openzim:mainfrom
amantebriwal4321:fix/443-none-port

Conversation

@amantebriwal4321

Copy link
Copy Markdown

Links between questions in the ZIM came out as //:None/../../questions/.... In rebuild_uri(), first(str(port), str(uri.port), "") turns a missing port into the string "None", so every rewritten link got :None added. The fix only converts the port to a string when there is one. I added 3 tests in tests/utils/test_misc.py for no port, an explicit port and a port taken from the URI, and all three fail on main. I couldn't install libmagic locally, so I ran the suite with a stub and haven't built a real ZIM.

Fixes #443

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.

Links referencing pages inside ZIM are broken

1 participant