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

Git HTTP Auth breaks w/1.14 #1274

Open
vickumar1981 opened this issue Jan 28, 2024 · 1 comment
Open

Git HTTP Auth breaks w/1.14 #1274

vickumar1981 opened this issue Jan 28, 2024 · 1 comment

Comments

@vickumar1981
Copy link

Upgrading to 1.14.0, and cloning via HTTP auth (username + password) gives this stack trace:

  File "/opt/conda/lib/python3.10/site-packages/pygit2/remotes.py", line 171, in ls_remotes
    self.connect(callbacks=callbacks, proxy=proxy)
  File "/opt/conda/lib/python3.10/site-packages/pygit2/remotes.py", line 120, in connect
    payload.check_error(err)
  File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 93, in check_error
    raise self._stored_exception
  File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 416, in wrapper
    return f(*args)
  File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 484, in _credentials_cb
    ccred = get_credentials(credentials, url, username, allowed)
  File "/opt/conda/lib/python3.10/site-packages/pygit2/callbacks.py", line 569, in get_credentials
    creds = fn(url_str, username_str, allowed)
  File "/opt/conda/lib/python3.10/site-packages/scmrepo/git/backend/pygit2/callbacks.py", line 51, in credentials
    from pygit2.credentials import GIT_CREDENTIAL_USERPASS_PLAINTEXT, UserPass
ImportError: cannot import name 'GIT_CREDENTIAL_USERPASS_PLAINTEXT' from 'pygit2.credentials' (/opt/conda/lib/python3.10/site-packages/pygit2/credentials.py)

Version 1.13.3 works fine though :).

Thanks.

@jdavid
Copy link
Member

jdavid commented Jan 30, 2024

It's an import error. From what I see this has been fixed already in scmrepo 2.1.1

For the record, the old constants are still available in the root package:

 from pygit2 import GIT_CREDENTIAL_USERPASS_PLAINTEXT

But it's better to use the new enums, like it's done now in scmrepo.

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