Flake8 crashed! TypeError: unorderable types: str() > int()
See original GitHub issueMy linter-flake8 reports that Flake8 crashed:
main.js [sm]:201 linter-flake8:: Flake8 returned an error Traceback (most recent call last):
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 471, in run_ast_checks
ast = self.processor.build_ast()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/processor.py", line 211, in build_ast
return compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udce3' in position 250: surrogates not allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/bin/flake8", line 11, in <module>
sys.exit(main())
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/main/cli.py", line 16, in main
app.run(argv)
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/main/application.py", line 328, in run
self._run(argv)
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/main/application.py", line 316, in _run
self.run_checks()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/main/application.py", line 246, in run_checks
self.file_checker_manager.run()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 319, in run
self.run_serial()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 303, in run_serial
checker.run_checks()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 573, in run_checks
self.run_ast_checks()
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 474, in run_ast_checks
row, column = self._extract_syntax_information(exception)
File "/Users/keisuke.nakata/.pyenv/versions/3.5.1/lib/python3.5/site-packages/flake8/checker.py", line 441, in _extract_syntax_information
if column > 0 and token and isinstance(exception, SyntaxError):
TypeError: unorderable types: str() > int()
I found that linter-flake8 crashes when a file contains non-ascii characters (in my case, Japanese ones). Executing flake8 from terminal works fine.
Thank you in advance!
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TypeError: unorderable types: str() > int() [duplicate]
This is the cause of your error, since a string and an int are not comparable for a greater than operation. To fix...
Read more >Changelog — Python 3.11.1 documentation
gh-96046: PyType_Ready() now initializes ht_cached_keys and performs additional checks to ensure that type objects are properly configured. This avoids crashes ...
Read more >TypeError: unorderable types: str() > int() please help in ...
TypeError : unorderable types: str() > int() please help in explaining this error · + 2. You must convert the input from a...
Read more >[Example code]-Python 3.6 urllib why line starts with b
I know this question has been answered over a year ago, I found a simple. I simply added a decode() to my line...
Read more >atomで、パッケージlinter-flake8をインストールした状態で ...
Flake8 crashed ! linter-flake8:: Flake8 threw an error related to: TypeError: unorderable types: str() > int() Please check Atom's Console ...
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
@keisuke-nakata maybe can help you. export to your shell.
worked for me.
Note also that
flake8
currently ignores encodings forstdin
input (which is how it is called here), this is fixed in theirmaster
branch but hasn’t yet been released.