GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ImportError on latest GitPython 3.1.16 · Issue #1238 · gitpython-developers/GitPython

ImportError on latest GitPython 3.1.16 #1238

New issue
Copy link
New issue
Copy link
Closed
#1240
Closed
ImportError on latest GitPython 3.1.16#1238
#1240
Copy link
Milestone
v3.1.17 - Bugfixes

Description

@wwwaldo
wwwaldo
opened on May 13, 2021
Issue body actions

Hey all,

Our CI doesn't pin GitPython versions (always use latest) and some of our automated tests failed today with a mysterious GitPython ImportError. Here's the stack trace:

[2021-05-13T15:23:58.759Z] ERROR launching hyper random, stderr: sh: 0: getcwd() failed: No such file or directory

[2021-05-13T15:23:58.759Z] Traceback (most recent call last):

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/__init__.py", line 83, in <module>

[2021-05-13T15:23:58.759Z]     refresh()

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/__init__.py", line 73, in refresh

[2021-05-13T15:23:58.759Z]     if not Git.refresh(path=path):

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 215, in refresh

[2021-05-13T15:23:58.759Z]     cls().version()

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 542, in <lambda>

[2021-05-13T15:23:58.759Z]     return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 1005, in _call_process

[2021-05-13T15:23:58.759Z]     return self.execute(call, **exec_kwargs)

[2021-05-13T15:23:58.759Z]   File "/usr/local/lib/python3.7/site-packages/git/cmd.py", line 686, in execute

[2021-05-13T15:23:58.759Z]     cwd = self._working_dir or os.getcwd()

[2021-05-13T15:23:58.759Z] FileNotFoundError: [Errno 2] No such file or directory

[2021-05-13T15:23:58.759Z] 

[2021-05-13T15:23:58.759Z] The above exception was the direct cause of the following exception:

[2021-05-13T15:23:58.760Z] 

[2021-05-13T15:23:58.760Z] Traceback (most recent call last):

[2021-05-13T15:23:58.760Z]   File "/usr/local/bin/spell", line 7, in <module>

[2021-05-13T15:23:58.760Z]     from spell.cli.main import main

[2021-05-13T15:23:58.760Z]   File "/usr/src/spell/python/spell/cli/main.py", line 47, in <module>

[2021-05-13T15:23:58.760Z]     from spell.cli.commands.run import run

[2021-05-13T15:23:58.760Z]   File "/usr/src/spell/python/spell/cli/commands/run.py", line 11, in <module>

[2021-05-13T15:23:58.760Z]     from spell.cli.utils import (

[2021-05-13T15:23:58.760Z]   File "/usr/src/spell/python/spell/cli/utils/git_utils.py", line 8, in <module>

[2021-05-13T15:23:58.760Z]     import git

[2021-05-13T15:23:58.760Z]   File "/usr/local/lib/python3.7/site-packages/git/__init__.py", line 85, in <module>

[2021-05-13T15:23:58.760Z]     raise ImportError('Failed to initialize: {0}'.format(exc)) from exc

[2021-05-13T15:23:58.760Z] ImportError: Failed to initialize: [Errno 2] No such file or directory

I think this might be a regression in the new 3.1.16.

Many of our other tests also seem to import the gitpython library but they don't error. The only difference I can see between the failed and passed tests is that the failed tests run in a parallel thread executor, all passing tests run one at a time.

Activity

  1. Yobmod commented on May 13, 2021

    @Yobmod
    Yobmod
    on May 13, 2021
    Contributor
    More actions

    I think its due to a change in util.Expand_path(), as self._working_dir = expand_path(working_dir).

    But I don't know why it would only fail with parallel code.

    I've reverted the change (it added a None check as working_dir can be None, but logic must have been wrong somewhere) and added type:ignore to the resulting mypy errors for now to pass CI #1240

    Reacted by ryan
  2. Byron commented on May 13, 2021

    @Byron
    Byron
    on May 13, 2021
    Member
    More actions

    I have yanked the release and will see to these issues in a bit.

  3. Byron
    closed this as completedin #1240on May 14, 2021
  4. Byron
    added this to the v3.1.17 - Bugfixes milestone on May 14, 2021
  5. Byron commented on May 14, 2021

    @Byron
    Byron
    on May 14, 2021
    Member
    More actions

    @karenin-overseas It would be great if you could give the latest main a shot on your CI to see if the issue is indeed fixed. If so, I am happy to cut a new release. Thank you

  6. Byron
    reopened this on May 14, 2021
  7. Byron
    added
    waiting for feedback
    on May 14, 2021
  8. wwwaldo commented on May 14, 2021

    @wwwaldo
    wwwaldo
    on May 14, 2021
    Author
    More actions

    @Byron, I'm able to verify that our CI does not error off main. Thanks

  9. Byron
    closed this as completedon May 14, 2021
  10. Byron
    removed
    waiting for feedback
    on May 14, 2021
  11. Byron commented on May 14, 2021

    @Byron
    Byron
    on May 14, 2021
    Member
    More actions

    And here is the new release: https://pypi.org/project/GitPython/3.1.17/

  12. netbsd-srcmastr
    added a commit that references this issue on May 14, 2021

    py-gitpython: updated to 3.1.17

    468a78e
  13. msk
    added a commit that references this issue on May 11, 2026

    py-gitpython: updated to 3.1.17

    00b3c01
  14. jperkin
    added a commit that references this issue on May 14, 2026

    py-gitpython: updated to 3.1.17

    cf87a68
  15. tsutsui
    added a commit that references this issue on Oct 17, 2026

    py-gitpython: updated to 3.1.17

    952a792
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • v3.1.17 - Bugfixes

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.