Géry <[email protected]> added the comment:
@Andrew Svetlov
Well this was just an example for illustrating the issue. In real code I need
this to create `ThreadPoolMixin` and `ProcessPoolMixin` classes (similar to the
`socketserver.ThreadingMixIn` and `socketserver.ForkingMixIn` classes in the
standard library, but using a thread/process pool with a fixed size instead of
creating a new thread/process per request) for mixing with my server classes.
But because of this `ProcessPoolExecutor` issue, I cannot use my
`ProcessPoolMixin` class but only my `ThreadPoolMixin` currently.
The fact is one cannot submit a parent method call to a `ProcessPoolExecutor`.
This code snippet prints the exception raised by the call:
from concurrent.futures import ProcessPoolExecutor
class A:
def f(self):
print("called")
class B(A):
def f(self):
executor = ProcessPoolExecutor(max_workers=2)
print(executor.submit(super().f).exception())
if __name__ == "__main__":
B().f()
It prints this:
> [Errno 24] Too many open files
> None
> None
> None
> …
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37294>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com