diff --git a/eb_hooks.py b/eb_hooks.py index 9031d97831..cac32e9f71 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -194,6 +194,15 @@ def parse_hook_pillow_set_cpath_library_path(ec, eprefix): os.environ['LIBRARY_PATH'] = os.pathsep.join(filter(None,[os.environ.get('LIBRARY_PATH',''), EESSI_LIB_PATH])) + +def parse_hook_python_bare_set_LANG(ec, eprefix): + """Set the LANG variable to C.UTF-8 in case it was empty.""" + if ec.name == 'Python' and ec.version =='2.7.18' and os.getenv('LANG') is None: + print_msg("NOTE: The environment variable: LANG will be set to C.UTF-8") + ec.log.info("NOTE: The environment variable: LANG will be set to C.UTF-8") + os.environ['LANG'] = 'C.UTF-8' + + def parse_hook_ucx_eprefix(ec, eprefix): """Make UCX aware of compatibility layer via additional configuration options.""" if ec.name == 'UCX': @@ -290,6 +299,7 @@ def pre_test_hook_ignore_failing_tests_SciPybundle(self, *args, **kwargs): 'fontconfig': parse_hook_fontconfig_add_fonts, 'OpenBLAS': parse_hook_openblas_relax_lapack_tests_num_errors, 'Pillow': parse_hook_pillow_set_cpath_library_path, + 'Python': parse_hook_python_bare_set_LANG, 'UCX': parse_hook_ucx_eprefix, } diff --git a/eessi-2023.06-eb-4.8.1-2022a.yml b/eessi-2023.06-eb-4.8.1-2022a.yml index 062f507762..874c09fd78 100644 --- a/eessi-2023.06-eb-4.8.1-2022a.yml +++ b/eessi-2023.06-eb-4.8.1-2022a.yml @@ -55,3 +55,4 @@ easyconfigs: # Uses a custom hook since has zlib as dependency which has hard coded header and library path within Pillow code. options: from-pr: 18881 + - Python-2.7.18-GCCcore-11.3.0-bare.eb