Skip to content

Commit 03981f7

Browse files
committed
fix[main.py]: Force path to POSIX format so Windows
1 parent 65ca55f commit 03981f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/edit_python_pe/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from datetime import datetime
77
from time import sleep
8-
8+
import pathlib
99
import pygit2
1010
from github import Github
1111
from github.GithubException import BadCredentialsException, GithubException
@@ -522,6 +522,7 @@ def save_member(self) -> None:
522522
# commit & push
523523
repo = pygit2.Repository(self.REPO_PATH)
524524
rel_path = os.path.relpath(file_path, self.REPO_PATH)
525+
rel_path = pathlib.Path(rel_path).as_posix() # Force path to POSIX format so Windows backslashes (\) don't break pygit2
525526
repo.index.add(rel_path)
526527
repo.index.write()
527528
author_sig = pygit2.Signature(

0 commit comments

Comments
 (0)