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

Import from Git hub fail: (Anki 2.1.30) #93

Closed
JeanCyber-B opened this issue Aug 11, 2020 · 3 comments · Fixed by #139
Closed

Import from Git hub fail: (Anki 2.1.30) #93

JeanCyber-B opened this issue Aug 11, 2020 · 3 comments · Fixed by #139

Comments

@JeanCyber-B
Copy link

Hi, I try to import the deck shown as example (Stvad
/
Software_Engineering__git)
in the ankiweb page to see if it's work.
So I go to "fichier/import from git" and copy/past this link :
(Stvad
/
Software_Engineering__git)

and i have the error message bellow.

I already remove others addons, and create an other profile.
How can i fix this issue ?

Thank you for your help
Good afternoon
Sorry for my "dégeulasse" English

The error message:

Anki 2.1.30 (06a69c25) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-11 12:00:01

Caught exception:
Traceback (most recent call last):
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 39, in clone_repository_and_import
    porcelain.pull(porcelain.open_repo(str(repo_local_path)), repo_url)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\porcelain.py", line 180, in open_repo
    return Repo(path_or_repo)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\repo.py", line 925, in __init__
    raise NotGitRepository(
dulwich.errors.NotGitRepository: No git repository was found at C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\user_files\test\
Software_Engineering__git

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pathlib.py", line 1266, in mkdir
OSError: [WinError 123] La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte: 'C:\\Users\\Jean\\AppData\\Roaming\\Anki2\\addons21\\1788670778\\user_files\\test\\\nSoftware_Engineering__git'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\anki\ui\action_vendor.py", line 35, in <lambda>
    lambda: GitImporter.on_git_import_action(self.window.col))
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 28, in on_git_import_action
    GitImporter(collection).import_from_git()
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 33, in import_from_git
    self.clone_repository_and_import(repo_url)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 44, in clone_repository_and_import
    self.clone_repository(repo_url, repo_local_path)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 51, in clone_repository
    repo_path.mkdir(parents=True, exist_ok=True)
  File "pathlib.py", line 1275, in mkdir
  File "pathlib.py", line 1385, in is_dir
  File "pathlib.py", line 1176, in stat
OSError: [WinError 123] La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte: 'C:\\Users\\Jean\\AppData\\Roaming\\Anki2\\addons21\\1788670778\\user_files\\test\\\nSoftware_Engineering__git'

@Stvad
Copy link
Owner

Stvad commented Aug 12, 2020

Example is outdated :( you need to use the full git url not just Github coordinates now.
So for that deck it'd be https://github.com/Stvad/Software_Engineering__git.git

@JeanCyber-B
Copy link
Author

Hello,
thank you for your prompt response.

Your add on seems extremely interesting, the next step of anki.

I have created a new repository as explained in the read me, with a deck of three cards.
I open anki in admin mode.
I'm trying to import it on a blank profile (using the full link: https://github.com/JeanCyber-B/Test-3.git).

Thank you for your help

Here's the error message:

`Anki 2.1.30 (06a69c25) Python 3.8.0 Qt 5.14.1 PyQt 5.14.1
Platform: Windows 10
Flags: frz=True ao=True sv=1
Add-ons, last update check: 2020-08-12 12:00:14

Caught exception:
Traceback (most recent call last):
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\anki\ui\action_vendor.py", line 35, in <lambda>
    lambda: GitImporter.on_git_import_action(self.window.col))
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 28, in on_git_import_action
    GitImporter(collection).import_from_git()
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 33, in import_from_git
    self.clone_repository_and_import(repo_url)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\github\github_importer.py", line 39, in clone_repository_and_import
    porcelain.pull(porcelain.open_repo(str(repo_local_path)), repo_url)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\porcelain.py", line 961, in pull
    fetch_result = client.fetch(
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\client.py", line 430, in fetch
    commit()
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\client.py", line 416, in commit
    target.object_store.add_thin_pack(f.read, None)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\object_store.py", line 765, in add_thin_pack
    return self._complete_thin_pack(f, path, copier, indexer)
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\object_store.py", line 734, in _complete_thin_pack
    index_file.close()
  File "C:\Users\Jean\AppData\Roaming\Anki2\addons21\1788670778\dist\dulwich\file.py", line 175, in close
    os.replace(self._lockfilename, self._filename)
PermissionError: [WinError 5] Accès refusé: 'C:\\Users\\Jean\\AppData\\Roaming\\Anki2\\addons21\\1788670778\\user_files\\test\\Test-3\\.git\\objects\\pack\\pack-da39a3ee5e6b4b0d3255bfef95601890afd80709.idx.lock' -> 'C:\\Users\\Jean\\AppData\\Roaming\\Anki2\\addons21\\1788670778\\user_files\\test\\Test-3\\.git\\objects\\pack\\pack-da39a3ee5e6b4b0d3255bfef95601890afd80709.idx'`

@aplaice
Copy link
Collaborator

aplaice commented Nov 23, 2021

Looking at the error messages, I think that #138 was a duplicate of this issue. Since, that was (hopefully!) fixed by #139, I'll close this issue as well.

(The fix is in master and not yet on AnkiWeb.)

Obviously, if (once a new version is released), this or any other problem comes up, please feel free to comment or open a new issue (assuming you're even still interested in CrowdAnki, after all this time :)).

@aplaice aplaice closed this as completed Nov 23, 2021
@aplaice aplaice linked a pull request Nov 23, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants