[issue14310] Socket duplication for windows

2012-04-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue14310] Socket duplication for windows

2012-04-18 Thread sbt
sbt added the comment: Can this issue be reclosed now? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue14310] Socket duplication for windows

2012-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9b858096044e by Kristján Valur Jónsson in branch 'default': Issue #14310: Catch testing errors when trying to create unsupported socket http://hg.python.org/cpython/rev/9b858096044e -- ___ Python tracker

[issue14310] Socket duplication for windows

2012-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Re-opening. There is now a buildbot failure: == ERROR: testTypes (test.test_socket.TestSocketSharing) -- Traceback (most rece

[issue14310] Socket duplication for windows

2012-04-07 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailin

[issue14310] Socket duplication for windows

2012-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 51b4bddd0e92 by Kristján Valur Jónsson in branch 'default': Issue #14310: inter-process socket duplication for windows http://hg.python.org/cpython/rev/51b4bddd0e92 -- nosy: +python-dev ___ Python tracke

[issue14310] Socket duplication for windows

2012-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Any other comments? No, the patch looks ok now. Please watch the buildbots after you commit. -- ___ Python tracker ___ _

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Well, I think I have all of the merge errors out now. You´ll forgive me if I didn't notice them all at first, but this is why we review code and you would have helped me by giving me specifics, since after a time, the eyes tend to glaze over. Any oth

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : Removed file: http://bugs.python.org/file25146/duplicate.patch ___ Python tracker ___ ___ Python-bugs-list

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Could you possibly be any more specific? It works for me. Just read it by yourself. There are still duplicate portions there: http://bugs.python.org/file25146/duplicate.patch In general, it's nicer to others to review your changes before uploading them. --

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Could you possibly be any more specific? It works for me. -- ___ Python tracker ___ ___ Py

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Yes, I'm sorry, it was a merging error. I'm still getting to grips > with Hg. I removed the last two and added a new one. Hope you like > it. It's still broken. -- ___ Python tracker

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: >> But changing it to staticmethod strangely fixes it. Interesting. >Sorry? Don't be, probably not your fault. Today we have learned that we can spawn multipropcessing targets with classmethods, but not staticmethods. >Your patch is broken, it has lo

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : Removed file: http://bugs.python.org/file25143/duplicate.patch ___ Python tracker ___ ___ Python-bugs-list

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : Removed file: http://bugs.python.org/file25145/duplicate.patch ___ Python tracker ___ ___ Python-bugs-list

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: [...] > But changing it to staticmethod strangely fixes it. Interesting. Sorry? > Here is yet another patch. Your patch is broken, it has lots of duplicate stuff... -- ___ Python tracker

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: by "memberfunction" I mean a member of the class. I tried staticmethod and it didn't work: I tried a staticmethod and it didn't work: == ERROR: testShare (test.test_socket.TestSocketSh

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here is a new patch, with more tests. > Note that the process worker function can't be a member function > because of how multiprocessing works on Windows. Some comments: - I said classmethod, not member function; this is how test_multiprocessing works, so it

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a new patch, with more tests. Note that the process worker function can't be a member function because of how multiprocessing works on Windows. -- Added file: http://bugs.python.org/file25143/duplicate.patch ___

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: The binary copy: This is a winsock2 feature. There is no difference in layout between 32 bits and 64 bits. I also don't think there is a difference between SDK versions. However, strangely, there is a difference between unicode and non-unicode buil

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Comments about the patch: - versionadded should be 3.3, not 3.4 - MultiprocessingFunc would deserve a meaningful, PEP8 name; it should also probably be a classmethod on TestSocketSharing - please use PEP8 for comments (a space after the "#") - it would be nice

[issue14310] Socket duplication for windows

2012-04-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I have one question: you're simply doing a binary copy of the WSAPROTOCOL_INFO structure. Does it mean sharing wouldn't work between e.g. different MSVC builds of Python (if the structure is different), or between a 32-bit and a 64-bit Python? -- __

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Not much happening on python-dev. Perhaps this is not so controversial. http://www.mail-archive.com/python-dev@python.org/msg66206.html -- ___ Python tracker

[issue14310] Socket duplication for windows

2012-04-06 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : -- Removed message: http://bugs.python.org/msg157189 ___ Python tracker ___ ___ Python-bugs-list m

[issue14310] Socket duplication for windows

2012-04-05 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue14310] Socket duplication for windows

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: You are right, I was thinking more of pyobject attributes. I'll fix this then. -- ___ Python tracker ___ _

[issue14310] Socket duplication for windows

2012-03-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would like to see this discussed on python-dev. -- nosy: +pitrou ___ Python tracker ___ ___ Pytho

[issue14310] Socket duplication for windows

2012-03-31 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Still no responses? I'll submit this then, unless someone objects. -- ___ Python tracker ___ _

[issue14310] Socket duplication for windows

2012-03-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: So, what is the consensus, does this go in or out? What about the "share()" and "fromshare()" functions, are people ok with that? -- versions: +Python 3.3 -Python 3.4 ___ Python tracker

[issue14310] Socket duplication for windows

2012-03-20 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : -- Removed message: http://bugs.python.org/msg156418 ___ Python tracker ___ ___ Python-bugs-list m

[issue14310] Socket duplication for windows

2012-03-20 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson : Removed file: http://bugs.python.org/file24966/duplicate.patch ___ Python tracker ___ ___ Python-bugs-list

[issue14310] Socket duplication for windows

2012-03-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: hm, patch doesn't work, removing the [mq] section -- Added file: http://bugs.python.org/file24966/duplicate.patch ___ Python tracker __

[issue14310] Socket duplication for windows

2012-03-20 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: A new patch with fixes and documentation. And yes, socket.share() does in fact perform duplication, because socket.close() can be performed immediately afterwards. -- Added file: http://bugs.python.org/file24965/duplicate.patch ___

[issue14310] Socket duplication for windows

2012-03-19 Thread sbt
sbt added the comment: > If duplication happened early, then there would have to be a way to > "unduplicate" it in the source process if, say, IPC somehow failed. > There is currently no api to undo the effects of WSADuplicateSocket(). If this were a normal handle then you could use the DUPL

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Good point. The docs don't actually say, except that the docs show a pretty elaborate process dance, where the source process only closes its side of the socket once the target process has called WSASocket(). If duplication happened early, then there

[issue14310] Socket duplication for windows

2012-03-19 Thread sbt
sbt added the comment: > I think this captures the functionality better than "duplicate" or > duppid() since there is no actual duplication involved until the > fromshare() function is called. Are you saying the WSADuplicateSocket() call in share() doesn't duplicate the handle in to the targ

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Here is a new version of thepatch. We now have socket.socket.share(pid) and socket.fromshare(data) to do these. I think this captures the functionality better than "duplicate" or duppid() since there is no actual duplication involved until the fromsha

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: On second thought, sendinfo/recvinfo makes no sense. On unix, one has to create and manage the necessary unix domain sockets, and such code belongs higher up somewhere. So dupinfo(pid), and frominfo() I'll add. -- __

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I like the idea of having a frominfo() function. Though "info" is maybe too generic? Also, dupinfo() is probably better than duplicate, even though there is no dup involved. But I also wonder if we can make this windows/unix agnostic? on unix, you w

[issue14310] Socket duplication for windows

2012-03-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I'm adding an updated version of the patch, taking into account issues raised from reviewers. No documentation yet. -- Added file: http://bugs.python.org/file24940/duplicate.patch ___ Python tracker

[issue14310] Socket duplication for windows

2012-03-15 Thread sbt
sbt added the comment: It appears that the 4th argument of the socket constructor is undocumented, so presumably one is expected to use fromfd() instead. Maybe you could have a frominfo(info) function (to match fromfd(fd,...)) and a dupinfo(pid) method. (It appears that multiprocessing uses

[issue14310] Socket duplication for windows

2012-03-15 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue14310] Socket duplication for windows

2012-03-14 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : winsock natively supports the duplciation of sockets for use on different processes. This patch proposes to add that functionality: socket.duplicate(target_pid) gets a bytes representation of the duplicate socket, usable for the target process. sock