Skip to content
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

Add support for pathlib.Path #1019

Closed
jarekwg opened this issue Jun 6, 2021 · 2 comments
Closed

Add support for pathlib.Path #1019

jarekwg opened this issue Jun 6, 2021 · 2 comments

Comments

@jarekwg
Copy link

jarekwg commented Jun 6, 2021

Django has made some moves in the past year to support pathlib.Path() with FileSystemStorage https://code.djangoproject.com/ticket/28428

For alignment, django-storages should head in the same direction.

Not proposing any breaking changes here (just yet), but would be nice if Path objects were acceptable parameters when feeding in keys and prefixes.

@tolomea
Copy link

tolomea commented Mar 22, 2022

For S3Boto3Storage we are currently wraping it with this

class BaseS3Storage(S3Boto3Storage):
    def _clean_name(self, name):
        name = str(name)  # convert any pathlib stuff to strings
        return super()._clean_name(name)

to deal with this

@jschneier
Copy link
Owner

This landed in #1200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants