Skip to content
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

Fails to clone from git if a directory named git is in the path #10

Closed
vbabiy opened this issue Mar 15, 2011 · 1 comment
Closed

Fails to clone from git if a directory named git is in the path #10

vbabiy opened this issue Mar 15, 2011 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@vbabiy
Copy link
Contributor

vbabiy commented Mar 15, 2011

OS: ubuntu 10.10

I have ~/bin prepended to my path.
I also have a ~/bin/git folder where all my git commands are stored.

pip tries to execute ~/bin/git (the folder) instead of /usr/bin/git (the file).

This fixes my problem:

diff -r 14ee6b8d7b89 pip/util.py
--- a/pip/util.py   Sun Feb 13 16:54:56 2011 -0200
+++ b/pip/util.py   Wed Mar 02 03:36:31 2011 +0100
@@ -86,9 +86,9 @@
         for ext in pathext:
             # then including the extension
             cmd_path_ext = cmd_path + ext
-            if os.path.exists(cmd_path_ext):
+            if os.path.exists(cmd_path_ext) and os.path.isfile(cmd_path_ext):
                 return cmd_path_ext
-        if os.path.exists(cmd_path):
+        if os.path.exists(cmd_path) and os.path.isfile(cmd_path):
             return cmd_path
     return None

I'm not very used to python yet or the platforms it supports so I assumed that os.path.isfile() will work on all platforms, you probably have much deeper knowledge about this.

Sorry that I haven't got the time to register an account here or learn/setup mercurial atm.

Regards, Thomas Frössman thomasf@jossystem.se


@carljm
Copy link
Contributor

carljm commented Mar 15, 2011

This is fixed in 0236a47

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants