Bug
tldr --update fails because https://tldr.sh/assets/tldr.zip returns an HTML redirect instead of a ZIP archive
Description
After installing the latest version of the Python client (tldr 3.4.4), updating the local cache fails with the following error:
$ tldr --update
Downloading tldr pages to /home/<user>/.local/share/tldr
tldr: Data.Binary.Get.runGet at position 4: Did not find end of central directory signature
CallStack (from HasCallStack):
error, called at libraries/binary/src/Data/Binary/Get.hs:345:5 in binary-0.8.9.1:Data.Binary.Get
Environment
- OS: Ubuntu 24.04 running under WSL2
- Installation method:
pipx
- Python: 3.12.3
- tldr: 3.4.4
Investigation
The issue appears to be caused by the download URL used for the page archive.
Running:
curl -L -o /tmp/tldr.zip https://tldr.sh/assets/tldr.zip
does not download a ZIP archive.
Instead, it downloads an HTML page containing:
<meta http-equiv="refresh" content="0;url=https://github.com/tldr-pages/tldr/releases/latest/download/tldr.zip">
As a result:
$ file /tmp/tldr.zip
/tmp/tldr.zip: HTML document, ASCII text
$ unzip -t /tmp/tldr.zip
End-of-central-directory signature not found.
The client then attempts to parse this HTML file as a ZIP archive and fails with the error shown above.
Expected behavior
The update process should either:
- download the archive directly from GitHub Releases, or
- detect that the downloaded content is HTML instead of a ZIP archive and report a meaningful error.
Bug
tldr --updatefails becausehttps://tldr.sh/assets/tldr.zipreturns an HTML redirect instead of a ZIP archiveDescription
After installing the latest version of the Python client (
tldr3.4.4), updating the local cache fails with the following error:Environment
pipxInvestigation
The issue appears to be caused by the download URL used for the page archive.
Running:
does not download a ZIP archive.
Instead, it downloads an HTML page containing:
As a result:
The client then attempts to parse this HTML file as a ZIP archive and fails with the error shown above.
Expected behavior
The update process should either: