Skip to content

make sure that both 'get_git_revision' and 'this_is_easybuild' return regular strings rather than Unicode strings#2472

Merged
wpoely86 merged 1 commit intoeasybuilders:developfrom
boegel:version_str
Apr 17, 2018
Merged

make sure that both 'get_git_revision' and 'this_is_easybuild' return regular strings rather than Unicode strings#2472
wpoely86 merged 1 commit intoeasybuilders:developfrom
boegel:version_str

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Apr 16, 2018

This fixes the traceback that occurs when a Unicode character slips into the description easyconfig parameter and EasyBuild is being run directly from a Git repository:

ERROR: Traceback (most recent call last):
  File "/Users/kehoste/work/easybuild-framework/easybuild/main.py", line 128, in build_and_install_software
    (ec_res['success'], app_log, err) = build_and_install_one(ec, init_env, hooks=hooks)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 2698, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 2614, in run_all_steps
    self.run_step(step_name, step_methods)
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 2489, in run_step
    step_method(self)()
  File "/Users/kehoste/work/easybuild-framework/easybuild/framework/easyblock.py", line 2302, in make_module_step
    txt += self.make_module_footer()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 340: ordinal not in range(128)

The problem is that make_module_footer includes VERBOSE_VERSION, which is a unicode string. This triggers a decoding of txt as a unicode string, which fails with the default ascii codec because a UTF-8 character is present in the value return by make_module_description.

By making sure everything that VERBOSE_VERSION is a regular string, this issue can be avoided.

Some additional minor stylistic changes were made to make the flake8 Python code style checker happy.

cc @migueldiascosta, @vanzod

… regular strings rather than Unicode strings
@wpoely86 wpoely86 merged commit d9ed3c6 into easybuilders:develop Apr 17, 2018
@boegel boegel deleted the version_str branch April 17, 2018 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants