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
{{ message }}
Repository navigation
GitPython causes AttributeError: 'FakePipeWrapper' object has no attribute 'closed' #649
Error
Traceback (most recent call last):
File "mwe.py", line 16, in test_git
git.Repo.init("test")
File "venv/lib/python3.8/site-packages/git/repo/base.py", line 1046, in init
git.init(**kwargs)
File "venv/lib/python3.8/site-packages/git/cmd.py", line 638, in<lambda>return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "venv/lib/python3.8/site-packages/git/cmd.py", line 1183, in _call_process
return self.execute(call, **exec_kwargs)
File "venv/lib/python3.8/site-packages/git/cmd.py", line 937, in execute
stdout_value, stderr_value = proc.communicate()
File "/usr/lib/python3.8/subprocess.py", line 1028, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.8/subprocess.py", line 1853, in _communicate
if self.stdout and not self.stdout.closed:
AttributeError: 'FakePipeWrapper' object has no attribute 'closed'
Thanks for the report!
I will have a look later, but unfortunately, I'm not sure if this can be fixed. subprocess is in the list of modules that don't work with pyfakefs, so even if I could fix this concrete problem, it still might not work.
I had another look, and I currently see no possibility to use this with pyfakefs - added a note in the documentation as proposed.
For testing this, you probably have to use the real file system, for example by creating a repository in a temp dir, or by using a RAM disk.
Activity
mrbean-bremen commentedon Nov 16, 2021
Thanks for the report!
I will have a look later, but unfortunately, I'm not sure if this can be fixed.
subprocessis in the list of modules that don't work with pyfakefs, so even if I could fix this concrete problem, it still might not work.hofbi commentedon Nov 16, 2021
Right. Then I guess fixing this won't give us much as I expect
subprocessto be used in the entire project.To close this issue, we could add
GitPythonto the list of modules that don't work with pyfakefs to make this more clear.Do you have any other idea how to test interaction with git repositories without actually accessing the file system?
mrbean-bremen commentedon Nov 16, 2021
I had another look, and I currently see no possibility to use this with pyfakefs - added a note in the documentation as proposed.
For testing this, you probably have to use the real file system, for example by creating a repository in a temp dir, or by using a RAM disk.
Mention libraries depending on subprocess in limitations
Mention libraries depending on subprocess in limitations - see #649 f…