[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: I think the main problem here is that it's not easy to write reliable tests that work across all platforms (getaddrinfo(host, 'ftp') returning UDP addresses on FreeBSD/Qemu only is an example). We might try to go a little deeper as you

[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Using www.google.com for IPv6 lookups is a bad idea: whether or not you get an IPv6 address depends on whether your nameserver participates in google over ipv6. www.python.org would be a better choice. --

[issue8857] socket.getaddrinfo needs tests

2010-08-16 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Using www.google.com for IPv6 lookups is a bad idea (...) There is also ipv6.google.com -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: test_socket fails on OS X: == ERROR: testGetaddrinfo (test.test_socket.GeneralModuleTests) --

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___ ___

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Is there someone who can take a look at this on OSX (Ronald?)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: I think there is a missing '0' in the failing line: Index: Lib/test/test_socket.py === --- Lib/test/test_socket.py (revision 84079) +++ Lib/test/test_socket.py

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Thanks for the catch. Committed in r84089. I replaced it with socket.getaddrinfo(HOST, None, 0, 0, socket.SOL_TCP) though, so that the proto argument is tested. -- status: open - closed ___

[issue8857] socket.getaddrinfo needs tests

2010-08-15 Thread Ronald Oussoren
Ronald Oussoren ronaldousso...@mac.com added the comment: There is one thing I don't understand about these tests: they basicly only seem to test if the function implements the right interface (argument counts and the structure of the return value). Shouldn't the tests also test if the

[issue8857] socket.getaddrinfo needs tests

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: I'm not sure whether it's a problem with my python installation but this is what I get on FreeBSD 7.0 with both python 2.7 and 3.2: import socket socket.getaddrinfo('localhost', 80) Traceback (most recent call last): File stdin, line

[issue8857] socket.getaddrinfo needs tests

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: This seems to be related with issue 1282647. Modified patch which skips the test in case of buggy libc version is in attachment. -- Added file: http://bugs.python.org/file18525/getaddrinfo3.patch

[issue8857] socket.getaddrinfo needs tests

2010-08-14 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Committed in r84024. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-08-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I've ported the patch to py3k and checked it works under Mandriva Linux and Windows 7 x64. -- versions: -Python 2.6 Added file: http://bugs.python.org/file18485/getaddrinfo3.patch ___ Python tracker

[issue8857] socket.getaddrinfo needs tests

2010-06-17 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Btw, socket.has_ipv6 documentation should be more clear about the fact that having it == True doesn't necessarily mean IPv6 is actually supported. Strange indeed. socket.has_ipv6 checks whether ENABLE_IPV6 was defined at compile time.

[issue8857] socket.getaddrinfo needs tests

2010-06-17 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: But why is that an attribute of a socket object? Please pretend I did not write this. ;) Anyway, getaddrinfo() on FreeBSD/Qemu gives this: socket.getaddrinfo('localhost', 21) [(2, 2, 17, '', ('127.0.0.1', 21)), (2, 1, 6, '',

[issue8857] socket.getaddrinfo needs tests

2010-06-17 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Anyway, getaddrinfo() on FreeBSD/Qemu gives this It seems SOCK_DGRAM is always returned which, as far as I know, doesn't make sense with FTP and SSH protocols. At this point, assuming getaddrinfo() correctly binds the original C

[issue8857] socket.getaddrinfo needs tests

2010-06-17 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: Removed file: http://bugs.python.org/file17692/getaddrinfotest.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-06-17 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: Removed file: http://bugs.python.org/file17693/getaddrinfotest.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-06-16 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: FreeBSD/Qemu: ipv6 is ok, but this fails: [...] That failure refers to this test: # by specifying http we expect all returned sockets have # STREAM type infos = socket.getaddrinfo(HOST, http) for _,

[issue8857] socket.getaddrinfo needs tests

2010-06-16 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: Removed file: http://bugs.python.org/file17516/getaddrinfotest.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-06-16 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: Removed file: http://bugs.python.org/file17691/getaddrinfotest.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-06-16 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: Added file: http://bugs.python.org/file17692/getaddrinfotest.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-06-16 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Forgot to include socket.gaierror in the list of exceptions. New patch in attachment. -- Added file: http://bugs.python.org/file17693/getaddrinfotest.patch ___ Python tracker

[issue8857] socket.getaddrinfo needs tests

2010-06-14 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: FreeBSD/Qemu: ipv6 is ok, but this fails: == FAIL: testGetaddrinfo (__main__.GeneralModuleTests) --

[issue8857] socket.getaddrinfo needs tests

2010-06-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Testing the patch under a Windows XP Qemu virtual machine gives the following error. Works fine under 64-bit Linux. == ERROR: testGetaddrinfo

[issue8857] socket.getaddrinfo needs tests

2010-06-12 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Does that mean has_ipv6() is broken maybe? I've just tested it against a Windows XP sp3 without IPv6 installed (socket.has_ipv6 returns True thought) and it doesn't fail. -- ___ Python tracker

[issue8857] socket.getaddrinfo needs tests

2010-06-01 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: A patch which adds some basic tests is in attachment. It basically tests what told in the documentation without going too deeper. -- Added file: http://bugs.python.org/file17516/getaddrinfotest.patch

[issue8857] socket.getaddrinfo needs tests

2010-05-31 Thread Jean-Paul Calderone
Jean-Paul Calderone exar...@twistedmatrix.com added the comment: About the doc patch: I like the word Resolves more than Translate. Resolves implies possible network activity to me. Translate sounds like it's just a change in representation. Of course, things like `AI_NUMERICHOST`

[issue8857] socket.getaddrinfo needs tests

2010-05-31 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks for the comments. Other functions use translate too (gethostbyname, getservbyname, etc.), so I preferred to keep it for consistency. I've now committed the doc patch. -- ___ Python tracker

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: socket.getaddrinfo has no tests at all. This should be fixed. -- components: Library (Lib), Tests messages: 106767 nosy: pitrou priority: high severity: normal status: open title: socket.getaddrinfo needs tests type: behavior versions:

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +exarkun, giampaolo.rodola, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: It also needs better documentation, by the way. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a possible doc patch for getaddrinfo(). Comments? -- keywords: +patch Added file: http://bugs.python.org/file17502/doc-getaddrinfo.patch ___ Python tracker rep...@bugs.python.org

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file17502/doc-getaddrinfo.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___

[issue8857] socket.getaddrinfo needs tests

2010-05-30 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file17503/doc-getaddrinfo.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8857 ___