Raises SyntaxError when parsing files with umlauts.
See original GitHub issueBug report
What’s wrong
Hi, thanks for the plugin!
I use flake8
with flake8-pytest-style
as a pre-commit hook. When I check Python files containing umlauts a SyntaxError
is raised.
File "C:\Users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\Scripts\flake8.EXE\__main__.py", line 9, in <module>
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\main\cli.py", line 22, in main
app.run(argv)
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\main\application.py", line 360, in run
self._run(argv)
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\main\application.py", line 348, in _run
self.run_checks()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\main\application.py", line 262, in run_checks
self.file_checker_manager.run()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\checker.py", line 325, in run
self.run_serial()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\checker.py", line 309, in run_serial
checker.run_checks()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\checker.py", line 589, in run_checks
self.run_ast_checks()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8\checker.py", line 496, in run_ast_checks
for (line_number, offset, text, _) in runner:
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8_plugin_utils\plugin.py", line 75, in run
self._load_file()
File "c:\users\tobia\.cache\pre-commit\repo__2jv1f_\py_env-default\lib\site-packages\flake8_plugin_utils\plugin.py", line 91, in _load_file
self._tree = ast.parse(''.join(self._lines))
File "C:\tools\miniconda3\envs\gettsim\Lib\ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 184
einführungsfaktor = 0.6 + 0.02 * (
^
SyntaxError: invalid character in identifier
How it should work
Parse files correctly.
System information
- Operating system: Windows
- Python version: 3.8.5
- flake8 version: 3.8.3
- flake8-pytest-style version: 1.2.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Python URL encoding with umlauts error - Stack Overflow
Your Python tries to parse the source file (or console input) as UTF-8, but it's actually encoded in Latin-1. You could try to...
Read more >German Umlauts in source files cause: «An error was detected ...
When parsing a source file, formatted as proper utf-8, but still containing special characters like German umlauts in the PHP code*, ...
Read more >I am receiving: Parse error: syntax error, unexpected end of file
I am receiving: Parse error: syntax error, unexpected end of file ... LABEL_parsing_config_file * - parsing of the configuration file ...
Read more >IFC Readers produce an error ISO 10303-21 - FME Community
Each time I tried to read an IFC file in IFC reader I got an error states that “ISO 10303-21: the input data...
Read more >character macro in biber file - biblatex - LaTeX Stack Exchange
Also, I can of course change this umlauted 'o' wherever it appears, but there are lots of other chars in many .bib files,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @tobiasraabe, Thanks for your report. I’ll take a closer look at this next week.
@m-burst It works like a charm 😃. Thank you very much for the quick responses and the fix!