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

Installing environment for https://github.com/igorshubovych/markdownlint-cli fails with AttributeError: 'bytes' object has no attribute 'tell' #375

Closed
Casper321 opened this issue Mar 20, 2023 · 2 comments

Comments

@Casper321
Copy link

Hi,
I am using

- repo: https://github.com/igorshubovych/markdownlint-cli
    rev: v0.32.2
    hooks:
      - id: markdownlint

Sometimes, pre-commit fails with the following error.

[INFO] Installing environment for https://github.com/igorshubovych/markdownlint-cli.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/usr/local/bin/python', '-mnodeenv', '--prebuilt', '--clean-src', '/root/.cache/pre-commit/repoki3l4r17/node_env-default')
return code: 1
stdout: (none)
stderr:
     * Install prebuilt node (19.8.1) .Incomplete read while readingfrom https://nodejs.org/download/release/v19.8.1/node-v19.8.1-linux-x64.tar.gz
    .
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 1519, in <module>
        main()
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 1104, in main
        create_environment(env_dir, args)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 980, in create_environment
        install_node(env_dir, src_dir, args)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 739, in install_node
        install_node_wrapped(env_dir, src_dir, args)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 762, in install_node_wrapped
        download_node_src(node_url, src_dir, args)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 602, in download_node_src
        with ctx as archive:
      File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
        return next(self.gen)
      File "/usr/local/lib/python3.10/site-packages/nodeenv.py", line 573, in tarfile_open
        tf = tarfile.open(*args, **kwargs)
      File "/usr/local/lib/python3.10/tarfile.py", line 1630, in open
        saved_pos = fileobj.tell()
    AttributeError: 'bytes' object has no attribute 'tell'
@nschonni
Copy link
Contributor

Sounds like an issue with https://github.com/ekalinin/nodeenv or pre-commit before it can get to the install for this repo.

@Casper321
Copy link
Author

Yes, sorry for opening it here. I've create a ticket for nodeenv: ekalinin/nodeenv#328

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