【问题标题】:Path issue with python script in git shellgit shell中python脚本的路径问题
【发布时间】:2012-01-20 16:21:47
【问题描述】:

我正在尝试使用脚本https://github.com/charleso/git-cc。你可以在那里看到麻烦的部分,它在common.py

操作系统是windows 7。使用git shell,按照自述文件中的说明。 执行:

gitcc init /c/clearcase/myview/vob/

gitcc init c:/clearcase/myview/vob/

失败:

  File "/cygdrive/c/versioncontrol/git-cc/common.py", line 47, in git_exec
    return popen('git', cmd, GIT_DIR, **args)
  File "/cygdrive/c/versioncontrol/git-cc/common.py", line 57, in popen
    pipe = Popen(cmd, cwd=cwd, stdout=PIPE, stderr=PIPE, env=env)
  File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
    errread, errwrite)
  File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

如果我打开 DEBUG,它会告诉我它正在尝试运行“git branch”。我已验证 os.environ 包含正确的路径,并且“git”在该路径中。在“env”变量中使用 os.environ 仍然没有任何区别。 "git" 和 "git branch" 在 shell 中运行良好。我做错了什么?

【问题讨论】:

    标签: python git cygwin mingw


    【解决方案1】:

    好的,从 cygwin bash shell 运行它解决了这个问题,并且运行良好。我可能应该猜到 git bash(mingw 系统)在 cygwin 上表现不佳。

    【讨论】:

    • 我相信 git bash 是 cygwin 的一种风格。
    • 好吧,如果您考虑 cygwin 的 MinGW 风格(它最初是从那里分叉的),那么是的。底线是他们不喜欢对方,反正:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-17
    • 1970-01-01
    • 2011-07-15
    • 2013-02-09
    • 1970-01-01
    相关资源
    最近更新 更多