Skip to content

Don't allow writing target name to end with trailing slash #52

@kristjaneerik

Description

@kristjaneerik

I accidentally forgot to define the filename at the end of a path and did something like:

with stor.open('swift://A/C/path/', 'w') as fp:
    pass

with there already being objects with the prefix swift://A/C/path/.
This caused the HTTPS access page to not render, it served me the file instead.
stor.remove('swift://A/C/path/') removed the object and all was good.

@jtratner suggests that this should just not be allowed happen -- if a copy or write target ends with a trailing slash, the command should fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions