-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
We are adding a nidaqmx-python test containing localized strings:
@pytest.mark.parametrize(
"device_name, supported_encodings",
[
("Gerät", ["1252", "iso-8859-1", "utf-8"]),
("l' appareil", ["1252", "iso-8859-1", "utf-8"]),
("デバイス", ["932", "shift-jis", "utf-8"]),
("장치", ["utf-8", "euc-kr"]),
("设备", ["utf-8", "gbk"]),
],
)
...Reformatting this test with ni-python-styleguide fix fails with this error:
PS D:\dev\nidaqmx-python> poetry run ni-python-styleguide fix
All done! ✨ 🍰 ✨
1 file left unchanged.
Traceback (most recent call last):
File "C:\Users\Administrator\.pyenv\pyenv-win\versions\3.9.13\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Administrator\.pyenv\pyenv-win\versions\3.9.13\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\dev\nidaqmx-python\.venv\Scripts\ni-python-styleguide.exe\__main__.py", line 7, in <module>
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\click\decorators.py", line 45, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\ni_python_styleguide\_cli.py", line 186, in fix
_fix.fix(
File "D:\dev\nidaqmx-python\.venv\lib\site-packages\ni_python_styleguide\_fix.py", line 146, in fix
raise Exception(
Exception: Failed to format files:
D:\dev\nidaqmx-python\tests\acceptance\test_internationalization.py: 'charmap' codec can't decode byte 0x90 in position 996: character maps to <undefined>
Workarounds:
- Fix errors manually.
ni-python-styleguide lintdoesn't seem to have this problem. - Avoid UTF-8 in source files. Use "\uXXXX" escapes instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels