import git
fails when current working directory is not accessible
#1334
Milestone
import git
fails when current working directory is not accessible
#1334
Very similar to #1319
Steps to reproduce:
Crash with:
GitPython: 3.1.20
GitPython will run a
git version
when importing, but if the current workding dir is not accessible, the Popen clause will fail.GitPython/git/cmd.py
Line 821 in ef1ef4d
This can be fixed by adding 2 lines after 5b3669e, but I'm not sure if this fix will break some of your assumption.
I found this issue when I'm a previliedged user and try to switch user using
sudo su <user>
and then run a Python script which need a package depending on GitPython.The text was updated successfully, but these errors were encountered: