on windows 11, with python 3.11
trying to format any of my python.py files
I get this traceback
FINAL line says:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd2 in position 16: invalid continuation byte
E:pythonProjectsp2>python -m black –diff settings.py
Traceback (most recent call last):
File “”, line 198, in run_module_as_main
File “”, line 88, in run_code
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesblack_main.py”, line 3, in
patched_main()
File “srcblack_init.py”, line 1602, in patched_main
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesclickcore.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesclickcore.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesclickcore.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesclickcore.py”, line 783, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesclickdecorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “srcblack_init.py”, line 668, in main
File “srcblack_init.py”, line 744, in get_sources
File “C:UsersdickrAppDataRoamingPythonPython311site-packagesblackfiles.py”, line 254, in get_gitignore
lines = gf.readlines()
^^^^^^^^^^^^^^
File “”, line 322, in decode
UnicodeDecodeError: ‘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
Dick Roman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.