-
Notifications
You must be signed in to change notification settings - Fork 50
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
create_folder does nothing (and does not throw) if filepath is an empty string #241
Comments
If memory serves this change will require fixes in tuf to not call |
Thanks for opening this! I agree that this behavior should be resolved in tuf and that the invariant should be modified (to raising, as expected). |
I second that motion. Let's raise a |
I will push a pr to fix this. In my changes, I will raise
exception. I am not sure how we are going to handle the special case when we call |
Sounds good to me. It sounded like there were some historical reasons for |
I don't think we can catch the Exception and handle it in tuf, because we're throwing a generic error from securesystemlib. We might compare the messages and behave differently, but that feels too brittle. We only use |
Looked at this a bit closer: of the 3 |
I went ahead and opened #244 as a PoC for the above. Not actually sure if it's the best approach, but it should avoid the problem of potentially empty strings by catching them in the schema itself 😅 |
Making PATH as |
Are you saying that |
This understanding is correct! I also agree 100% about |
Resolved with #252 |
Description of issue or feature request:
In order to support existing behaviour in tuf the
create_folder
method ofFilesystemBackend
does nothing and does not raise an error if passed an empty string.This feels like counter-intuitive behaviour that doesn't make sense for the storage backend. Ideally this would be resolved in tuf by removing calls to
create_folder
with an empty path i.e. performing any special casing in the caller.See #240
Current behavior:
When
securesystemslib.storage.FilesystemBackend.create_folder()
is called with an empty string it returns immediately.Expected behavior:
When
securesystemslib.storage.FilesystemBackend.create_folder()
is called with an empty string it raises an error, which better mimics the behaviour ofos.mkdir()
:The text was updated successfully, but these errors were encountered: