[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

STINNER Victor report at bugs.python.org
Mon Nov 14 08:03:52 EST 2016


STINNER Victor added the comment:

I suggest to write a decorator in Lib/asyncio/test_utils.py to skip AF_UNIX tests on Android if os.getuid() != 0.

Another approach is to catch the PermissionError and re-raises an unittest.SkipTest. Begin by modifying unix_socket_path() context manager in Lib/asyncio/test_utils.py.

I prefer the approach catching PermissionError: it allows to run unit tests on a flavor of Android which doesn't raise PermissionError, and it handles PermissionError on other platforms.

----------

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


More information about the Python-bugs-list mailing list