Skip to content

Fix usage of Path.with_suffix()

Lucas Magalhães requested to merge fix_suffix into develop

Trying to run --generate will get a ValueError exception for the wrong usage of with_suffix().

>>> from pathlib import Path
>>> Path("test.yml").with_suffix("spec.yml")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/pathlib.py", line 779, in with_suffix
    raise ValueError("Invalid suffix %r" % (suffix))
ValueError: Invalid suffix 'spec.yml'

To fix "spec" should be added to the name of the file instead on the suffix.

Edited by Lucas Magalhães

Merge request reports