Open HealthyPear opened 9 months ago
from xcdf import xcdf file = xcdf.File(str("some.incompatible.file.path"), "r")
returns just a print statement, which is not safe.
XCDF ERROR: Unable to open some.incompatible.file.path for reading
To get an actual exception one needs to explicitly call the check() method
In [11]: file.check() XCDF FATAL ERROR: /private/var/folders/2z/142033n17rbfy969s6h4hymw0000gn/T/pip-req-build-qwktjwel/src/XCDFFile.cc,Read:666]: XCDF Read Failed: File not opened for reading --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) Cell In[11], line 1 ----> 1 file.check() RuntimeError: Caught an unknown exception!
so this step should be directly part of the opening process, possibly with a better exception than a generic RuntimeError.
RuntimeError
returns just a print statement, which is not safe.
XCDF ERROR: Unable to open some.incompatible.file.path for reading
To get an actual exception one needs to explicitly call the check() method
so this step should be directly part of the opening process, possibly with a better exception than a generic
RuntimeError
.