Django file system storage File.open()
enables passing args/kwargs to python open() as documented here. It would be good to enable Django’s file storage default_storage.open
to do the same. One issue that comes up is that you can’t set an encoding for files you want to open this way.
I’m not sure many of these arguments make sense for non-filesystem backends, such as the in-memory one or the remote storage service backends in the popular django-storages. Perhaps it would be better to restrict the proposal to just encoding
? I can see that being useful.
Any new arguments would still require cooperation from the backend to adopt them, though.
totally agree re: limiting the proposal to adding kwarg encoding!