-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read functions should return insightful errors #342
Comments
In the current implementation, we just try to parse the possible contents of I see the following resolutions now:
|
I like the second one. we can set the type of |
When a string has the form of a path separated by slashes or even a single short word it can never be a valid XML or GEF file right? All XML files need to start with a Is almost certainly path if:
|
The
read_cpt
andread_bore
functions have some "automagical" logic that infers the content of thefile
argument. The user can provide an object of typesio.BytesIO | Path | str
and with "engine"="auto", the content type is inferred automatically. This can result in confusing errors when erroneous input is provided.Some examples:
Providing a non-existing path results in
XMLSyntaxError
Input:
Response:
The expectation is to get a
FileNotFoundError
Providing a non-existing path and
engine
="gef" results inValueError
Input:
Response:
The expectation is to get a
FileNotFoundError
Providing an erroneous gef file results in
XMLSyntaxError
while gef can be parsed when forcedInput:
Response:
Input:
Response:
The expectation is to get an error that the gef file is invalid, and this response should be consistent no matter the value for
engine
.The text was updated successfully, but these errors were encountered: