Changes between Initial Version and Version 1 of Ticket #8313, comment 5


Ignore:
Timestamp:
Jan 18, 2023, 4:52:26 PM (3 years ago)
Author:
Tom Goddard

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8313, comment 5

    initial v1  
    11I tried converting the download shell magic to Python.  But the ChimeraX Google Colab AlphaFold script uses shell magic in many places so that fix requires changing a lot of code.
    22
    3 So instead I tried a different fix where I redefined locale.getpreferredencoding() to return 'UTF-8' if it is not returning that value.  This is an ugly fix but I was not able to track down how OpenMM changes the preferred encoding.  Python executes getpreferredendcoding() as a C system call.  The only environment variable that is set that that effects this seems to be LANG = en_US.UTF-8.  There is no LC_ALL set.  While this solution works for fixing Google Colab shell magic, the Python open() function and pathlib.Path.open() used by ColabFold still get an encoding = 'ANSI_X3.4-1968' and a second run of AlphaFold in the same Google Colab session fails attempting to write citations to a file:
     3So instead I tried a different fix where I redefined locale.getpreferredencoding() to return 'UTF-8' if it is not returning that value.  This is an ugly fix but I was not able to track down how OpenMM changes the preferred encoding.  Python executes getpreferredendcoding() as a C library call.  The only environment variable that is set that that effects this seems to be LANG = en_US.UTF-8.  There is no LC_ALL set.  While this solution works for fixing Google Colab shell magic, the Python open() function and pathlib.Path.open() used by ColabFold still get an encoding = 'ANSI_X3.4-1968' and a second run of AlphaFold in the same Google Colab session fails attempting to write citations to a file:
    44
    55{{{