Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running 'tldr -- language zh' in python 3.13.1 reports an error #263

Open
autext opened this issue Jan 4, 2025 · 1 comment
Open

Running 'tldr -- language zh' in python 3.13.1 reports an error #263

autext opened this issue Jan 4, 2025 · 1 comment

Comments

@autext
Copy link

autext commented Jan 4, 2025

i'm using python 3.13.1, and when I input tldr -- language zh, the console reports an error

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\softwares\Python313\Scripts\tldr.exe\__main__.py", line 7, in <module>
    sys.exit(cli())
             ~~~^^
  File "D:\softwares\Python313\Lib\site-packages\tldr.py", line 665, in cli
    main()
    ~~~~^^
  File "D:\softwares\Python313\Lib\site-packages\tldr.py", line 632, in main
    results = get_page_for_every_platform(
        command,
    ...<2 lines>...
        options.language
    )
  File "D:\softwares\Python313\Lib\site-packages\tldr.py", line 283, in get_page_for_every_platform
    get_page_for_platform(
    ~~~~~~~~~~~~~~~~~~~~~^
        command,
        ^^^^^^^^
    ...<2 lines>...
        language
        ^^^^^^^^
    ),
    ^
  File "D:\softwares\Python313\Lib\site-packages\tldr.py", line 169, in get_page_for_platform
    data = urlopen(
           ~~~~~~~^
        Request(page_url, headers=REQUEST_HEADERS),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        timeout=10,
        ^^^^^^^^^^^
        context=URLOPEN_CONTEXT
        ^^^^^^^^^^^^^^^^^^^^^^^
    ).read()
    ^
  File "D:\softwares\Python313\Lib\urllib\request.py", line 189, in urlopen
    return opener.open(url, data, timeout)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "D:\softwares\Python313\Lib\urllib\request.py", line 489, in open
    response = self._open(req, data)
  File "D:\softwares\Python313\Lib\urllib\request.py", line 506, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
                              '_open', req)
  File "D:\softwares\Python313\Lib\urllib\request.py", line 466, in _call_chain
    result = func(*args)
  File "D:\softwares\Python313\Lib\urllib\request.py", line 1367, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        context=self._context)
                        ^^^^^^^^^^^^^^^^^^^^^^
  File "D:\softwares\Python313\Lib\urllib\request.py", line 1323, in do_open
    r = h.getresponse()
  File "D:\softwares\Python313\Lib\http\client.py", line 1428, in getresponse
    response.begin()
    ~~~~~~~~~~~~~~^^
  File "D:\softwares\Python313\Lib\http\client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ~~~~~~~~~~~~~~~~~^^
  File "D:\softwares\Python313\Lib\http\client.py", line 292, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "D:\softwares\Python313\Lib\socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
  File "D:\softwares\Python313\Lib\ssl.py", line 1304, in recv_into
    return self.read(nbytes, buffer)
           ~~~~~~~~~^^^^^^^^^^^^^^^^
  File "D:\softwares\Python313\Lib\ssl.py", line 1138, in read
    return self._sslobj.read(len, buffer)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
TimeoutError: The read operation timed out

how can i fix it

@gutjuri
Copy link
Member

gutjuri commented Jan 6, 2025

You should input tldr --language zh (without the space after --). Also, you need to tell tldr which page you would like to view. For example, if you want to view the chinese tldr page for the command tar, you should input tldr --language zh tar.

@spageektti spageektti transferred this issue from tldr-pages/tldr Jan 7, 2025
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

No branches or pull requests

2 participants