-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
sftp.SFTPStorageFile doesn't properly call it's parent __init__ #487
Comments
Closed
I came across the same issue, and found basically the same solution fiddling around the |
I would love to, but I haven't had the time to get them setup and running locally. :( |
I have opened the rebased version at #558 to play with the tests, sorry for the delay. |
Sorry inadvertently closed this one. |
jschneier
added a commit
that referenced
this issue
Aug 26, 2018
jschneier
added a commit
that referenced
this issue
Aug 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Django's file object assumes it has a
.name
attribute, like in the__bool__
method here: https://github.com/django/django/blob/1.11.12/django/core/files/base.py#L31-L32It does so, because it sets this attribute in its constructor here: https://github.com/django/django/blob/1.11.12/django/core/files/base.py#L19-L21
However, the
sftp.SFTPStorageFile
object does not call that constructor: https://github.com/django/django/blob/1.11.12/django/core/files/base.py#L19-L21Simply adding in
super(SFTPStorageFile, self).__init__(file=self.file, name=self._name)
at the end of that method solves the issue. I'm not setup to make a PR at the moment, or this would also include a PR. I'm happy to make one later today.The text was updated successfully, but these errors were encountered: