tldr.py icon indicating copy to clipboard operation
tldr.py copied to clipboard

upstream tldr mindlessly changed `master` to `main`

Open nopdotcom opened this issue 4 years ago • 3 comments

https://github.com/lord63/tldr.py/blob/4f8065aa3f68a3fec31286030b220cb1042348b3/tldr/cli.py#L139-L145 is now broken.

Update your code to participate in the performance.

nopdotcom avatar May 28 '21 14:05 nopdotcom

Tested in my local environment, still works. tldr-pages repo still has master branch and it is even with main. But I agree that we should switch to use the main branch in the future. See #50

lord63 avatar Jul 17 '21 02:07 lord63

Yeah, apparently official notice was at https://github.com/tldr-pages/tldr/releases/tag/v1.5b .

They seem pretty adamant that you should be using tldr.zip as a cache, using the term MUST. See https://github.com/tldr-pages/tldr/blob/main/CLIENT-SPECIFICATION.md#caching and note that questions about "what branch are we on" aren't important if you're doing that. The spec was updated here

On the other hand, a .zip file may be the silliest way to distribute tldr. I downloaded their zip file, and recompressed it:

$ ls -lS tldr*
-rw-r--r-- 1 nop wheel 2110917 Jul 18 06:48 tldr.zip
-rw-r--r-- 1 nop wheel  947712 Jul 18 13:07 tldr.tar.gz
-rw-r--r-- 1 nop wheel  888664 Jul 18 13:04 tldr.tar.zst
-rw-r--r-- 1 nop wheel  684995 Jul 18 13:32 tldr.tar.zst18
-rw-r--r-- 1 nop wheel  672568 Jul 18 13:04 tldr.tar.xz

The only thing I can figure out is that they expect you to simply store the zip file, and use zipfile.ZipFile.namelist() and ZipFile.open() as your caching strategy.

(The perfect thing would be generating tldr.tar.xz using https://github.com/vasi/pixz, as just about everybody can read LZMA and tar files these days. Unfortunately, pixz's magic isn't available outside the utility. A Python binding would be cool.)

Should I open a bug on the alleged "MUST" issue to document it, or is this enough?

nopdotcom avatar Jul 18 '21 17:07 nopdotcom