Skip to content

UnicodeDecodeError when adding easyconfig to archive (if archspec is available) #3284

@boegel

Description

@boegel

I ran into this crash when installing MAFFT-7.453-iccifort-2019.5.281-with-extensions.eb (when using eb on top of Python 2):

ERROR: Traceback (most recent call last):
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/main.py", line 114, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/framework/easyblock.py", line 3239, in build_and_install_one
    repo.add_easyconfig(spec, app.name, det_full_ec_version(app.cfg), buildstats, currentbuildstats)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/tools/repository/filerepo.py", line 120, in add_easyconfig
    txt += statstxt
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 668: ordinal not in range(128)

The culprit is that archspec returns a unicode-type value as CPU arch name, which gets embedded in statstxt, making it also a unicode-type value (rather than a regular str).

When statstxt is added to txt (which is just a str value), it triggers a decoding using the ascii of the txt value, which fails because the description value of MAFFT-7.453-iccifort-2019.5.281-with-extensions.eb contains non-ASCII characters (the ~ in "for alignment of <∼200 sequences"`).

It's easy to fix this, by making sure we cast the unicode value produced by archspec to a regular str value, but it does raise the question why archspec uses unicode values at all, there should be no need for that...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions