You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At a certain point a method is called to convert the cache_dirs to a list, but ast will fail with an error since it contains special (/) characters in it.
Steps to reproduce
Can reproduce it in two ways:
By setting the above in avocado.conf and running python3.10 test --select=unit
After a bit of debugging I could find the same behavior that _as_list(value) is doing by following the quick example on python CLE.
>>> import ast
>>> bla = '/build/avocado/data/cache'
>>> print(ast.literal_eval(bla))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/ast.py", line 64, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
/build/avocado/data/cache
^
Expected behavior _as_list(value) should return the string as a list.
Current behavior
The above errors mentioned.
System information (please complete the following information):
OS: lsb_release -a
Ubuntu 22.04
Avocado version: avocado -v
103
Avocado installation method: pip, rpm, github ?
Trying to package it in Ubuntu and failing unit tests :-)
Maybe relevant to the bug:
Python version: python3 3.10.6-1~22.04
Additional information
Currently working on an effort to package avocado-framework into Ubuntu/Debian.
The text was updated successfully, but these errors were encountered:
When there is an issue with syntax in avocado config file avocado won't
provide enough information for the user to understand the problem. This
commit will improve the error message by specifying the wrong value and
the reason for syntax error.
before this commit:
```
SyntaxError: Syntax error in config file ./pom_config, please check the
value /build/avocado/data/cache
```
after this commit:
```
ValueError: /build/avocado/data/cache could not be converted into a list
During handling of the above exception, another exception occurred:
SyntaxError: Syntax error in config file ./pom_config, please check the
value /build/avocado/data/cache
```
Reference: avocado-framework#5906
Signed-off-by: Jan Richter <[email protected]>
Describe the bug
If I add a custom directory on avocado.conf with the example:
At a certain point a method is called to convert the cache_dirs to a list, but
ast
will fail with an error since it contains special (/
) characters in it.Steps to reproduce
Can reproduce it in two ways:
By setting the above in
avocado.conf
and runningpython3.10 test --select=unit
After a bit of debugging I could find the same behavior that
_as_list(value)
is doing by following the quick example on python CLE.Expected behavior
_as_list(value)
should return the string as a list.Current behavior
The above errors mentioned.
System information (please complete the following information):
lsb_release -a
avocado -v
Maybe relevant to the bug:
Python version:
python3 3.10.6-1~22.04
Additional information
Currently working on an effort to package
avocado-framework
into Ubuntu/Debian.The text was updated successfully, but these errors were encountered: