<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Feb 21, 2016, at 7:14 PM, exvito here <<a href="mailto:ex.vitorino@gmail.com" class="">ex.vitorino@gmail.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello all,<div class=""><br class=""></div><div class="">I filed <a href="https://twistedmatrix.com/trac/ticket/7970" class="">https://twistedmatrix.com/trac/ticket/7970</a> last summer while focused on a particular project that was hit by it. Since then I had to attend to other things and I'm now back to refocusing on that project.</div></div></div></blockquote><div><br class=""></div><div>Thanks for following up.  Sorry I've taken so long to respond; this is a highly complex issue that is tempting to just punt on thinking about.  But we really should address it, and thank you for writing a great bug report.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Before submitting a patch for review, I'm looking for preliminary feedback, assuming you agree that the Windows vs POSIX semantics should be the same (if not, why?).</div></div></div></div></blockquote><div><br class=""></div><div>After much thought: Yes.  They should be the same.  The reason they're not is largely ignorance of the relevant APIs and abstractions on Windows, not any desire that they differ.  The one place they have to differ a little bit is handle inheritance: we need to figure out some way to express the 'childFDs' mapping in terms of both file descriptors and handles.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">My patch calls a few Windows APIs via ctypes, however, as far as I can tell, Twisted on Windows requires pywin32 and, recently, there has been some discussion around dropping that dependency and moving towards something based on cffi.</div></div></div></div></blockquote><div><br class=""></div>ctypes is dangerous and error-prone.  If you screw up the bit-width of a type, or the type in a header changes on some future version, ctypes gives you no way of finding out until some poor user's process segfaults, and usually not at the relevant call site.  So we'd prefer not to maintain more ctypes-using code.</div><div><br class=""></div><div>The APIs in pywin32 very closely mirror the underlying Windows API, so for addressing this issue, please just go ahead and use pywin32 APIs; porting them to a new API along with everything else should be relatively straightforward.</div><div><br class=""></div><div>If we do move forward with that change, we will probably use <a href="https://pypi.python.org/pypi/pywincffi" class="">https://pypi.python.org/pypi/pywincffi</a> and not move anything within Twisted.<br class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">What would you say the way forward is? Should I submit the patch for review anyway? Is there any other work that needs to be done first that I may contribute to?</div></div></div></div></blockquote><div><br class=""></div><div>Yes, just go ahead and write the patch.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Thanks in advance for Twisted and for your feedback,</div></div></div></div></blockquote><br class=""></div><div>Thanks for using Twisted, thanks doubly for trying to contribute, and very sorry for the slow response.</div><div><br class=""></div><div>-glyph</div><div><br class=""></div><br class=""></body></html>