Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion easybuild/tools/systemtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def get_cpu_arch_name():
if HAVE_ARCHSPEC:
res = archspec_cpu_host()
if res:
cpu_arch_name = res.name
cpu_arch_name = str(res.name)

if cpu_arch_name is None:
cpu_arch_name = UNKNOWN
Expand Down
23 changes: 22 additions & 1 deletion test/framework/toy_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# #
# -*- coding: utf-8 -*-
##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
Expand Down Expand Up @@ -2606,6 +2607,26 @@ def __exit__(self, type, value, traceback):
self.assertErrorRegex(EasyBuildError, error_pattern, self.test_toy_build,
extra_args=extra_args, raise_error=True, verbose=False)

def test_toy_build_unicode_description(self):
"""Test installation of easyconfig file that has non-ASCII characters in description."""
# cfr. https://github.com/easybuilders/easybuild-framework/issues/3284

test_ecs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
toy_ec = os.path.join(test_ecs_dir, 't', 'toy', 'toy-0.0.eb')
toy_ec_txt = read_file(toy_ec)

# the tilde character included here is a Unicode tilde character, not a regular ASCII tilde (~)
descr = "This description includes a unicode tilde character: ∼, for your entertainment."
self.assertFalse('~' in descr)

regex = re.compile(r'^description\s*=.*', re.M)
test_ec_txt = regex.sub(r'description = "%s"' % descr, toy_ec_txt)

test_ec = os.path.join(self.test_prefix, 'test.eb')
write_file(test_ec, test_ec_txt)

self.test_toy_build(ec_file=test_ec, raise_error=True)


def suite():
""" return all the tests in this file """
Expand Down