You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The source reason is that inside git-clang-format, it attempted to get the git root path by invoking git rev-parse --show-toplevel, and then attempt to os.chdir() to that location. Sadly that will cause a FileNotFoundError: [WinError 2] error (as shown in the issue linked above).
If I understand it correctly, it seems it's intended to do the path conversion work when passing the argument to the program that we intended to call, and python will simply use Windows-style path inside a python script. Is that correct?
In another way to say, the following simple script will fail:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm attempting to working on a fix that
git clang-format
cannot be used under a MSYS2 shell:os
module don't expect POSIX style file paths MINGW-packages#2457The source reason is that inside
git-clang-format
, it attempted to get the git root path by invokinggit rev-parse --show-toplevel
, and then attempt toos.chdir()
to that location. Sadly that will cause aFileNotFoundError: [WinError 2]
error (as shown in the issue linked above).By reading the documentations:
If I understand it correctly, it seems it's intended to do the path conversion work when passing the argument to the program that we intended to call, and
python
will simply use Windows-style path inside a python script. Is that correct?In another way to say, the following simple script will fail:
Is that right?
For some more context, my attempt to fix the issue is, check if we are using MSYS2 shell, and use
cygpath
to convert the path:Is that the correct way to do so?
By the way, changing (hardcode) the shebang to
#!/usr/bin/python3
can also fix the issue, but should we assume that one exists, or is this way better?Beta Was this translation helpful? Give feedback.
All reactions