{"action":"created","issue":{"url":"https://api.github.com/repos/02strich/pyrpm/issues/6","labels_url":"https://api.github.com/repos/02strich/pyrpm/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/02strich/pyrpm/issues/6/comments","events_url":"https://api.github.com/repos/02strich/pyrpm/issues/6/events","html_url":"https://github.com/02strich/pyrpm/pull/6","id":109417021,"number":6,"title":"Providesbug","user":{"login":"krasmussen","id":3866446,"avatar_url":"https://avatars.githubusercontent.com/u/3866446?v=3","gravatar_id":"","url":"https://api.github.com/users/krasmussen","html_url":"https://github.com/krasmussen","followers_url":"https://api.github.com/users/krasmussen/followers","following_url":"https://api.github.com/users/krasmussen/following{/other_user}","gists_url":"https://api.github.com/users/krasmussen/gists{/gist_id}","starred_url":"https://api.github.com/users/krasmussen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasmussen/subscriptions","organizations_url":"https://api.github.com/users/krasmussen/orgs","repos_url":"https://api.github.com/users/krasmussen/repos","events_url":"https://api.github.com/users/krasmussen/events{/privacy}","received_events_url":"https://api.github.com/users/krasmussen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-02T01:50:19Z","updated_at":"2015-10-06T02:01:59Z","closed_at":"2015-10-06T02:01:42Z","pull_request":{"url":"https://api.github.com/repos/02strich/pyrpm/pulls/6","html_url":"https://github.com/02strich/pyrpm/pull/6","diff_url":"https://github.com/02strich/pyrpm/pull/6.diff","patch_url":"https://github.com/02strich/pyrpm/pull/6.patch"},"body":"Pull request to fix a bug where rpm provides get missed due to python reducing a tuple to a int when only one value is in header 1112\r\n\r\nSteps to duplicate:\r\n\r\n>>> from pyrpm.rpm import RPM\r\n>>> myrpm = RPM(open('GeoIP-GeoLite-data-extra-2015.04-2.el6.noarch.rpm','rb'))\r\n>>> myrpm.provides\r\n[]\r\n>>> zip(myrpm.header[1047], myrpm.header[1112], myrpm.header[1113])\r\nTraceback (most recent call last):\r\nFile \"<stdin>\", line 1, in <module>\r\nTypeError: zip argument #2 must support iteration\r\n\r\nIf I force the 2nd arg to the zip to be a list it actually zips correctly. Looks like header element 1112 was not itteratable when it was expected to be:\r\n\r\n>>> zip(myrpm.header[1047], [myrpm.header[1112]], myrpm.header[1113])\r\n[(u'GeoIP-GeoLite-data-extra', 8, u'2015.04-2.el6')]\r\n\r\nNOTE: I tested with a list but the PR is using a tuple, they should both work the same in this case as we just needed __iter__\r\n\r\nNOTE: The GeoIP-GeoLite-data-extra-2015.04-2.el6.noarch.rpm rpm I'm using to test this with can be found here: https://dl.fedoraproject.org/pub/epel/6/x86_64/GeoIP-GeoLite-data-extra-2015.04-2.el6.noarch.rpm\r\n\r\nNote: There may be a better way to handle this but I'm unsure if this will ever happen outside of the provides section as I'm not overly failure with RPMs at that level. Perhaps this could be better fixed within the Entry or HeaderBase class?\r\n\r\nAlso sorry for the extraneous commits in this PR I only came across this bug after submitting https://github.com/02strich/pyrpm/pull/5 and I apparently suck at using git properly."},"comment":{"url":"https://api.github.com/repos/02strich/pyrpm/issues/comments/145721973","html_url":"https://github.com/02strich/pyrpm/pull/6#issuecomment-145721973","issue_url":"https://api.github.com/repos/02strich/pyrpm/issues/6","id":145721973,"user":{"login":"02strich","id":44383,"avatar_url":"https://avatars.githubusercontent.com/u/44383?v=3","gravatar_id":"","url":"https://api.github.com/users/02strich","html_url":"https://github.com/02strich","followers_url":"https://api.github.com/users/02strich/followers","following_url":"https://api.github.com/users/02strich/following{/other_user}","gists_url":"https://api.github.com/users/02strich/gists{/gist_id}","starred_url":"https://api.github.com/users/02strich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/02strich/subscriptions","organizations_url":"https://api.github.com/users/02strich/orgs","repos_url":"https://api.github.com/users/02strich/repos","events_url":"https://api.github.com/users/02strich/events{/privacy}","received_events_url":"https://api.github.com/users/02strich/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T02:01:59Z","updated_at":"2015-10-06T02:01:59Z","body":"Thanks, that makes sense and the fix should be good as long as that keeps the only place"}}