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
{{ message }}
Repository navigation
Error when --doc or --metadata value matches an existing directory #4394
Let say that I have a directory named pekka, running robot --metadata dev:pekka any.robot
will fail with message : [ ERROR ] Reading documentation from an external file failed: [Errno 21] Is a directory: 'pekka'
The same happens with -D pekka
I think the issue comes from this line : if os.path.exists(value):
line 143 in src/robot/conf/settings.py, which should be : if os.file.exists(value):
which will filter out directories to reach the failing open/read.
This isn't too severe because with documentation it's unlikely your doc is only a directory name and with metadata there's a possibility to use any path as a value if there's a space after the colon like -metadata dev: pekka. Definitely worth fixing anyway.
changed the title [-]Error when metadata/documentation value matches an existing directory[/-][+]Error when `--doc` or `--metadata` value matches an existing directory[/+]on Jul 12, 2022
Activity
pekkaklarck commentedon Jul 11, 2022
Yeah, should use
os.path.isfileinstead ofos.path.exists.pekkaklarck commentedon Jul 12, 2022
This isn't too severe because with documentation it's unlikely your doc is only a directory name and with metadata there's a possibility to use any path as a value if there's a space after the colon like
-metadata dev: pekka. Definitely worth fixing anyway.[-]Error when metadata/documentation value matches an existing directory[/-][+]Error when `--doc` or `--metadata` value matches an existing directory[/+]