{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments/67842518","id":67842518,"diff_hunk":"@@ -164,26 +164,30 @@ def extract(self, path='.'):\n         \"\"\"\n         self._engine.extractall(path)\n         if self.is_zip:\n-            self._update_symlinks(path)\n+            self._update_zip_extra_attrs(path)\n \n-    def _update_symlinks(self, dst_dir='.'):\n+    def _update_zip_extra_attrs(self, dst_dir):\n         if platform.system() != \"Linux\":\n-            LOG.warn(\"Symlink handling in zip files not supported on Windows.\")\n+            LOG.warn(\"Attr handling in zip files not supported on Windows.\")\n             return\n         # Walk all files and re-create files as symlinks\n         for path, info in self._engine.NameToInfo.iteritems():\n+            dst = os.path.join(dst_dir, path)\n+            if not os.path.exists(dst):\n+                msg = (\"Paths in this zip file are stored in unsupported \"\n+                       \"format, not updating the attributes. (%s)\"\n+                       % path)\n+                LOG.warn(msg)\n+                return\n             if info.external_attr & 2684354560 == 2684354560:\n                 dst = os.path.join(dst_dir, path)\n-                try:\n-                    src = open(dst, 'r').read()\n-                except IOError as details:\n-                    msg = (\"Zip file symlink path '%s' is stored in \"\n-                           \"unsupported format, symlinks were not updated: %s\"\n-                           % (path, details))\n-                    LOG.warn(msg)\n-                    return\n+                src = open(dst, 'r').read()\n                 os.remove(dst)\n                 os.symlink(src, dst)\n+                continue    # Don't override any other attributes on links\n+            mode = info.external_attr >> 16 & 511","path":"avocado/utils/archive.py","position":null,"original_position":36,"commit_id":"e6c85ff9b82cf2ad1006af4da3857141cce0d046","original_commit_id":"e6c85ff9b82cf2ad1006af4da3857141cce0d046","user":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"body":"Actually this is the default, so I'll only documment it, OK?","created_at":"2016-06-21T10:14:13Z","updated_at":"2016-06-21T10:14:13Z","html_url":"https://github.com/avocado-framework/avocado/pull/1256#discussion_r67842518","pull_request_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments/67842518"},"html":{"href":"https://github.com/avocado-framework/avocado/pull/1256#discussion_r67842518"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256"}}},"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256","id":73320559,"html_url":"https://github.com/avocado-framework/avocado/pull/1256","diff_url":"https://github.com/avocado-framework/avocado/pull/1256.diff","patch_url":"https://github.com/avocado-framework/avocado/pull/1256.patch","issue_url":"https://api.github.com/repos/avocado-framework/avocado/issues/1256","number":1256,"state":"open","locked":false,"title":"avocado.utils.archive: Keep extenended_attributes of files in zip [v2]","user":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"body":"This extends the https://github.com/avocado-framework/avocado/pull/1255 and together this fixes the lack of support for symlinks and file-permissions in zip files, which in some cases is really essential. Similarily as 1255 this walks all extracted files, in case the file should be a symlink it replaces it with an actual symlink, otherwise it checks file permissions. If they don't match (or are not specified) it updates them.\r\n\r\nv1: https://github.com/avocado-framework/avocado/pull/1255\r\nRequired for: https://github.com/avocado-framework/avocado-misc-tests/pull/52\r\nTrello: https://trello.com/c/O1aEROTg/723-bug-python-s-zipfile-does-not-handle-symlinks-properly\r\n\r\nChanges\r\n```yaml\r\nv2: Fixed the early bail out in symlinks commit\r\nv2: Added new commit to also handle file permissions\r\n```","created_at":"2016-06-10T04:33:22Z","updated_at":"2016-06-21T10:14:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7454c8471e81d93b4b676fb94290a89342df62e8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256/commits","review_comments_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256/comments","review_comment_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avocado-framework/avocado/issues/1256/comments","statuses_url":"https://api.github.com/repos/avocado-framework/avocado/statuses/e6c85ff9b82cf2ad1006af4da3857141cce0d046","head":{"label":"ldoktor:zip-symlinks2","ref":"zip-symlinks2","sha":"e6c85ff9b82cf2ad1006af4da3857141cce0d046","user":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"repo":{"id":26808700,"name":"avocado","full_name":"ldoktor/avocado","owner":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ldoktor/avocado","description":"Avocado Test Framework","fork":true,"url":"https://api.github.com/repos/ldoktor/avocado","forks_url":"https://api.github.com/repos/ldoktor/avocado/forks","keys_url":"https://api.github.com/repos/ldoktor/avocado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ldoktor/avocado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ldoktor/avocado/teams","hooks_url":"https://api.github.com/repos/ldoktor/avocado/hooks","issue_events_url":"https://api.github.com/repos/ldoktor/avocado/issues/events{/number}","events_url":"https://api.github.com/repos/ldoktor/avocado/events","assignees_url":"https://api.github.com/repos/ldoktor/avocado/assignees{/user}","branches_url":"https://api.github.com/repos/ldoktor/avocado/branches{/branch}","tags_url":"https://api.github.com/repos/ldoktor/avocado/tags","blobs_url":"https://api.github.com/repos/ldoktor/avocado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ldoktor/avocado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ldoktor/avocado/git/refs{/sha}","trees_url":"https://api.github.com/repos/ldoktor/avocado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ldoktor/avocado/statuses/{sha}","languages_url":"https://api.github.com/repos/ldoktor/avocado/languages","stargazers_url":"https://api.github.com/repos/ldoktor/avocado/stargazers","contributors_url":"https://api.github.com/repos/ldoktor/avocado/contributors","subscribers_url":"https://api.github.com/repos/ldoktor/avocado/subscribers","subscription_url":"https://api.github.com/repos/ldoktor/avocado/subscription","commits_url":"https://api.github.com/repos/ldoktor/avocado/commits{/sha}","git_commits_url":"https://api.github.com/repos/ldoktor/avocado/git/commits{/sha}","comments_url":"https://api.github.com/repos/ldoktor/avocado/comments{/number}","issue_comment_url":"https://api.github.com/repos/ldoktor/avocado/issues/comments{/number}","contents_url":"https://api.github.com/repos/ldoktor/avocado/contents/{+path}","compare_url":"https://api.github.com/repos/ldoktor/avocado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ldoktor/avocado/merges","archive_url":"https://api.github.com/repos/ldoktor/avocado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ldoktor/avocado/downloads","issues_url":"https://api.github.com/repos/ldoktor/avocado/issues{/number}","pulls_url":"https://api.github.com/repos/ldoktor/avocado/pulls{/number}","milestones_url":"https://api.github.com/repos/ldoktor/avocado/milestones{/number}","notifications_url":"https://api.github.com/repos/ldoktor/avocado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ldoktor/avocado/labels{/name}","releases_url":"https://api.github.com/repos/ldoktor/avocado/releases{/id}","deployments_url":"https://api.github.com/repos/ldoktor/avocado/deployments","created_at":"2014-11-18T12:42:43Z","updated_at":"2014-11-18T12:42:43Z","pushed_at":"2016-06-21T10:13:42Z","git_url":"git://github.com/ldoktor/avocado.git","ssh_url":"git@github.com:ldoktor/avocado.git","clone_url":"https://github.com/ldoktor/avocado.git","svn_url":"https://github.com/ldoktor/avocado","homepage":"http://avocado-framework.readthedocs.org/en/latest/","size":9197,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"avocado-framework:master","ref":"master","sha":"c6eb8919bbc29c2cdeba94698807eba6903157f0","user":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":17449498,"name":"avocado","full_name":"avocado-framework/avocado","owner":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avocado-framework/avocado","description":"Avocado Test Framework","fork":false,"url":"https://api.github.com/repos/avocado-framework/avocado","forks_url":"https://api.github.com/repos/avocado-framework/avocado/forks","keys_url":"https://api.github.com/repos/avocado-framework/avocado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avocado-framework/avocado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avocado-framework/avocado/teams","hooks_url":"https://api.github.com/repos/avocado-framework/avocado/hooks","issue_events_url":"https://api.github.com/repos/avocado-framework/avocado/issues/events{/number}","events_url":"https://api.github.com/repos/avocado-framework/avocado/events","assignees_url":"https://api.github.com/repos/avocado-framework/avocado/assignees{/user}","branches_url":"https://api.github.com/repos/avocado-framework/avocado/branches{/branch}","tags_url":"https://api.github.com/repos/avocado-framework/avocado/tags","blobs_url":"https://api.github.com/repos/avocado-framework/avocado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avocado-framework/avocado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avocado-framework/avocado/git/refs{/sha}","trees_url":"https://api.github.com/repos/avocado-framework/avocado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avocado-framework/avocado/statuses/{sha}","languages_url":"https://api.github.com/repos/avocado-framework/avocado/languages","stargazers_url":"https://api.github.com/repos/avocado-framework/avocado/stargazers","contributors_url":"https://api.github.com/repos/avocado-framework/avocado/contributors","subscribers_url":"https://api.github.com/repos/avocado-framework/avocado/subscribers","subscription_url":"https://api.github.com/repos/avocado-framework/avocado/subscription","commits_url":"https://api.github.com/repos/avocado-framework/avocado/commits{/sha}","git_commits_url":"https://api.github.com/repos/avocado-framework/avocado/git/commits{/sha}","comments_url":"https://api.github.com/repos/avocado-framework/avocado/comments{/number}","issue_comment_url":"https://api.github.com/repos/avocado-framework/avocado/issues/comments{/number}","contents_url":"https://api.github.com/repos/avocado-framework/avocado/contents/{+path}","compare_url":"https://api.github.com/repos/avocado-framework/avocado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avocado-framework/avocado/merges","archive_url":"https://api.github.com/repos/avocado-framework/avocado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avocado-framework/avocado/downloads","issues_url":"https://api.github.com/repos/avocado-framework/avocado/issues{/number}","pulls_url":"https://api.github.com/repos/avocado-framework/avocado/pulls{/number}","milestones_url":"https://api.github.com/repos/avocado-framework/avocado/milestones{/number}","notifications_url":"https://api.github.com/repos/avocado-framework/avocado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avocado-framework/avocado/labels{/name}","releases_url":"https://api.github.com/repos/avocado-framework/avocado/releases{/id}","deployments_url":"https://api.github.com/repos/avocado-framework/avocado/deployments","created_at":"2014-03-05T17:52:27Z","updated_at":"2016-06-18T00:27:46Z","pushed_at":"2016-06-21T09:07:29Z","git_url":"git://github.com/avocado-framework/avocado.git","ssh_url":"git@github.com:avocado-framework/avocado.git","clone_url":"https://github.com/avocado-framework/avocado.git","svn_url":"https://github.com/avocado-framework/avocado","homepage":"http://avocado-framework.github.io/","size":13858,"stargazers_count":42,"watchers_count":42,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":16,"forks":59,"open_issues":16,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256"},"html":{"href":"https://github.com/avocado-framework/avocado/pull/1256"},"issue":{"href":"https://api.github.com/repos/avocado-framework/avocado/issues/1256"},"comments":{"href":"https://api.github.com/repos/avocado-framework/avocado/issues/1256/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256/comments"},"review_comment":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/1256/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework/avocado/statuses/e6c85ff9b82cf2ad1006af4da3857141cce0d046"}}}}
{"actor":{"display_login":"ldoktor"}}