Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Git HTTP Auth breaks w/1.14

Open
#1,274 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, python

Research direction

Start by comparing the pygit2 1.13.3 and 1.14.0 credentials APIs, focusing on the import in scmrepo/git/backend/pygit2/callbacks.py. Reproduce an HTTP clone with username and password, then verify that authentication works with pygit2 1.14.0 without the reported ImportError.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libgit2/pygit2

All issues in libgit2/pygit2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.