spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.31k stars 1.61k forks source link

Coe Analysis error #22337

Open FreemanArthur opened 2 months ago

FreemanArthur commented 2 months ago

Description

What steps will reproduce the problem?

When using Code Analysis, can't work and report: "unicodedecodeerror utf-8 codec can't decode"

Traceback

pylint error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\__main__.py", line 10, in <module>
    pylint.run_pylint()
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\__init__.py", line 36, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\lint\run.py", line 167, in __init__
    args = _config_initialization(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_initialization.py", line 39, in _config_initialization
    config_data, config_args = config_file_parser.parse_config_file(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_file_parser.py", line 121, in parse_config_file
    return self._parse_ini_file(file_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_file_parser.py", line 40, in _parse_ini_file
    parser.read_file(fp)
  File "D:\anaconda3\envs\python12_4env\Lib\configparser.py", line 705, in read_file
    self._read(f, source)
  File "D:\anaconda3\envs\python12_4env\Lib\configparser.py", line 999, in _read
    for lineno, line in enumerate(fp, start=1):
  File "<frozen codecs>", line 322, in decode
  File "D:\anaconda3\envs\python12_4env\Lib\encodings\utf_8_sig.py", line 69, in _buffer_decode
    return codecs.utf_8_decode(input, errors, final)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

pylint error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\__main__.py", line 10, in <module>
    pylint.run_pylint()
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\__init__.py", line 36, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\lint\run.py", line 167, in __init__
    args = _config_initialization(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_initialization.py", line 39, in _config_initialization
    config_data, config_args = config_file_parser.parse_config_file(
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_file_parser.py", line 121, in parse_config_file
    return self._parse_ini_file(file_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\python12_4env\Lib\site-packages\pylint\config\config_file_parser.py", line 40, in _parse_ini_file
    parser.read_file(fp)
  File "D:\anaconda3\envs\python12_4env\Lib\configparser.py", line 705, in read_file
    self._read(f, source)
  File "D:\anaconda3\envs\python12_4env\Lib\configparser.py", line 999, in _read
    for lineno, line in enumerate(fp, start=1):
  File "<frozen codecs>", line 322, in decode
  File "D:\anaconda3\envs\python12_4env\Lib\encodings\utf_8_sig.py", line 69, in _buffer_decode
    return codecs.utf_8_decode(input, errors, final)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0             :  1.4.0 (OK)
chardet >=2.0.0                  :  4.0.0 (OK)
cloudpickle >=0.5.0              :  3.0.0 (OK)
cookiecutter >=1.6.0             :  2.6.0 (OK)
diff_match_patch >=20181111      :  20200713 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.25.0 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.0.1 (OK)
jsonschema >=3.2.0               :  4.19.2 (OK)
keyring >=17.0.0                 :  24.3.1 (OK)
nbconvert >=4.0                  :  7.10.0 (OK)
numpydoc >=0.6.0                 :  1.7.0 (OK)
paramiko >=2.4.0                 :  2.8.1 (OK)
parso >=0.7.0,<0.9.0             :  0.8.3 (OK)
pexpect >=4.4.0                  :  4.8.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  5.9.0 (OK)
pygments >=2.0                   :  2.15.1 (OK)
pylint >=2.5.0,<3.1              :  2.16.2 (OK)
pylint_venv >=3.0.2              :  3.0.3 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.10.0,<1.11.0           :  1.10.0 (OK)
pylsp_black >=2.0.0,<3.0.0       :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.2 (OK)
qtawesome >=1.2.1                :  1.2.2 (OK)
qtconsole >=5.5.1,<5.6.0         :  5.5.1 (OK)
qtpy >=2.1.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.0.1 (OK)
setuptools >=49.6.0              :  72.1.0 (OK)
sphinx >=0.6.6                   :  7.3.7 (OK)
spyder_kernels >=2.5.0,<2.6.0    :  2.5.0 (OK)
textdistance >=4.2.0             :  4.2.1 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  4.0.1 (OK)
zmq >=22.1.0                     :  25.1.2 (OK)

# Optional:
cython >=0.21                    :  None (NOK)
matplotlib >=3.0.0               :  3.8.4 (OK)
numpy >=1.7                      :  1.26.4 (OK)
pandas >=1.1.1                   :  None (NOK)
scipy >=0.17.0                   :  1.13.1 (OK)
sympy >=0.7.3                    :  None (NOK)
dalthviz commented 2 months ago

Hi @FreemanArthur thank you for the feedback! Seems like you have over your setup a corrupted Pylint config file? 🤔 Could you check if there is actually some Pylint config file around (possible places where a config file could be located: https://www.doc.ic.ac.uk/~nuric/posts/sysadmin/where-does-pylint-look-for-configuration-files/)? Also, maybe checking the Pylint documentation about how to generate a config file could be useful: https://pylint.readthedocs.io/en/stable/user_guide/configuration/index.html#configuration

Let us know if the info above helps!