Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Windows port: Monkeypatch os.path.join

But only when executing in a MinGW/MSYS context.
This ensures backslashes are automatically replaced
by forward slashed so we don't trip up MSYS quoting
rules.

https://bugzilla.gnome.org/show_bug.cgi?id=620566
  • Loading branch information...
commit b2804a32d278389e25f241f87c22c9a451a02282 1 parent 525ca57
@dieterv authored
Showing with 8 additions and 0 deletions.
  1. +3 −0  giscanner/scannermain.py
  2. +5 −0 giscanner/utils.py
View
3  giscanner/scannermain.py
@@ -382,6 +382,9 @@ def scanner_main(args):
# on each Popen/call/check_call invocation
subprocess.Popen = utils.MsysPopen
+ # Monkeypatch os.path.join so '\\' separators are replaced with '/'
+ os.path.join = utils.msysjoin
+
parser = _get_option_parser()
(options, args) = parser.parse_args(args)
View
5 giscanner/utils.py
@@ -145,3 +145,8 @@ class MsysPopen(_Popen):
def __init__(self, args, **kwargs):
newargs = ['sh.exe', '-c', ' '.join(args)]
return _Popen.__init__(self, newargs, **kwargs)
+
+_join = os.path.join
+def msysjoin(a, *p):
+ path = _join(a, *p).replace('\\', '/')
+ return path
Please sign in to comment.
Something went wrong with that request. Please try again.