Skip to content

revert util.expand_path() due to regression #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2021
Merged

revert util.expand_path() due to regression #1240

merged 1 commit into from
May 14, 2021

Conversation

Yobmod
Copy link
Contributor

@Yobmod Yobmod commented May 13, 2021

Hopefully to fix #1238.

The orginal change (commit 39eb0e6) was attempting to get mypy consistant with expand_path(None), as it doesn't like try except blocks without some type narrowing and expanduser doesn't accept None (triggering the Exception). Added mypy ignores for now, to allow CI to pass.

It passes tests either way, so can't be sure, but the traceback points to an overload of cmd.Git.excecute(), wherein cwd = self._working_dir.
That leads to Git.init(), where self._working_dir = expand_user(working_dir)

@Byron
Copy link
Member

Byron commented May 14, 2021

Thanks for the fix! What I understand is that the try-catch block has to be entered with None, which previously was prevented by the additional type check that mypi wanted to enforce.

It's quite amazing how GitPython seems to be at a state where minor changes will break someone, somewhere, under certain situations like multi-threading. It's a little frightening too.

@Byron Byron merged commit 572bbb3 into gitpython-developers:main May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ImportError on latest GitPython 3.1.16
2 participants