{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/103970930","pull_request_review_id":24780959,"id":103970930,"diff_hunk":"@@ -945,16 +946,19 @@ def set_default_selinux_context(self, path, changed):\n         context = self.selinux_default_context(path)\n         return self.set_context_if_different(path, context, False)\n \n-    def set_context_if_different(self, path, context, changed, diff=None):\n+    def set_context_if_different(self, path, context, changed, diff=None, expand=True):\n \n         if not HAVE_SELINUX or not self.selinux_enabled():\n             return changed\n-        cur_context = self.selinux_context(path)\n+        if expand:\n+            path = os.path.expanduser(os.path.expandvars(path))\n+        b_path = to_bytes(path, errors='surrogate_or_strict')\n+        cur_context = self.selinux_context(b_path)","path":"lib/ansible/module_utils/basic.py","position":25,"original_position":25,"commit_id":"3cf69b05a1f8bdecd45975b23e979755b1237f09","original_commit_id":"3cf69b05a1f8bdecd45975b23e979755b1237f09","user":{"login":"abadger","id":209242,"avatar_url":"https://avatars1.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"body":"I believe selinux uses native strings (byte strings in python2 and text strings in python3) rather than always using byte strings.  So that's why we weren't using to_bytes here earlier.  We may need to move the to_native call earlier, though.  I'm not sure if it was all selinux functions or only some of them which had bugs if the wrong type of string was passed to them.","created_at":"2017-03-02T16:45:27Z","updated_at":"2017-03-02T16:45:27Z","html_url":"https://github.com/ansible/ansible/pull/21874#discussion_r103970930","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/21874","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/103970930"},"html":{"href":"https://github.com/ansible/ansible/pull/21874#discussion_r103970930"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/21874"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/21874","id":107742079,"html_url":"https://github.com/ansible/ansible/pull/21874","diff_url":"https://github.com/ansible/ansible/pull/21874.diff","patch_url":"https://github.com/ansible/ansible/pull/21874.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/21874","number":21874,"state":"open","locked":false,"title":"Ensure that filenames from archives are not expanded","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars3.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/module/task -->\r\nunarchive\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\nv2.3\r\n\r\n##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\n\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\nThis fixes #21795","created_at":"2017-02-24T00:14:05Z","updated_at":"2017-03-02T16:45:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc6bb0fd1d53cdcbb19a2e6c3c2a2f8b1d55ad2d","assignee":{"login":"abadger","id":209242,"avatar_url":"https://avatars1.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"assignees":[{"login":"abadger","id":209242,"avatar_url":"https://avatars1.githubusercontent.com/u/209242?v=3","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/21874/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/21874/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/21874/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/3cf69b05a1f8bdecd45975b23e979755b1237f09","head":{"label":"dagwieers:unarchive-noexpand","ref":"unarchive-noexpand","sha":"3cf69b05a1f8bdecd45975b23e979755b1237f09","user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars3.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"repo":{"id":3764960,"name":"ansible","full_name":"dagwieers/ansible","owner":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars3.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dagwieers/ansible","description":"Model-driven configuration management, multi-node deployment, and remote task execution system. Uses SSH by default, so there is no special software has to be installed on the nodes you manage. Ansible can be extended in any language. Note: The default branch is the development branch, if you need a stable version, see the release-XX branches, tags, or downloads.","fork":true,"url":"https://api.github.com/repos/dagwieers/ansible","forks_url":"https://api.github.com/repos/dagwieers/ansible/forks","keys_url":"https://api.github.com/repos/dagwieers/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dagwieers/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dagwieers/ansible/teams","hooks_url":"https://api.github.com/repos/dagwieers/ansible/hooks","issue_events_url":"https://api.github.com/repos/dagwieers/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/dagwieers/ansible/events","assignees_url":"https://api.github.com/repos/dagwieers/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/dagwieers/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/dagwieers/ansible/tags","blobs_url":"https://api.github.com/repos/dagwieers/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dagwieers/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dagwieers/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/dagwieers/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dagwieers/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/dagwieers/ansible/languages","stargazers_url":"https://api.github.com/repos/dagwieers/ansible/stargazers","contributors_url":"https://api.github.com/repos/dagwieers/ansible/contributors","subscribers_url":"https://api.github.com/repos/dagwieers/ansible/subscribers","subscription_url":"https://api.github.com/repos/dagwieers/ansible/subscription","commits_url":"https://api.github.com/repos/dagwieers/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/dagwieers/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/dagwieers/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/dagwieers/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/dagwieers/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/dagwieers/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dagwieers/ansible/merges","archive_url":"https://api.github.com/repos/dagwieers/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dagwieers/ansible/downloads","issues_url":"https://api.github.com/repos/dagwieers/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/dagwieers/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/dagwieers/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/dagwieers/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dagwieers/ansible/labels{/name}","releases_url":"https://api.github.com/repos/dagwieers/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/dagwieers/ansible/deployments","created_at":"2012-03-19T15:04:07Z","updated_at":"2016-12-12T13:59:41Z","pushed_at":"2017-03-02T16:37:51Z","git_url":"git://github.com/dagwieers/ansible.git","ssh_url":"git@github.com:dagwieers/ansible.git","clone_url":"https://github.com/dagwieers/ansible.git","svn_url":"https://github.com/dagwieers/ansible","homepage":"http://ansible.cc","size":58631,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"ebc2716be707789ed4a783be6bbfd0bc1b90fd9b","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars1.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars1.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2017-03-02T16:44:11Z","pushed_at":"2017-03-02T16:42:55Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":68546,"stargazers_count":21696,"watchers_count":21696,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6980,"mirror_url":null,"open_issues_count":2507,"forks":6980,"open_issues":2507,"watchers":21696,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/21874"},"html":{"href":"https://github.com/ansible/ansible/pull/21874"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/21874"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/21874/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/21874/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/21874/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/3cf69b05a1f8bdecd45975b23e979755b1237f09"}}}}
{"actor":{"display_login":"abadger"}}