Opened 3 years ago
Closed 3 years ago
#6961 closed defect (can't reproduce)
AlphaFold prediction: A UTF-8 locale is required. Got ANSI_X3.4-1968
Reported by: | Tom Goddard | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | moderate | Milestone: | |
Component: | Structure Prediction | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description (last modified by )
Restarting an AlphaFold prediction after an OpenMM minimization failure with minimization turned off by pressing the play button after an error gives the following error. This example is from the standard AlphaFold Colab notebook. The ChimeraX Colab notebook has the same problem. The problem is
import locale locale.getpreferredencoding()
returns "ANSI_X3.4-1968" instead of the expected "UTF-8". Before the error the same call gave "UTF-8". So it seems reporting the error traceback somehow changed the preferred encoding. I was not able to remedy the problem with calls to locale.setlocale(). I could not find any way to get the preferred encoding back to "UTF-8". No relevant environment variables were set. If I redefine locale.getpreferredencoding() to always return 'UTF-8' then AlphaFold complete successfully.
If encoding is not 'UTF-8' then Google Colab is not able to execute any shell commands in the notebook.
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-6-e612fd4aa5be> in <module>() 210 211 # --- Download the predictions --- --> 212 get_ipython().system('zip -q -r {output_dir}.zip {output_dir}') 213 files.download(f'{output_dir}.zip') 2 frames /usr/local/lib/python3.7/dist-packages/google/colab/_shell.py in system(self, *args, **kwargs) 100 kwargs.update({'also_return_output': True}) 101 --> 102 output = _system_commands._system_compat(self, *args, **kwargs) # pylint:disable=protected-access 103 104 if pip_warn: /usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _system_compat(shell, cmd, also_return_output) 445 # stack. 446 result = _run_command( --> 447 shell.var_expand(cmd, depth=2), clear_streamed_output=False) 448 shell.user_ns['_exit_code'] = result.returncode 449 if -result.returncode in _INTERRUPTED_SIGNALS: /usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in _run_command(cmd, clear_streamed_output) 166 if locale_encoding != _ENCODING: 167 raise NotImplementedError( --> 168 'A UTF-8 locale is required. Got {}'.format(locale_encoding)) 169 170 parent_pty, child_pty = pty.openpty() NotImplementedError: A UTF-8 locale is required. Got ANSI_X3.4-1968
Change History (3)
comment:1 by , 3 years ago
Description: | modified (diff) |
---|
comment:2 by , 3 years ago
comment:3 by , 3 years ago
Resolution: | → can't reproduce |
---|---|
Status: | assigned → closed |
I have not seen this error in 6 months. Maybe our switch to using ColabFold fixed it, or maybe Google Colab fixed it.
I was not able to find any information on what Python locale.getpreferredencoding() uses to determine its return value. It did not appear that any environment variables effecting locale were responsible for the UTF-8 to ANSI_X3.4-1968 switch.
A next step would be to see if this error happens without AlphaFold after any Python traceback on Google Colab.
This bug is not a high priority since it only happens after another usually non-recoverable error stops AlphaFold. It is mainly a problem when trying to debug AlphaFold Colab errors.