ambv / flake8-mypy

A plugin for flake8 integrating Mypy.
MIT License
101 stars 17 forks source link

Add support for comments containing Unicode #12

Open DevynCJohnson opened 6 years ago

DevynCJohnson commented 6 years ago

When using Flake8 (with Flake8-Mypy) on Python scripts containing comments with Unicode comments, Flake8 crashes with a UnicodeEncodeError. The suggested code in my commit appears to resolve the issue without side-effects.

ambv commented 6 years ago

I don't understand how the current behavior (which sets encoding to 'utf8' in the NamedTemporaryFile) is any worse than your suggested encoding of every line to utf8 and writing in binary.