Skip to content

Bad filenames when using Azure Storage #3342

Closed

Description

@daviddavis

We're getting weird filenames (dists_whatever_Release) since upgrading to pulpcore 3.21.1. Looks like this change fixed the filenames so they are no longer SHA digests. However, content_artifact.relative_path here includes the path so when you download a file, you somehow get the file's full path with slashes converted to underscores.

Activity

  1. ipanova commented on Oct 21, 2022

    @ipanova
    Member

    to cover such case it appears we need to call:

    path = os.path.basename(content_artifact.relative_path)
    content_disposition = f"attachment;filename={path}"`
  2. daviddavis commented on Oct 21, 2022

    @daviddavis
    ContributorAuthor

    Or maybe using pathlib:

    filename = Path(content_artifact.relative_path).name
    content_disposition = f"attachment;filename={filename}"
  3. dralley commented on Oct 21, 2022

    @dralley
    Contributor

    Unfortunately, pathlib is slow, sometimes 20-50x slower than working with the standard os functions. Since this is a hot path we should avoid it.

    psf/black#1953
    https://www.youtube.com/watch?v=tFrh9hKMS6Y

  4. added 2 commits that reference this issue on Oct 21, 2022
    36ad68a
    3c5dcfc
  5. moved this to Free to take in RH Pulp Kanban boardon Oct 21, 2022
  6. moved this from Free to take to Needs review in RH Pulp Kanban boardon Oct 21, 2022
  7. dralley commented on Oct 22, 2022

    @dralley
    Contributor

    I closed #3346 as a duplicate

  8. moved this from Needs review to In Progress in RH Pulp Kanban boardon Oct 24, 2022
  9. moved this from In Progress to Needs review in RH Pulp Kanban boardon Oct 24, 2022
  10. added a commit that references this issue on Oct 24, 2022
    72016d0
  11. moved this from Needs review to Done in RH Pulp Kanban boardon Oct 24, 2022
  12. added a commit that references this issue on Oct 24, 2022
    91e87ec
  13. added 2 commits that reference this issue on Oct 24, 2022
    e4d182d
    99d8bfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions