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 import test with GitHub actions #2

Closed
wants to merge 14 commits into from

Conversation

aplaice
Copy link
Owner

@aplaice aplaice commented Nov 20, 2021

No description provided.

Fix Stvad#147.

Unlike Linux, Windows doesn't allow ASCII control
characters (codepoint < 32) in filenames.  See:

https://stackoverflow.com/a/31976060/6598435

https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

For consistency, we should remove them always.

This might be a moot issue, since in recent versions of Anki (2.1.43
tested) it seems that all such control characters (including \n) are
already filtered out from deck names, but I don't think it hurts.

\n will be double-counted, but I think it's best to keep it explicitly
for readability (and since we're using a set, duplication doesn't
matter).

The `join` takes just 5 μs, so I think replacing it with the
"computed" string is not worth the drop in readability.
Also, reduce "on".  (No need to duplicate.)
@aplaice
Copy link
Owner Author

aplaice commented Nov 20, 2021

Hurrah! The Windows test failed (as desired):

....................F..***.........

1 examples failed of 32 ran in 2.1955 seconds

Failures:

  1) GitImporter user is trying to import a deck from a git repo multiple times it should clone the git repo without crashing
     Failure/Error: test\github\github_importer_spec.py subject.clone_repository_and_import("https://github.com/aplaice/colemak_keyboard_layout_dynamic")
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
         PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '\\tmp\\foo\\bar\\.git\\objects\\pack\\pack-da39a3ee5e6b4b0d3255bfef95601890afd80709.pack'
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
             
     File "C:\Users\runneradmin\.virtualenvs\CrowdAnki-N-R4mrsk\lib\site-packages\dulwich\object_store.py", line 724, in _complete_thin_pack
         os.remove(target_pack)
     File "C:\Users\runneradmin\.virtualenvs\CrowdAnki-N-R4mrsk\lib\site-packages\dulwich\object_store.py", line 765, in add_thin_pack
         return self._complete_thin_pack(f, path, copier, indexer)
     File "C:\Users\runneradmin\.virtualenvs\CrowdAnki-N-R4mrsk\lib\site-packages\dulwich\client.py", line 416, in commit
         target.object_store.add_thin_pack(f.read, None)
     File "C:\Users\runneradmin\.virtualenvs\CrowdAnki-N-R4mrsk\lib\site-packages\dulwich\client.py", line 430, in fetch
         commit()
     File "C:\Users\runneradmin\.virtualenvs\CrowdAnki-N-R4mrsk\lib\site-packages\dulwich\porcelain.py", line 962, in pull
         path, r, progress=errstream.write, determine_wants=determine_wants)
     File ".\crowd_anki\github\github_importer.py", line 39, in clone_repository_and_import
         porcelain.pull(porcelain.open_repo(str(repo_local_path)), repo_url)
     File "test\github\github_importer_spec.py", line 21, in 00000029__it should clone the git repo without crashing
         subject.clone_repository_and_import("https://github.com/aplaice/colemak_keyboard_layout_dynamic")
     
     
Error: Process completed with exit code 1.

@aplaice aplaice closed this Dec 2, 2021
@aplaice aplaice deleted the git_import_test_with_github_actions branch December 2, 2021 21:46
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

Successfully merging this pull request may close these issues.

1 participant