Skip to content

Not using regex causing weird error #3609

@sushma-4

Description

@sushma-4

I accidentally used regular string in config file:
'hostnames': ['*-1'], instead of 'hostnames': ['.*-1$'],

and it raised "Nothing to repeat error"

WARNING: redefinition of partition 'generic:default': already defined in '<builtin>'
WARNING: redefinition of environment '*:builtin': already defined in '<builtin>'
Traceback (most recent call last):
  File "/home/l1168223/reframe/bin/reframe", line 23, in <module>
    cli.main()
  File "/home/l1168223/reframe/reframe/core/logging.py", line 1131, in _fn
    return fn(*args, **kwargs)
  File "/home/l1168223/reframe/reframe/frontend/cli.py", line 1011, in main
    site_config.select_subconfig(options.system,
  File "/home/l1168223/reframe/reframe/core/config.py", line 532, in select_subconfig
    system_fullname = system_fullname or self._detect_system()
  File "/home/l1168223/reframe/reframe/core/config.py", line 469, in _detect_system
    if re.match(patt, hostname):
  File "/usr/lib64/python3.9/re.py", line 191, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib64/python3.9/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib64/python3.9/sre_compile.py", line 788, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib64/python3.9/sre_parse.py", line 955, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/usr/lib64/python3.9/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/usr/lib64/python3.9/sre_parse.py", line 669, in _parse
    raise source.error("nothing to repeat",
re.error: nothing to repeat at position 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions