Skip to content

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

@vbabiy

Description

@vbabiy

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 [email protected]


Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-lockedOutdated issues that have been locked by automationtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions