tldr-pages / tldr-pages/tldr-python-client

Bug: Unable to download or update tldr pages

Open Beginner friendly
#361 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
749
Forks
117
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the update path invoked by tldr --update and search for the https://tldr.sh/assets/tldr.zip download URL. Reproduce the failure with the documented curl or update command, then verify that the client downloads the GitHub Releases archive or reports a meaningful error for the HTML response.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.