Pymol-Scripts / Pymol-script-repo

Collected scripts for Pymol
http://www.pymolwiki.org/index.php/Git_intro
435 stars 257 forks source link

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 165: illegal multibyte sequence #103

Closed pkuljx closed 5 years ago

pkuljx commented 5 years ago

I can't install Plugin in PyMOL-2.3.2. When I click the Plugin Manager it is always failed. The Info:

Traceback (most recent call last):
  File "C:\ProgramData\PyMOL\lib\site-packages\pymol\plugins\legacysupport.py", line 83, in plugin_manager
    plugin_manager_panel = PluginManager(None)
  File "C:\ProgramData\PyMOL\lib\site-packages\pymol\plugins\managergui_qt.py", line 58, in __init__
    self.reload_plugins()
  File "C:\ProgramData\PyMOL\lib\site-packages\pymol\plugins\managergui_qt.py", line 232, in reload_plugins
    item.w_version.setText(info.get_version())
  File "C:\ProgramData\PyMOL\lib\site-packages\pymol\plugins\__init__.py", line 220, in get_version
    v = self.get_metadata().get('Version', '')
  File "C:\ProgramData\PyMOL\lib\site-packages\pymol\plugins\__init__.py", line 202, in get_metadata
    for line in f:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 165: illegal multibyte sequence
speleo3 commented 5 years ago

which plugin?

pkuljx commented 5 years ago

which plugin?

Now I can't open the Plugin Manager. Of course, any plugin cannot be install.

speleo3 commented 5 years ago

Remove the problematic plugin, you'll find it in one of the plugin folders:

PyMOL> import pymol.plugins
PyMOL> print(pymol.plugins.get_startup_path())

We'll fix the plugin manager, it should always use UTF-8 to read text from files, and fail gracefully if the input is not UTF-8.

I can't find any plugins in this repo (Pymol-script-repo) which have non-ASCII characters. If you wrote the plugin yourself, make sure it only contains ASCII characters (no Unicode).

pkuljx commented 5 years ago

Remove the problematic plugin, you'll find it in one of the plugin folders:

PyMOL> import pymol.plugins
PyMOL> print(pymol.plugins.get_startup_path())

We'll fix the plugin manager, it should always use UTF-8 to read text from files, and fail gracefully if the input is not UTF-8.

I can't find any plugins in this repo (Pymol-script-repo) which have non-ASCII characters. If you wrote the plugin yourself, make sure it only contains ASCII characters (no Unicode).

Thanks, I solved this problem.

speleo3 commented 5 years ago

Handling of encoded metadata fixed in PyMOL: https://github.com/schrodinger/pymol-open-source/commit/f35f908b0c4363a22a4c1da5861b41c306388a8f