[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2010-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It seems to break at least one buildbot: == ERROR: testSourceAddress (test.test_socket.NetworkConnectionAttributesTest)

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2010-01-03 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Ah, and I was even the one that suggested the bind to 127.0.0.1 strategy for the test :( My buildbots run in linux-vserver virtual hosts, and they way they handle localhost (127.0.0.1) is to alias it to the IP address assigned to the

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2010-01-03 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: I took the easy route and remove the test of the hostname all together. The fact that the source port was used is sufficient indication that the bind call was made. -- ___ Python tracker

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2010-01-02 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: trunk r77263 and r77264 add this feature, including documentation and tests. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3972

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Greg
Greg greg.helli...@gmail.com added the comment: Did this ever happen? It seems like overkill in the non-Python sort of way to continue pointing people to over-riding classes and extending objects when such a small patch adds so powerful and useful a functionality to the library. --

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Since Gregory didn't update the ticket, it seems likely that it hasn't happened yet. If you'd care to try the patch and report on your results, that would help the process. We'll also need unit tests and documentation updates, so patches

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Greg
Greg greg.helli...@gmail.com added the comment: Just looking at the indicated file in the 2.6.4 release tarball, it does not seem that it would apply cleanly. The line numbers do not apply properly anymore, though the edited lines themselves still appear to be unaffected. Without context

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm not sure why this is needed in httplib. Isn't it a matter of configuring the machine's routing tables properly? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Greg
Greg greg.helli...@gmail.com added the comment: For my own case, I have a machine with 50 IP addresses set and I need to run a script to grab data that will randomly select one of those IP addresses to use for its outgoing connection. That's something which needs to be selected at the socket

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: For my own case, I have a machine with 50 IP addresses set and I need to run a script to grab data that will randomly select one of those IP addresses to use for its outgoing connection. That's something which needs to be selected at the

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: You are correct that more than just httplib may need this; however, it is a real need. Consider for example a machine that has multiple IPs on the same network (perhaps there used to be two machines but the services were consolidated onto

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Giampaolo Rodola'
Giampaolo Rodola' billiej...@users.sourceforge.net added the comment: In case it helps, a guy recently reported the same issue for pyftpdlib: http://code.google.com/p/pyftpdlib/issues/detail?id=123 -- ___ Python tracker rep...@bugs.python.org

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Eldon Ziegler
Eldon Ziegler eld...@atlanticdb.com added the comment: The patch files for Python 2.6 and a test file are in the attached tar file. Both httplib.py and socket.py need to be patched now. httplib.HTTPConnection(host[, port[, strict[, timeout]]]) becomes httplib.HTTPConnection(host[, port[,

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: If you want the maximum chance for this to get applied, it would be best to have one or a set of patch files in 'svn diff' format against trunk (see http://python.org/dev for information on how to produce such a patch, specifically section

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2009-12-28 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: yes its a real need and yes we should support this in the standard library. no i have not had time to look at it since my comment a 14 months ago. Thanks for the updated patch Eldon! -- ___

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2008-10-02 Thread Gregory P. Smith
Gregory P. Smith [EMAIL PROTECTED] added the comment: This is useful but as its a feature we won't be able to add it until 2.7/3.1. Assigning to me to make sure it happens. Until then, the approach I suggest is to subclass httplib.HTTPConnection and HTTPSConnection to add your own variants

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2008-10-02 Thread Eldon Ziegler
Eldon Ziegler [EMAIL PROTECTED] added the comment: Sounds good. Let me know if there is anything I can do to help. Eldon On Thu, 2008-10-02 at 18:17 +, Gregory P. Smith wrote: Gregory P. Smith [EMAIL PROTECTED] added the comment: This is useful but as its a feature we won't be able to

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2008-10-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' [EMAIL PROTECTED]: -- nosy: +giampaolo.rodola ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3972 ___ ___ Python-bugs-list

[issue3972] Add Option to Bind to a Local IP Address in httplib.py

2008-09-26 Thread Eldon Ziegler
New submission from Eldon Ziegler [EMAIL PROTECTED]: I updated httplib.py, python 2.4, to be able to bind to a specific IP address when connecting to a remote site. conn = httplib.HTTPConnection('82.94.237.218', 80) will connect to '82.94.237.218' using one of the local IP addresses. For