dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

UnicodeDecodeError charmap (On Windows) #135

Open yarbs opened 12 months ago

yarbs commented 12 months ago

lineno 97-99 for https://github.com/dadadel/pyment/blob/master/pyment/pyment.py encoding is not defined when opening the file, default encoding on windows is cp1252 and fails when a unicode character is encountered.

Suggest adding an argument to argparse and add a parameter to init of PyComment.

J-K-M commented 11 months ago

If using the -w flag then this issue also arrises on write - line 325. This could likely be fixed in the same way.