Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'

Aberta
#1,219 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
38/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
git, python
Domínio
tooling

Direção de pesquisa

Reproduza o traceback no container python:3.10 com pygit2==1.12.1 e, em seguida, inspecione pygit2/remote.py em torno de Remote.save e os bindings incluídos do libgit2. Verifique como se espera que Remote.fetch atualize o estado do repositório e se o workflow documentado evita este símbolo ausente; o trabalho estará concluído quando a operação reportada não gerar mais AttributeError e seu comportamento estiver coberto ou claramente documentado.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

I've installed using pip install pygit2==1.12.1. The environment is a python:3.10 docker container.

I'm receiving:

Traceback (most recent call last):
  ...
  File "...", line 197, in pull_repo
    remote.save()
  File "/app/env/lib/python3.10/site-packages/pygit2/remote.py", line 117, in save
    err = C.git_remote_save(self._remote)
AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'. Did you mean: 'git_remote_name'?

The relevant code associated with this error is as follows:

repo = pygit2.Repository(checkout_location)
remote = repo.remotes['origin']
remote.fetch(callbacks=callbacks)
remote.save()

I attempted to use the Remote.save method because the call to Remote.fetch didn't appear to do anything to the repository, which is known to have changed.

Note, I could be using this all wrong, but I would still think an AttributeError shouldn't be raised. Also, there isn't a good example or clear way to do the equivalent of a git pull, which is why I'm fiddling with fetching the remote in order to advance the index.

Linguagem predominante
Python
Estrelas
1.7k
Forks
408
Merge médio
1d 15h
PRs com merge (30d)
7

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de libgit2/pygit2

Todas as issues de libgit2/pygit2

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.