Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1216

black formatter for python gives a decoding error "not a utf-8 character" How can I tell black to use 'UTF-16'?

$
0
0

on windows 11, with python 3.11trying to format any of my python.py filesI get this traceback

FINAL line says:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid continuation byte
E:\python\Projects\p2>python -m black --diff settings.pyTraceback (most recent call last):  File "<frozen runpy>", line 198, in _run_module_as_main  File "<frozen runpy>", line 88, in _run_code  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\black\__main__.py", line 3, in <module>    patched_main()  File "src\black\__init__.py", line 1602, in patched_main  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1157, in __call__    return self.main(*args, **kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1078, in main    rv = self.invoke(ctx)         ^^^^^^^^^^^^^^^^  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 1434, in invoke    return ctx.invoke(self.callback, **ctx.params)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\click\core.py", line 783, in invoke    return __callback(*args, **kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\click\decorators.py", line 33, in new_func    return f(get_current_context(), *args, **kwargs)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "src\black\__init__.py", line 668, in main  File "src\black\__init__.py", line 744, in get_sources  File "C:\Users\dickr\AppData\Roaming\Python\Python311\site-packages\black\files.py", line 254, in get_gitignore    lines = gf.readlines()            ^^^^^^^^^^^^^^  File "<frozen codecs>", line 322, in decodeUnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 16: invalid continuation byte

I've searched black documentation for an option to change encoding with no luck.google searched for the problem as it relates to black


Viewing all articles
Browse latest Browse all 1216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>