question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Raises SyntaxError when parsing files with umlauts.

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
m-burstcommented, Jul 30, 2020

Hi @tobiasraabe, Thanks for your report. I’ll take a closer look at this next week.

0reactions
tobiasraabecommented, Aug 6, 2020

@m-burst It works like a charm 😃. Thank you very much for the quick responses and the fix!

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found