【问题标题】:Git Diff Python: Python can't open file. Removes all '\' from directoryGit Diff Python:Python 无法打开文件。从目录中删除所有 '\'
【发布时间】:2015-05-26 19:25:48
【问题描述】:

当我尝试使用我的自定义 python 脚本对文件进行 git diff 时,我收到错误无法打开文件并显示目录,其中所有“\”都已删除。

.gitconfig:

[diff "zip"]
    textconv = python C:\\Users\\user\\Documents\\git-xlsm-project\\xlsm-git-diff-test\\git_diff_xlsm.py

当我尝试执行 git diff 时出现此错误:

c:\Python33\python.exe: can't open file 'C:UsersuserDocumentsgit-xlsm-projectxlsm-git-diff-testgit_diff_xlsm.py': [Errno 2] No such file or directory
fatal: unable to read files to diff

【问题讨论】:

  • 您是否尝试使用更多的反斜杠?
  • @IgnacioVazquez-Abrams 是的,我尝试将反斜杠加倍,但没有成功

标签: python git github diff git-diff


【解决方案1】:

改用正斜杠就可以了。 C:/Users/user/Documents/git-xlsm-project/xlsm-git-diff-test/git_diff_xlsm.py

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多