-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-127478: Enhancement to support FTP connection with NAT scenario #127477
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
base: main
Are you sure you want to change the base?
Conversation
Accept 229 Extended passive mode error as acceptible ouput with PASV command
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
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.
Thanks for contributing! Could you add a test to test_ftplib?
Misc/NEWS.d/next/Documentation/2024-12-01-12-51-03.gh-issue-127478.mFSRpa.rst
Outdated
Show resolved
Hide resolved
@@ -0,0 +1 @@ | |||
Accept 229 response as valid PASV command output |
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 be more clear; people reading the changelog don't have the context.
Accept 229 response as valid PASV command output | |
Support "229 Entering Extended Passive Mode" response in :meth:`ftplib.FTP.sendcmd`. |
Lib/ftplib.py
Outdated
host = self.sock.getpeername()[0] | ||
except error_reply as resp: | ||
resp = str(resp) | ||
if resp[:3] == '229': |
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.
This is sort of breaking convention for the file, but it's also more correct. Let me know what you think.
if resp[:3] == '229': | |
if resp.startswith('229'): |
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.
We removed '229' check at all as per later suggestions. This is not applicable. Thanks.
As I said on the issue, I'd like to know whether the response code 229 is accepted by the corresponding RFC or not and if we want to strictly follow the RFC or not. I'll delay my review on that matter until then. |
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.
LTGM modulo a better NEWS if needed (it's 2:42 AM now so I'm going to sleep).
@@ -0,0 +1 @@ | |||
Enhancement to support FTP connection with NAT scenario. |
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.
I'll try to come up with a better NEWS entry here for tomorrow but otherwise thank you.
Some of new FTP servers are responding with 229 Entering Extended passive mode response when PASV command is sent.. Because of this sendcmd('PASV') is sending error though it's a accepted response. Tested with filezilla manually where it's accepting the same. So we need to make changes in ftplib to accept & parse Extended mode with 'PASV' command. Please help to review and merge.