[Python-ideas] Hooks into the IO system to intercept raw file reads/writes

Victor Stinner victor.stinner at gmail.com
Tue Feb 10 14:53:25 CET 2015


Hi,

2015-02-04 10:32 GMT+01:00 Paul Moore <p.f.moore at gmail.com>:
> It works for me, but I get an error on termination:
>
> RuntimeError: <_overlapped.Overlapped object at 0x00000000033C56F0>
> still has pending operation at deallocation, the process may crash

I didn't reproduce your issue. I tried with the latest development
version of asyncio, but also older versions. Maybe we used a different
version of the code.

Anyway, you should enable all debug checks: it will show you different
issues in your code,
https://docs.python.org/dev/library/asyncio-dev.html#debug-mode-of-asyncio

> I'm guessing that there's a missing wait on some object, but I'm not
> sure which (or how to identify what's wrong from the error). I'll keep
> digging, but on the assumption that it works on Unix, there may be a
> subtle portability issue here.

In fact, it was a bug in asyncio: Python issue #23242. Good news: it
was already fixed, 3 weeks ago.
http://bugs.python.org/issue23242

The high-level subprocess API (create_subprocess_exec/shell) doesn't
give access to the transport, so it's responsible to handle it. I
forgot to close explicitly the transport when the process exited. It's
now fixed.
https://hg.python.org/cpython/rev/df493e9c6821

Recently I fixed a lot of similar issues, and as Guido wrote, I also
fixed major IOCP issues (many subtle race conditions). Good news: all
fixes will be part of Python 3.4.3!

Victor


More information about the Python-ideas mailing list