[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-09 Thread sbt
sbt added the comment: > I think a generic solution must be found for multiprocessing, so I'll > create a separate issue. I have submitted a patch for Issue 4892 which makes connection and socket objects picklable. It uses socket.share() and socket.fromshare() on Windows. -- __

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-09 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: possibly, multiprocessing.Connection uses handles, which can be socket handles on windows, and that code also uses DuplicateHandle. I think a generic solution must be found for multiprocessing, so I'll create a separate issue. -- ___

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > multiprocessing.reduction still appears to use DuplicateHandle to copy > sockets. It's probably a separate issue, then. This one is about multiprocessing.connection :) -- status: open -> closed ___ Python tracke

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-08 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: multiprocessing.reduction still appears to use DuplicateHandle to copy sockets. I propose adding a pair of custom functions to _multiprocessing, that "pickles" and "unpickles" handles. It can detect socket handles as being different from e.g. pipe han

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed, thank you! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 3.2 ___ Python tracker ___

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset f8a92fd084c2 by Antoine Pitrou in branch 'default': Issue #14522: Avoid duplicating socket handles in multiprocessing.connection. http://hg.python.org/cpython/rev/f8a92fd084c2 -- nosy: +python-dev ___ Py

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread sbt
sbt added the comment: > Is there a reason the patch changes close() to win32.CloseHandle()? This is a Windows only code path so close() is just an alias for win32.CloseHandle(). It allow removal of the lines # Late import because of circular import from multiprocessing.forking impo

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is there a reason the patch changes close() to win32.CloseHandle()? -- components: +Library (Lib) nosy: +pitrou stage: -> patch review type: -> behavior versions: +Python 3.2, Python 3.3 ___ Python tracker

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread sbt
sbt added the comment: Actually Issue 9753 was causing failures in test_socket.BasicTCPTest and test_socket.BasicTCPTest2 on at least one Windows XP machine. -- ___ Python tracker

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread sbt
sbt added the comment: > What is the bug that this fixes? Can you provide a test case? The bug is using an API in a way that the documentation says is wrong/unreliable. There does not seem to be a classification for that. I have never seen a problem caused by using DuplicateHandle() so I can

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread sbt
Changes by sbt : Removed file: http://bugs.python.org/file25153/mp_socket_dup.patch ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread Martin v . Löwis
Martin v. Löwis added the comment: What is the bug that this fixes? Can you provide a test case? -- nosy: +loewis ___ Python tracker ___

[issue14522] Avoid using DuplicateHandle() on sockets in multiprocessing.connection

2012-04-07 Thread sbt
New submission from sbt : In multiprocessing.connection on Windows, socket handles are indirectly duplicated using DuplicateHandle() instead the WSADuplicateSocket(). According to Microsoft's documentation this is not supported. This is easily avoided by using socket.detach() instead of dupli