[issue18643] implement socketpair() on Windows

2014-06-23 Thread pturing
Changes by pturing ptur...@gmail.com: -- nosy: +pturing ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list mailing list

[issue18643] implement socketpair() on Windows

2013-11-30 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch adding socketpair to test.support. This version has been used in test_selectors for quite some time now, and would probably be useful for other tests as well. -- Added file: http://bugs.python.org/file32909/socketpair-1.diff

[issue18643] implement socketpair() on Windows

2013-08-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2de7fc69d2d4 by Charles-François Natali in branch '2.7': Issue #18643: Fix some test_socket failures due to large default socket buffer http://hg.python.org/cpython/rev/2de7fc69d2d4 New changeset 498957c97c2b by Charles-François Natali in branch

[issue18643] implement socketpair() on Windows

2013-08-29 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, I chose a 16MB size for SOCK_MAX_SIZE because nowadays, one can encounter large buffers for Gigabit/10Gb Ethernet. Regarding the original issue: is it OK to add it as socket.socketpair(), or should it only be added to test.support? Since I

[issue18643] implement socketpair() on Windows

2013-08-28 Thread Charles-François Natali
Charles-François Natali added the comment: Victor, did you have a chance to test the patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___

[issue18643] implement socketpair() on Windows

2013-08-28 Thread STINNER Victor
STINNER Victor added the comment: Victor, did you have a chance to test the patch? I tested socketpair.diff (modified to use it even on Linux) on another computer, and test ran successfully. On my main computer (Fedora 18, Linux kernel 3.9.4), the test is failing. With sendall_write.diff,

[issue18643] implement socketpair() on Windows

2013-08-28 Thread Charles-François Natali
Charles-François Natali added the comment: Since I'll update socket tests to also use support.PIPE_MAX_SIZE, maybe we should rename this variable while we're at it? Anybody can think of a name that would work both for sockets and pipes? -- nosy: +pitrou

[issue18643] implement socketpair() on Windows

2013-08-28 Thread STINNER Victor
STINNER Victor added the comment: Since I'll update socket tests to also use support.PIPE_MAX_SIZE, maybe we should rename this variable while we're at it? Why not using a different value (constant) for sockets? -- ___ Python tracker

[issue18643] implement socketpair() on Windows

2013-08-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: By alternating between PIPE and SOCK, you get POPK, which is as descriptive as it gets. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___

[issue18643] implement socketpair() on Windows

2013-08-28 Thread Charles-François Natali
Charles-François Natali added the comment: Why not using a different value (constant) for sockets? We can add a new constant (e.g. SOCK_MAX_SIZE), that would be fine, as long as it aliases to PIPE_MAX_SIZE. There's no need to have two values (the current 4MB value is fine). By alternating

[issue18643] implement socketpair() on Windows

2013-08-25 Thread Charles-François Natali
Charles-François Natali added the comment: Alright, I think I know what's happening. The Python implementation uses a TCP socket, whereas the native implementation uses AF_UNIX socket. The maximum size of data that can be written to a socket without blocking is given by its send/receive

[issue18643] implement socketpair() on Windows

2013-08-25 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: Added file: http://bugs.python.org/file31458/sendall_write.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: Here's a patch. Note that I'm still not sure whether it belong to the socket module or test.support. -- keywords: +needs review, patch stage: needs patch - patch review versions: +Python 3.4 Added file:

[issue18643] implement socketpair() on Windows

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: On Linux, many tests of test_socket are failing with the pure Python implementation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: On Linux, many tests of test_socket are failing with the pure Python implementation. The only failing tests I see are due to the fact that the Python implementation uses AF_INET instead of AF_UNIX, which is normal since Windows doesn't have AF_UNIX.

[issue18643] implement socketpair() on Windows

2013-08-24 Thread STINNER Victor
STINNER Victor added the comment: Do you see other failures? I applied your patch and I just replace the hasattr with: hasattr(_socket, Xsocketpair). test_socket failures: == FAIL: test_sendall_interrupted

[issue18643] implement socketpair() on Windows

2013-08-24 Thread Charles-François Natali
Charles-François Natali added the comment: self.assertEqual(sock.family, socket.AF_UNIX) AssertionError: 2 != 1 This is normal. == FAIL: test_sendall_interrupted (test.test_socket.GeneralModuleTests)

[issue18643] implement socketpair() on Windows

2013-08-16 Thread Charles-François Natali
Charles-François Natali added the comment: I was thinking about dropping the C wrapper from socketmodule.c, and replacing it with a pure Python implementation (e.g. the one posted by Richard on python-dev). What do you think? -- ___ Python tracker

[issue18643] implement socketpair() on Windows

2013-08-16 Thread Richard Oudkerk
Richard Oudkerk added the comment: Do you mean you want to use a pure python implementation on Unix? Then you would have to deal with AF_UNIX (which is the default family for socketpair() currently). A pure python implementation which deals with AF_UNIX would have to temporarily create a

[issue18643] implement socketpair() on Windows

2013-08-09 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18643 ___ ___ Python-bugs-list

[issue18643] implement socketpair() on Windows

2013-08-03 Thread Charles-François Natali
New submission from Charles-François Natali: socketpair() is quite useful, notably for tests. Currently, it's not defined on Windows. Since it's rather easy to implement, it would be nice to have it, if not in the stdlib, at least in test.support. -- components: Library (Lib) messages: