-
-
Notifications
You must be signed in to change notification settings - Fork 176
better handling of ftp features #91
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
Conversation
else 'latin-1' | ||
) | ||
if not PY2: | ||
_ftp.file = _ftp.sock.makefile( |
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.
Not sure how much of a hack this is. The file
attribute of FTP objects is the only thing that references the encoding, by re-creating it, we can modify the encoding based on features.
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.
It should be fine, I don't think the ftplib
implementation will change since it is part of the stdlib.
Isn't your linter complaining about the seemingly-useless self.ftp
lines in other methods though ?
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.
It should be fine, I don't think the ftplib implementation will change since it is part of the stdlib.
That's my thinking.
Isn't your linter complaining about the seemingly-useless self.ftp lines in other methods though ?
It is, and a few more complaints besides. I'll see if I can clear some of those up.
I just tested these changes with our proxy and now I hate our proxy even more. :)
But that does not help with my use case as the proxy still does not proxy the command to the target server:
I'm still trying to figure out how ncftp or lftp handle this. |
Work in Progress
Handle utf8 encoding for ftp servers without opening another connection.
Also ensures that features are requested after login.