{"action":"created","comment":{"url":"https://api.github.com/repos/secdev/scapy/pulls/comments/130037702","pull_request_review_id":52870261,"id":130037702,"diff_hunk":"@@ -173,7 +176,7 @@ def getfield(self, pkt, s):\n \n     def addfield(self, pkt, s, val):\n         sval = self._fld.addfield(pkt, \"\", val)\n-        return s+sval+struct.pack(\"%is\" % (self.padlen(len(sval))), self._padwith)\n+        return raw(s)+sval+struct.pack(\"%is\" % (self.padlen(len(sval))), raw(self._padwith))","path":"scapy/fields.py","position":22,"original_position":22,"commit_id":"3bd07fe7b83f271040a520d0352ccbb6a57a8fa8","original_commit_id":"3bd07fe7b83f271040a520d0352ccbb6a57a8fa8","user":{"login":"p-l-","id":5064814,"avatar_url":"https://avatars3.githubusercontent.com/u/5064814?v=4","gravatar_id":"","url":"https://api.github.com/users/p-l-","html_url":"https://github.com/p-l-","followers_url":"https://api.github.com/users/p-l-/followers","following_url":"https://api.github.com/users/p-l-/following{/other_user}","gists_url":"https://api.github.com/users/p-l-/gists{/gist_id}","starred_url":"https://api.github.com/users/p-l-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p-l-/subscriptions","organizations_url":"https://api.github.com/users/p-l-/orgs","repos_url":"https://api.github.com/users/p-l-/repos","events_url":"https://api.github.com/users/p-l-/events{/privacy}","received_events_url":"https://api.github.com/users/p-l-/received_events","type":"User","site_admin":false},"body":"Are the `raw()` calls needed here? Be careful to call these functions only when necessary, the impact on performances could be important.","created_at":"2017-07-28T08:25:20Z","updated_at":"2017-07-28T08:45:08Z","html_url":"https://github.com/secdev/scapy/pull/674#discussion_r130037702","pull_request_url":"https://api.github.com/repos/secdev/scapy/pulls/674","_links":{"self":{"href":"https://api.github.com/repos/secdev/scapy/pulls/comments/130037702"},"html":{"href":"https://github.com/secdev/scapy/pull/674#discussion_r130037702"},"pull_request":{"href":"https://api.github.com/repos/secdev/scapy/pulls/674"}}},"pull_request":{"url":"https://api.github.com/repos/secdev/scapy/pulls/674","id":123888079,"html_url":"https://github.com/secdev/scapy/pull/674","diff_url":"https://github.com/secdev/scapy/pull/674.diff","patch_url":"https://github.com/secdev/scapy/pull/674.patch","issue_url":"https://api.github.com/repos/secdev/scapy/issues/674","number":674,"state":"open","locked":false,"title":"[Python 2 to 3] Strings to bytes","user":{"login":"gpotter2","id":10530980,"avatar_url":"https://avatars0.githubusercontent.com/u/10530980?v=4","gravatar_id":"","url":"https://api.github.com/users/gpotter2","html_url":"https://github.com/gpotter2","followers_url":"https://api.github.com/users/gpotter2/followers","following_url":"https://api.github.com/users/gpotter2/following{/other_user}","gists_url":"https://api.github.com/users/gpotter2/gists{/gist_id}","starred_url":"https://api.github.com/users/gpotter2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpotter2/subscriptions","organizations_url":"https://api.github.com/users/gpotter2/orgs","repos_url":"https://api.github.com/users/gpotter2/repos","events_url":"https://api.github.com/users/gpotter2/events{/privacy}","received_events_url":"https://api.github.com/users/gpotter2/received_events","type":"User","site_admin":false},"body":"Here's the most boring part of it. That should bring neally all bytes support for the `core`. Contribution files will be changed later.\r\n\r\nThis PR:\r\n\r\n- introduces some util functions in scapy.compat.py that works on both python 2 and 3:\r\n-- raw(x) : returns the byte form of a string/packet/int/list of ints\r\n-- plain_str(x) : does exactly the opposite: bytes/int ==> str\r\n-- ord(x) : works like orb(x) on python 2, and returns x on python 3\r\n-- hex_bytes / bytes_hex ==> converts hex => bytes or bytes => hex\r\n- Adds tons (like a lot) of required b\"\".\r\n- Remove stupid BGP bug in a test: None ==> \"None\" ==> \"\\x04\". Fixed by using `raw`","created_at":"2017-06-04T18:55:55Z","updated_at":"2017-07-28T08:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a03ea7d94ac3fc17fcbb0da9ee928dd9c8c62e85","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/secdev/scapy/pulls/674/commits","review_comments_url":"https://api.github.com/repos/secdev/scapy/pulls/674/comments","review_comment_url":"https://api.github.com/repos/secdev/scapy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/secdev/scapy/issues/674/comments","statuses_url":"https://api.github.com/repos/secdev/scapy/statuses/3bd07fe7b83f271040a520d0352ccbb6a57a8fa8","head":{"label":"gpotter2:fix-str-bytes","ref":"fix-str-bytes","sha":"3bd07fe7b83f271040a520d0352ccbb6a57a8fa8","user":{"login":"gpotter2","id":10530980,"avatar_url":"https://avatars0.githubusercontent.com/u/10530980?v=4","gravatar_id":"","url":"https://api.github.com/users/gpotter2","html_url":"https://github.com/gpotter2","followers_url":"https://api.github.com/users/gpotter2/followers","following_url":"https://api.github.com/users/gpotter2/following{/other_user}","gists_url":"https://api.github.com/users/gpotter2/gists{/gist_id}","starred_url":"https://api.github.com/users/gpotter2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpotter2/subscriptions","organizations_url":"https://api.github.com/users/gpotter2/orgs","repos_url":"https://api.github.com/users/gpotter2/repos","events_url":"https://api.github.com/users/gpotter2/events{/privacy}","received_events_url":"https://api.github.com/users/gpotter2/received_events","type":"User","site_admin":false},"repo":{"id":73421635,"name":"scapy","full_name":"gpotter2/scapy","owner":{"login":"gpotter2","id":10530980,"avatar_url":"https://avatars0.githubusercontent.com/u/10530980?v=4","gravatar_id":"","url":"https://api.github.com/users/gpotter2","html_url":"https://github.com/gpotter2","followers_url":"https://api.github.com/users/gpotter2/followers","following_url":"https://api.github.com/users/gpotter2/following{/other_user}","gists_url":"https://api.github.com/users/gpotter2/gists{/gist_id}","starred_url":"https://api.github.com/users/gpotter2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpotter2/subscriptions","organizations_url":"https://api.github.com/users/gpotter2/orgs","repos_url":"https://api.github.com/users/gpotter2/repos","events_url":"https://api.github.com/users/gpotter2/events{/privacy}","received_events_url":"https://api.github.com/users/gpotter2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gpotter2/scapy","description":"Scapy: the python-based interactive packet manipulation program & library","fork":true,"url":"https://api.github.com/repos/gpotter2/scapy","forks_url":"https://api.github.com/repos/gpotter2/scapy/forks","keys_url":"https://api.github.com/repos/gpotter2/scapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gpotter2/scapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gpotter2/scapy/teams","hooks_url":"https://api.github.com/repos/gpotter2/scapy/hooks","issue_events_url":"https://api.github.com/repos/gpotter2/scapy/issues/events{/number}","events_url":"https://api.github.com/repos/gpotter2/scapy/events","assignees_url":"https://api.github.com/repos/gpotter2/scapy/assignees{/user}","branches_url":"https://api.github.com/repos/gpotter2/scapy/branches{/branch}","tags_url":"https://api.github.com/repos/gpotter2/scapy/tags","blobs_url":"https://api.github.com/repos/gpotter2/scapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gpotter2/scapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gpotter2/scapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/gpotter2/scapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gpotter2/scapy/statuses/{sha}","languages_url":"https://api.github.com/repos/gpotter2/scapy/languages","stargazers_url":"https://api.github.com/repos/gpotter2/scapy/stargazers","contributors_url":"https://api.github.com/repos/gpotter2/scapy/contributors","subscribers_url":"https://api.github.com/repos/gpotter2/scapy/subscribers","subscription_url":"https://api.github.com/repos/gpotter2/scapy/subscription","commits_url":"https://api.github.com/repos/gpotter2/scapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/gpotter2/scapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/gpotter2/scapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/gpotter2/scapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/gpotter2/scapy/contents/{+path}","compare_url":"https://api.github.com/repos/gpotter2/scapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gpotter2/scapy/merges","archive_url":"https://api.github.com/repos/gpotter2/scapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gpotter2/scapy/downloads","issues_url":"https://api.github.com/repos/gpotter2/scapy/issues{/number}","pulls_url":"https://api.github.com/repos/gpotter2/scapy/pulls{/number}","milestones_url":"https://api.github.com/repos/gpotter2/scapy/milestones{/number}","notifications_url":"https://api.github.com/repos/gpotter2/scapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gpotter2/scapy/labels{/name}","releases_url":"https://api.github.com/repos/gpotter2/scapy/releases{/id}","deployments_url":"https://api.github.com/repos/gpotter2/scapy/deployments","created_at":"2016-11-10T21:18:19Z","updated_at":"2016-11-10T21:18:22Z","pushed_at":"2017-07-27T21:06:31Z","git_url":"git://github.com/gpotter2/scapy.git","ssh_url":"git@github.com:gpotter2/scapy.git","clone_url":"https://github.com/gpotter2/scapy.git","svn_url":"https://github.com/gpotter2/scapy","homepage":"http://www.secdev.org/projects/scapy/","size":68254,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"secdev:master","ref":"master","sha":"4ec7ef191811a61cd513adf3cf20fcb948517c05","user":{"login":"secdev","id":14927208,"avatar_url":"https://avatars0.githubusercontent.com/u/14927208?v=4","gravatar_id":"","url":"https://api.github.com/users/secdev","html_url":"https://github.com/secdev","followers_url":"https://api.github.com/users/secdev/followers","following_url":"https://api.github.com/users/secdev/following{/other_user}","gists_url":"https://api.github.com/users/secdev/gists{/gist_id}","starred_url":"https://api.github.com/users/secdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/secdev/subscriptions","organizations_url":"https://api.github.com/users/secdev/orgs","repos_url":"https://api.github.com/users/secdev/repos","events_url":"https://api.github.com/users/secdev/events{/privacy}","received_events_url":"https://api.github.com/users/secdev/received_events","type":"Organization","site_admin":false},"repo":{"id":43509302,"name":"scapy","full_name":"secdev/scapy","owner":{"login":"secdev","id":14927208,"avatar_url":"https://avatars0.githubusercontent.com/u/14927208?v=4","gravatar_id":"","url":"https://api.github.com/users/secdev","html_url":"https://github.com/secdev","followers_url":"https://api.github.com/users/secdev/followers","following_url":"https://api.github.com/users/secdev/following{/other_user}","gists_url":"https://api.github.com/users/secdev/gists{/gist_id}","starred_url":"https://api.github.com/users/secdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/secdev/subscriptions","organizations_url":"https://api.github.com/users/secdev/orgs","repos_url":"https://api.github.com/users/secdev/repos","events_url":"https://api.github.com/users/secdev/events{/privacy}","received_events_url":"https://api.github.com/users/secdev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/secdev/scapy","description":"Scapy: the python-based interactive packet manipulation program & library","fork":false,"url":"https://api.github.com/repos/secdev/scapy","forks_url":"https://api.github.com/repos/secdev/scapy/forks","keys_url":"https://api.github.com/repos/secdev/scapy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/secdev/scapy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/secdev/scapy/teams","hooks_url":"https://api.github.com/repos/secdev/scapy/hooks","issue_events_url":"https://api.github.com/repos/secdev/scapy/issues/events{/number}","events_url":"https://api.github.com/repos/secdev/scapy/events","assignees_url":"https://api.github.com/repos/secdev/scapy/assignees{/user}","branches_url":"https://api.github.com/repos/secdev/scapy/branches{/branch}","tags_url":"https://api.github.com/repos/secdev/scapy/tags","blobs_url":"https://api.github.com/repos/secdev/scapy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/secdev/scapy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/secdev/scapy/git/refs{/sha}","trees_url":"https://api.github.com/repos/secdev/scapy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/secdev/scapy/statuses/{sha}","languages_url":"https://api.github.com/repos/secdev/scapy/languages","stargazers_url":"https://api.github.com/repos/secdev/scapy/stargazers","contributors_url":"https://api.github.com/repos/secdev/scapy/contributors","subscribers_url":"https://api.github.com/repos/secdev/scapy/subscribers","subscription_url":"https://api.github.com/repos/secdev/scapy/subscription","commits_url":"https://api.github.com/repos/secdev/scapy/commits{/sha}","git_commits_url":"https://api.github.com/repos/secdev/scapy/git/commits{/sha}","comments_url":"https://api.github.com/repos/secdev/scapy/comments{/number}","issue_comment_url":"https://api.github.com/repos/secdev/scapy/issues/comments{/number}","contents_url":"https://api.github.com/repos/secdev/scapy/contents/{+path}","compare_url":"https://api.github.com/repos/secdev/scapy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/secdev/scapy/merges","archive_url":"https://api.github.com/repos/secdev/scapy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/secdev/scapy/downloads","issues_url":"https://api.github.com/repos/secdev/scapy/issues{/number}","pulls_url":"https://api.github.com/repos/secdev/scapy/pulls{/number}","milestones_url":"https://api.github.com/repos/secdev/scapy/milestones{/number}","notifications_url":"https://api.github.com/repos/secdev/scapy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/secdev/scapy/labels{/name}","releases_url":"https://api.github.com/repos/secdev/scapy/releases{/id}","deployments_url":"https://api.github.com/repos/secdev/scapy/deployments","created_at":"2015-10-01T17:06:46Z","updated_at":"2017-07-27T22:48:43Z","pushed_at":"2017-07-27T21:06:33Z","git_url":"git://github.com/secdev/scapy.git","ssh_url":"git@github.com:secdev/scapy.git","clone_url":"https://github.com/secdev/scapy.git","svn_url":"https://github.com/secdev/scapy","homepage":"http://www.secdev.org/projects/scapy/","size":65991,"stargazers_count":1312,"watchers_count":1312,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":63,"forks":340,"open_issues":63,"watchers":1312,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/secdev/scapy/pulls/674"},"html":{"href":"https://github.com/secdev/scapy/pull/674"},"issue":{"href":"https://api.github.com/repos/secdev/scapy/issues/674"},"comments":{"href":"https://api.github.com/repos/secdev/scapy/issues/674/comments"},"review_comments":{"href":"https://api.github.com/repos/secdev/scapy/pulls/674/comments"},"review_comment":{"href":"https://api.github.com/repos/secdev/scapy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/secdev/scapy/pulls/674/commits"},"statuses":{"href":"https://api.github.com/repos/secdev/scapy/statuses/3bd07fe7b83f271040a520d0352ccbb6a57a8fa8"}}}}
{"actor":{"display_login":"p-l-"}}