-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Fix exists and add modified_time in FTP storage #26
Conversation
Also added modified_time function |
# workaround for broken FTP servers returning responses | ||
# starting with e.g. 1904... instead of 2004... | ||
if len(s) == 15 and s[:2] == '19': | ||
s = repr(1900 + int(s[2:5])) + s[5:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's you str
instead of repr
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, str would probably be a better option. I copied this from some path to python's ftplib which was never accepted.
Hi and thanks for your contribution. I'm excited that someone is using the FTP backend of this library. I've left a few comments inline and I'd be happy to merge this after they are addressed. |
I'm actually using S3, SFTP and FTP. Was using some fork of django-storages-py3 but it's so messed up. Good that I finally found your repo. I'll send some improvements to SFTP backend as well when I get to it. |
Changed repr() to str(). Should be good to pull now. |
Fix exists and add modified_time in FTP storage
Apparently various FTP servers are inconsistent in NLST command output. Some output only filenames, others output paths. This fix supports both.