Skip to content

Sporadic failures in Popen() under Windows with processes left in subprocess._active list #508

@ankostis

Description

@ankostis

Under Windows, when running test-cases creating different temporary repositories consecutively, I get sporadic failures when executing the git process:

 File "D:\Apps\WinPython-64bit-3.5.2.1\python-3.5.2.amd64\lib\site-packages\git\repo\base.py", line 872, in init
    git.init(**kwargs)
  File "D:\Apps\WinPython-64bit-3.5.2.1\python-3.5.2.amd64\lib\site-packages\git\cmd.py", line 466, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "D:\Apps\WinPython-64bit-3.5.2.1\python-3.5.2.amd64\lib\site-packages\git\cmd.py", line 910, in _call_process
    return self.execute(make_call(), **_kwargs)
  File "D:\Apps\WinPython-64bit-3.5.2.1\python-3.5.2.amd64\lib\site-packages\git\cmd.py", line 630, in execute
    raise GitCommandNotFound(str(err))
git.exc.GitCommandNotFound: [WinError 6] The handle is invalid
  • Digging a bit further, I noticed that before executing the failing Popen(), the subprocess._active list contains 2 leftovers processes, while this list is always empty when not failing.
  • I tried to add some delays with time.sleep() but it did not help.
  • It did help when I simplified my test-cases, i.e. dropping some commit actions.
  • Tested under:
    • Windows 10,
    • WinPython 3.5.2:
    • gitpython: both latest in PyPi v2.0.8 and latest master from github(df65f51) (2.0.9-dev0).
    • smmap: 0.9.0
    • gitdb: 0.6.4

An minor note: the try-catch Popen() code assumes that any exception caught is because git was not found, while above it obviously not the case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy