diff options
author | Ryan <fauxpark@gmail.com> | 2022-03-20 07:58:30 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 20:58:30 +0000 |
commit | 2f095b8925df98cf2c8c818c8fc44a9015efd6be (patch) | |
tree | ef8ab0c72ad5c09b38f146ed814e95f2d10988fe | |
parent | 047ef3cd121e6bed3702eaf7ed3e96cf1e765ec5 (diff) |
qmk.path.FileType: fix argument handling (#16693)
* qmk.path.FileType: pass in mode as first argument
* Better solution
* Grammar...
-rw-r--r-- | lib/python/qmk/path.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 9b94abbc12..556d0eefc8 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py @@ -70,9 +70,11 @@ def normpath(path): class FileType(argparse.FileType): - def __init__(self, encoding='UTF-8'): + def __init__(self, *args, **kwargs): # Use UTF8 by default for stdin - return super().__init__(encoding=encoding) + if 'encoding' not in kwargs: + kwargs['encoding'] = 'UTF-8' + return super().__init__(*args, **kwargs) def __call__(self, string): """normalize and check exists |