You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since version 2.1.7 using Path from pathlib to declare path in Repo.clone_from doesn't work anymore - it was working fine on 2.1.6 and before.
How to reproduce:
pip install gitpython==2.1.7
Run
from pathlib import Path
from git import Repo
path = Path("test1").resolve()
repo = Repo.clone_from("https://github.com/gitpython-developers/async.git", path)
On 2.1.7 it raises TypeError
Traceback (most recent call last):
File "script.py", line 6, in <module>
repo = Repo.clone_from("https://github.com/gitpython-developers/async.git", path)
File "/home/miki/.pyenv/versions/test_gitpython/lib/python3.6/site-packages/git/repo/base.py", line 972, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, **kwargs)
File "/home/miki/.pyenv/versions/test_gitpython/lib/python3.6/site-packages/git/repo/base.py", line 939, in _clone
repo = cls(path, odbt=odbt)
File "/home/miki/.pyenv/versions/test_gitpython/lib/python3.6/site-packages/git/repo/base.py", line 125, in __init__
if expand_vars and ("%" in epath or "$" in epath):
TypeError: argument of type 'PosixPath' is not iterable
I am running this on python 3.6.2.
The text was updated successfully, but these errors were encountered:
Thanks a lot for taking the time to flesh out the issue in such great detail!
Apparently the function assumes path to be a string, and fails otherwise. Probably this could be fixed by converting it to a string in the respective portion of the path, which could be an easy contribution to make.
Since version 2.1.7 using
Path
frompathlib
to declare path inRepo.clone_from
doesn't work anymore - it was working fine on 2.1.6 and before.How to reproduce:
Run
On 2.1.7 it raises
TypeError
I am running this on python 3.6.2.
The text was updated successfully, but these errors were encountered: