bpo-28684: asyncio tests now handle PermissionError raised when bindi…#4503
bpo-28684: asyncio tests now handle PermissionError raised when bindi…#4503xdegaye merged 6 commits intopython:masterfrom xdegaye:bpo-28684
Conversation
1st1
left a comment
There was a problem hiding this comment.
I would prefer to use @unittest.skipIf(android) approach instead. PermissionError can occur on a normal Linux machine as a result of some regression in asyncio. I don't want such cases to slip through our CI just because it sometimes happens on Android.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@1st1 I understand your concern. Instead of
[1] An interesting academic paper The Misuse of Android Unix Domain Sockets and Security Implications. |
|
SGTM, let's go for |
The test.support.skip_unless_bind_unix_socket() decorator is used to skip asyncio tests that fail because the platform lacks a functional bind() function for unix domain sockets (as it is the case for non root users on the recent Android versions that run now SELinux in enforcing mode).
| with socket.socket(socket.AF_UNIX) as sock: | ||
| try: | ||
| sock.bind(path) | ||
| _bind_nix_socket_error = '' |
|
LGTM |
|
I am not sure that these changes need to be backported to 3.6. |
…ng a unix socket
https://bugs.python.org/issue28684