1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Fix compatibility between python2 and 3

This commit is contained in:
Jean-Marc Martins 2013-09-19 14:40:03 +02:00
parent 6c40f5e24a
commit a631c8c761
5 changed files with 18 additions and 11 deletions

View file

@ -36,7 +36,7 @@ FILESYSTEM_ENCODING = sys.getfilesystemencoding()
try:
from dulwich.repo import Repo
GIT_REPOSITORY = Repo(FOLDER).encode(FILESYSTEM_ENCODING)
GIT_REPOSITORY = Repo(FOLDER)
except:
GIT_REPOSITORY = None
@ -53,7 +53,7 @@ def open(path, mode="r"):
# On exit
if GIT_REPOSITORY and mode == "w":
path = os.path.relpath(abs_path, FOLDER)
GIT_REPOSITORY.stage([path.encode(FILESYSTEM_ENCODING)])
GIT_REPOSITORY.stage([path])
committer = config.get("git", "committer")
GIT_REPOSITORY.do_commit("Commit by Radicale", committer=committer)
# pylint: enable=W0622