[issue19635] asyncio should not depend on concurrent.futures, it is not always available

STINNER Victor report at bugs.python.org
Sun Nov 17 23:53:22 CET 2013


New submission from STINNER Victor:

On old FreeBSD versions, concurrent.futures cannot be used. I don't remember why, it's probably related to semaphores (something like a low hardcoded limit). See for example first lines of Lib/test/test_concurrent_futures.py:
---
# Skip tests if _multiprocessing wasn't built.            
test.support.import_module('_multiprocessing')   
# Skip tests if sem_open implementation is broken.                        
test.support.import_module('multiprocessing.synchronize')
# import threading after _multiprocessing to raise a more revelant error  
# message: "No module named _multiprocessing". _multiprocessing is not compiled
# without thread support.
test.support.import_module('threading')
---

The problem is that asyncio always try to import concurrent.futures. Example: 

http://buildbot.python.org/all/builders/x86%20FreeBSD%206.4%203.x/builds/4213/steps/test/logs/stdio

test test_asyncio crashed -- Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/regrtest.py", line 1276, in runtest_inner
    test_runner()
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_asyncio/__init__.py", line 31, in test_main
    run_unittest(suite())
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_asyncio/__init__.py", line 21, in suite
    __import__(mod_name)
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_asyncio/test_base_events.py", line 11, in <module>
    from asyncio import base_events
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/asyncio/__init__.py", line 21, in <module>
    from .futures import *
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/asyncio/futures.py", line 21, in <module>
    Error = concurrent.futures._base.Error
AttributeError: 'module' object has no attribute 'futures'

----------
messages: 203222
nosy: gvanrossum, haypo
priority: normal
severity: normal
status: open
title: asyncio should not depend on concurrent.futures, it is not always available
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19635>
_______________________________________


More information about the Python-bugs-list mailing list