Issue 28684: [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/72870

classification

Title: [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user
Type: behavior Stage: resolved
Components: asyncio, Tests Versions: Python 3.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner, xdegaye, yselivanov
Priority: normal Keywords: patch

Created on 2016-11-13 20:39 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_asyncio.log xdegaye,2016-11-13 20:39
test_asyncio_bind.patch xdegaye,2016-11-17 12:45 review
Pull Requests
URL Status Linked Edit
PR 4503 merged xdegaye,2017-11-22 17:00
PR 4547 merged xdegaye,2017-11-24 17:38
Messages (5)
msg280714 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-11-13 20:39
Tests in test_asyncio fail on Android when bind() on a unix socket raises PermissionError for a non-root user. See the attached test_asyncio.log. See also issue 28683 and its patch(es).
msg280769 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-11-14 13:03
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.
msg281038 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-11-17 12:45
With this patch, test_asyncio runs successfully with no ResourceWarning when run on the android-24 emulator.
msg306904 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-24 16:35
New changeset 0f86cd38f4a38f25a4aed3759a654a4b7fa49031 by xdegaye in branch 'master': bpo-28684: asyncio tests handle PermissionError raised on binding unix sockets (GH-4503) https://github.com/python/cpython/commit/0f86cd38f4a38f25a4aed3759a654a4b7fa49031
msg306911 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-11-24 17:56
New changeset 5742f674f7561dc9a1fc66d650e18e31b941183b by xdegaye in branch 'master': bpo-28684: Remove useless import added by the previous commit (GH-4547) https://github.com/python/cpython/commit/5742f674f7561dc9a1fc66d650e18e31b941183b
History
Date User Action Args
2022-04-11 14:58:39 admin set github: 72870
2017-11-24 17:56:24 xdegaye set messages: +
2017-11-24 17:38:09 xdegaye set pull_requests: + <pull%5Frequest4477>
2017-11-24 16:36:58 xdegaye set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-11-24 16:35:58 xdegaye set messages: +
2017-11-24 16:27:06 xdegaye set versions: - Python 3.6
2017-11-22 17:00:38 xdegaye set pull_requests: + <pull%5Frequest4441>
2016-11-21 15:40:04 xdegaye link issue26865 dependencies
2016-11-17 21:25:12 giampaolo.rodola set nosy: - giampaolo.rodola
2016-11-17 21:24:27 gvanrossum set nosy: - gvanrossum
2016-11-17 12:45:48 xdegaye set files: + test_asyncio_bind.patchkeywords: + patchmessages: + stage: needs patch -> patch review
2016-11-14 13:03:52 vstinner set messages: +
2016-11-13 20:39:34 xdegaye create