Browse Source

qmk.path.FileType: fix argument handling (#16693)

* qmk.path.FileType: pass in mode as first argument

* Better solution

* Grammar...
pull/16711/head
Ryan 2 years ago
committed by GitHub
parent
commit
2f095b8925
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      lib/python/qmk/path.py

+ 4
- 2
lib/python/qmk/path.py View File

@ -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


Loading…
Cancel
Save