#28428: Add support for Pathlib objects in django.core.storage
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: nobody
Type: New feature | Status: new
Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Roger G. Coram):
As of Python 3.6 (specifically running 3.6.3)
`django.core.files.storage.Storage.generate_filename` doesn't appear to
raise this error when passed a `pathlib.Path`. Instead the `os.path.split`
therein appears to handle it as expected:
{{{
Python 3.6.3 (default, Oct 6 2017, 08:44:35)
>>> import os, pathlib
>>> os.path.split(pathlib.PosixPath("some/folder/test_with_space.txt"))
('some/folder', 'test_with_space.txt')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28428#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.548103dfcbca7262dc8efab8d43d9349%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.