Skip to content

error: raise HTTPError(http_error_msg, response=self) #3

Description

@yansheng836

When I trying to execute the example code ,it presents a problem:

$ ghclone https://github.com/HR/Crypter/tree/master/app
Cloning into 'app'...
Traceback (most recent call last):
  File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 80, in clone
    r.raise_for_status()
  File "g:\python-3.7.1\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/HR/Crypter/contents%5Capp?ref=master

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\python-3.7.1\Scripts\ghclone-script.py", line 11, in <module>
    load_entry_point('ghclone==1.1.0', 'console_scripts', 'ghclone')()
  File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 143, in main
    clone(api_req_url, rel_url, path, ref)
  File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 82, in clone
    exit_with_m('Failed to fetch metadata for ' + path, e)
TypeError: exit_with_m() takes from 0 to 1 positional arguments but 2 were given

In addition to this, when i pip the package ,it report a waring , I don't know if that will make a difference?

 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz

But it should have been installed successfully, as it show the result code:

 Installing collected packages: docopt, ghclone
  Running setup.py install for docopt: started
    Running setup.py install for docopt: finished with status 'done'
  Running setup.py install for ghclone: started
    Running setup.py install for ghclone: finished with status 'done'
Successfully installed docopt-0.6.2 ghclone-1.1.0

My envirement:

$ git --version
git version 2.21.0.windows.1

$ ghclone --version
1.1.0

Activity

  1. yansheng836 commented on Sep 4, 2019

    @yansheng836
    Author

    When I visit that url:https://api.github.com/repos/HR/Crypter/contents%5Capp?ref=master,it show like this:

    {
    "message": "Not Found",
    "documentation_url": "https://developer.github.com/v3/repos/contents/#get-contents"
    }
    
  2. HR commented on Sep 10, 2019

    @HR
    Owner

    I fixed it @yansheng836 try it now. The issue was that it wasn't windows-path-compatible but it should be now.

  3. yansheng836 commented on Sep 11, 2019

    @yansheng836
    Author

    Sorry, I don't know how to update this tool.Could you give me some suggestions?

  4. HR commented on Sep 11, 2019

    @HR
    Owner

    No worries. Just pip install it again

    pip install git+git://github.com/HR/github-clone#egg=ghclone
    
  5. yansheng836 commented on Sep 11, 2019

    @yansheng836
    Author

    I had tried this ,but it seem no work

    yansheng@MECHREVO MINGW64 /d/Users/yansheng/Desktop/新建文件夹 (2)
    $ pip install git+git://github.com/HR/github-clone#egg=ghclone
    Requirement already satisfied: ghclone from git+git://github.com/HR/github-clone#egg=ghclone in g:\python-3.7.1\lib\site-packages (1.1.0)
    Requirement already satisfied: requests>=2.20.0 in g:\python-3.7.1\lib\site-packages (from ghclone) (2.21.0)
    Requirement already satisfied: docopt>=0.6.2 in g:\python-3.7.1\lib\site-packages (from ghclone) (0.6.2)
    Requirement already satisfied: chardet<3.1.0,>=3.0.2 in g:\python-3.7.1\lib\site-packages (from requests>=2.20.0->ghclone) (3.0.4)
    Requirement already satisfied: certifi>=2017.4.17 in g:\python-3.7.1\lib\site-packages (from requests>=2.20.0->ghclone) (2018.11.29)
    Requirement already satisfied: idna<2.9,>=2.5 in g:\python-3.7.1\lib\site-packages (from requests>=2.20.0->ghclone) (2.8)
    Requirement already satisfied: urllib3<1.25,>=1.21.1 in g:\python-3.7.1\lib\site-packages (from requests>=2.20.0->ghclone) (1.24.1)
    
    yansheng@MECHREVO MINGW64 /d/Users/yansheng/Desktop/新建文件夹 (2)
    $ ghclone https://github.com/HR/Crypter/tree/master/app
    Cloning into 'app'...
    Traceback (most recent call last):
      File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 80, in clone
        r.raise_for_status()
      File "g:\python-3.7.1\lib\site-packages\requests\models.py", line 940, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/HR/Crypter/contents%5Capp?ref=master
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "G:\python-3.7.1\Scripts\ghclone-script.py", line 11, in <module>
        load_entry_point('ghclone==1.1.0', 'console_scripts', 'ghclone')()
      File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 143, in main
        clone(api_req_url, rel_url, path, ref)
      File "g:\python-3.7.1\lib\site-packages\ghclone\ghclone.py", line 82, in clone
        exit_with_m('Failed to fetch metadata for ' + path, e)
    TypeError: exit_with_m() takes from 0 to 1 positional arguments but 2 were given
    
  6. HR commented on Sep 11, 2019

    @HR
    Owner

    That’s still the old version

    Try uninstalling it and then reinstalling it.
    The current version is 1.2.0

  7. yansheng836 commented on Sep 11, 2019

    @yansheng836
    Author

    Thank you very much. The uninstall command $ pip uninstall git+git://github.com/HR/github-clone#egg=ghclone can work. Just like what you said, the new version tool can download the folder one of a repository.

    The main reason is that I find the name of the library a bit strange, which I've never seen it. So I don't think the library can be uninstalled with this command and no have a try.

  8. HR commented on Sep 11, 2019

    @HR
    Owner

    It’s just pip uninstall ghclone

  9. yansheng836 commented on Sep 11, 2019

    @yansheng836
    Author

    I don't know why, it doesn't seem to work for me.

  10. HR commented on Sep 11, 2019

    @HR
    Owner

    Open your Python 3.3+ site-packages path and delete the following:

    • ghclone-1.1.0.dist-info/*
    • ghclone/*
    • ghclone-1.1.0.egg-info

    Then reinstall it

    I tried 1.2.0 with a fresh Windows install just yesterday and everything worked fine.

  11. yansheng836 commented on Sep 11, 2019

    @yansheng836
    Author

    Ok, thank you for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions