-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Add a "source_address" option to ftplib #52840
Comments
Similarly to bpo-3972 the patch in attachment adds a new "source_address" option to FTP class to bind to a specific address when connecting to a remote FTP server. It must be noted that this gets done for both control and passive data connections (client connecting to server). The latter one solves bpo-1661754. |
You should not use find_unused_port(), because it causes problems on some Windows buildbot. Also, there's something fishy in your patch, because you never set self.source_address. |
I agree find_unused_port() is the wrong approach in general, but in this case I think there's nothing we can do about it.
You're right, I should set it in connect() method. |
Patch in attachment set source_address attribute and updates doc. http://svn.python.org/view/python/trunk/Lib/test/test_socket.py?r1=77263&r2=77262&pathrev=77263 |
Committed in r88679. |
test_source_address_passive_connection() raises a ResourceWarning. Fix attached. |
Thanks. Committed in r88761. |
Giampaolo, can you make your commit on the Mercurial repo instead? See http://mail.python.org/pipermail/python-dev/2011-March/108738.html |
Committed in r68309. |
Ok, that wasn't r68309. =) |
I'm not seeing the commit anywhere. Did you perhaps forget to "hg push" after committing? |
New changeset 7f605fa1688d by Giampaolo Rodol�� in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: