aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/path.py
diff options
context:
space:
mode:
authorQMK Bot <[email protected]>2022-02-28 20:03:22 +0000
committerQMK Bot <[email protected]>2022-02-28 20:03:22 +0000
commit36e47cb3aaa6380764ab23e2b0308bf689156aa7 (patch)
treef762d5f9f497432cb4dca6fa016c254f1065de9b /lib/python/qmk/path.py
parent3c7c9bdd8614cd332b4db7ab6d05429d513ba11d (diff)
parentfbfd5312b995a32af690c183cad0dc988f695e89 (diff)
downloadqmk_firmware-36e47cb3aaa6380764ab23e2b0308bf689156aa7.tar.gz
qmk_firmware-36e47cb3aaa6380764ab23e2b0308bf689156aa7.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/path.py')
-rw-r--r--lib/python/qmk/path.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index dfb8371f84..9b94abbc12 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -70,9 +70,13 @@ def normpath(path):
class FileType(argparse.FileType):
+ def __init__(self, encoding='UTF-8'):
+ # Use UTF8 by default for stdin
+ return super().__init__(encoding=encoding)
+
def __call__(self, string):
"""normalize and check exists
otherwise magic strings like '-' for stdin resolve to bad paths
"""
norm = normpath(string)
- return super().__call__(norm if norm.exists() else string)
+ return norm if norm.exists() else super().__call__(string)