String argument returned as a list in daqtree.py
If the --service_config
argument is used, with the daqtree.py
script, the given path will be returned as a list, raising the following exception :
Traceback (most recent call last):
File ".../daqling/scripts/Control/daqtree.py", line 53, in <module>
with open(args.service_config) as config_file:
TypeError: expected str, bytes or os.PathLike object, not list
Solution
Removing the nargs = 1
(l.48) seems to solve the problem
- parser.add_argument('--service_config', metavar='CONFIG', type=str, nargs=1,
default=env['DAQ_SCRIPT_DIR']+'Configuration/config/service-config.json',
help='JSON configuration file for config service.')
+ parser.add_argument('--service_config', metavar='CONFIG', type=str,
default=env['DAQ_SCRIPT_DIR']+'Configuration/config/service-config.json',
help='JSON configuration file for config service.')