You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "C:\Users\bkeryan\.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\bkeryan\.pyenv\pyenv-win\versions\3.9.13\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\dev\measurementlink-python\.venv\Scripts\ni-python-styleguide.exe\__main__.py", line 7, in <module>
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\click\decorators.py", line 38, in new_func
return f(get_current_context().obj, *args, **kwargs)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\ni_python_styleguide\_cli.py", line 186, in fix
_fix.fix(
File "C:\dev\measurementlink-python\.venv\lib\site-packages\ni_python_styleguide\_fix.py", line 110, in fix
_acknowledge_existing_errors.remove_auto_suppressions_from_file(file)
File "C:\dev\measurementlink-python\.venv\lib\site-packages\ni_python_styleguide\_acknowledge_existing_errors\__init__.py", line 138, in remove_auto_suppressions_from_file
lines = file.read_text(encoding=_utils.DEFAULT_ENCODING).splitlines()
File "C:\Users\bkeryan\.pyenv\pyenv-win\versions\3.9.13\lib\pathlib.py", line 1267, in read_text
return f.read()
File "C:\Users\bkeryan\.pyenv\pyenv-win\versions\3.9.13\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 122: invalid start byte
For debugging, I added calls to print (but logging is more appropriate):
def remove_auto_suppressions_from_file(file: pathlib.Path):
"""Removes auto-suppressions from file."""
print(str(file))
lines = file.read_text(encoding=_utils.DEFAULT_ENCODING).splitlines()
stripped_lines = [_filter_suppresion_from_line(line) for line in lines]
file.write_text("\n".join(stripped_lines) + "\n", encoding=_utils.DEFAULT_ENCODING)
def _suppress_errors_in_file(bad_file, errors_in_file, encoding):
path = pathlib.Path(bad_file)
print(str(path))
lines = path.read_text(encoding=encoding).splitlines(keepends=True)
This shows that fix --aggressive is reading files from .venv, even though they should be excluded.
C:\dev\measurementlink-python\.venv\Lib\site-packages\win32com\demos\excelAddin.py
C:\dev\measurementlink-python\.venv\Lib\site-packages\win32com\demos\excelRTDServer.py
C:\dev\measurementlink-python\.venv\Lib\site-packages\win32com\demos\iebutton.py
Traceback (most recent call last):
File "C:\Users\bkeryan\.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\bkeryan\.pyenv\pyenv-win\versions\3.9.13\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
The text was updated successfully, but these errors were encountered:
Running
poetry run ni-python-styleguide fix --aggressive
on https://github.com/ni/measurementlink-python produces this error:For debugging, I added calls to
print
(but logging is more appropriate):This shows that
fix --aggressive
is reading files from.venv
, even though they should be excluded.The text was updated successfully, but these errors were encountered: