Skip to content

Conversation

@boegel
Copy link
Member

@boegel boegel commented Dec 9, 2020

Fixes hard crash when running eb --help=rst on top of Python 3 (used to re-generate EasyBuild docs):

$ eb --help=rst
Traceback (most recent call last):
  File "/Users/kehoste/work/easybuild-framework/easybuild/tools/options.py", line 1356, in parse_options
    eb_go = EasyBuildOptions(usage=usage, description=description, prog='eb', envvar_prefix=CONFIG_ENV_VAR_PREFIX,
  File "/Users/kehoste/work/easybuild-framework/easybuild/tools/options.py", line 242, in __init__
    super(EasyBuildOptions, self).__init__(*args, **kwargs)
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 915, in __init__
    self.parseoptions(options_list=go_args)
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 1189, in parseoptions
    (self.options, self.args) = self.parser.parse_args(options_list)
  File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/optparse.py", line 1387, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/optparse.py", line 1427, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/optparse.py", line 1501, in _process_long_opt
    option.process(opt, value, values, self)
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 238, in process
    return Option.process(self, opt, value, values, parser)
  File "/usr/local/Cellar/[email protected]/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/optparse.py", line 784, in process
    return self.take_action(
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 251, in take_action
    fn()
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 633, in print_rsthelp
    result.append(self.format_option_rsthelp())
  File "/Users/kehoste/work/easybuild-framework/easybuild/base/generaloption.py", line 658, in format_option_rsthelp
    res.extend(mk_rst_table(titles, map(list, zip(*values))))
  File "/Users/kehoste/work/easybuild-framework/easybuild/tools/utilities.py", line 261, in mk_rst_table
    title_cnt, col_cnt = len(titles), len(columns)
TypeError: object of type 'map' has no len()

@boegel boegel added bug fix python3 Python 3 compatibility labels Dec 9, 2020
@boegel boegel added this to the 4.3.2 (next release) milestone Dec 9, 2020
boegel added a commit to migueldiascosta/easybuild-framework that referenced this pull request Dec 9, 2020
@boegel boegel requested a review from ocaisa December 9, 2020 14:30
Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ocaisa ocaisa merged commit 87fb230 into easybuilders:develop Dec 9, 2020
@boegel boegel deleted the eb_help_rst_py3 branch December 9, 2020 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix python3 Python 3 compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants