{"action":"created","issue":{"url":"https://api.github.com/repos/EclecticIQ/cabby/issues/37","repository_url":"https://api.github.com/repos/EclecticIQ/cabby","labels_url":"https://api.github.com/repos/EclecticIQ/cabby/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/EclecticIQ/cabby/issues/37/comments","events_url":"https://api.github.com/repos/EclecticIQ/cabby/issues/37/events","html_url":"https://github.com/EclecticIQ/cabby/issues/37","id":189428056,"number":37,"title":"Exception raised when trying to process gzipped data","user":{"login":"harleyh","id":19494392,"avatar_url":"https://avatars.githubusercontent.com/u/19494392?v=3","gravatar_id":"","url":"https://api.github.com/users/harleyh","html_url":"https://github.com/harleyh","followers_url":"https://api.github.com/users/harleyh/followers","following_url":"https://api.github.com/users/harleyh/following{/other_user}","gists_url":"https://api.github.com/users/harleyh/gists{/gist_id}","starred_url":"https://api.github.com/users/harleyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harleyh/subscriptions","organizations_url":"https://api.github.com/users/harleyh/orgs","repos_url":"https://api.github.com/users/harleyh/repos","events_url":"https://api.github.com/users/harleyh/events{/privacy}","received_events_url":"https://api.github.com/users/harleyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-15T15:49:04Z","updated_at":"2016-11-15T16:06:02Z","closed_at":null,"body":"Hello,\r\nI'm receiving gzip compressed data from a TAXII server. When cabby tries to process the data the following exception is raised:\r\n\r\n> Traceback (most recent call last):\r\n  File \"test.py\", line 14, in <module>\r\n    discovery = ais_client.discover_services()\r\n  File \"/home/harley/Workspace/github/cabby/cabby/abstract.py\", line 304, in discover_services\r\n    response = self._discovery_request(uri)\r\n  File \"/home/harley/Workspace/github/cabby/cabby/client11.py\", line 29, in _discovery_request\r\n    response = self._execute_request(request, uri=uri)\r\n  File \"/home/harley/Workspace/github/cabby/cabby/abstract.py\", line 202, in _execute_request\r\n    taxii_binding=self.taxii_binding)\r\n  File \"/home/harley/Workspace/github/cabby/cabby/dispatcher.py\", line 81, in send_taxii_request\r\n    obj = next(gen)\r\n  File \"/home/harley/Workspace/github/cabby/cabby/dispatcher.py\", line 170, in _parse_response\r\n    action, root = next(gen)\r\n  File \"src/lxml/iterparse.pxi\", line 208, in lxml.etree.iterparse.__next__ (src/lxml/lxml.etree.c:144543)\r\nio.UnsupportedOperation: seek\r\n\r\nI'm not sure exactly what the issue is but I was able to get around this by using StringIO with  response.content in dispatcher.py instead of attempting to manually decompress the raw content. "},"comment":{"url":"https://api.github.com/repos/EclecticIQ/cabby/issues/comments/260683455","html_url":"https://github.com/EclecticIQ/cabby/issues/37#issuecomment-260683455","issue_url":"https://api.github.com/repos/EclecticIQ/cabby/issues/37","id":260683455,"user":{"login":"traut","id":45051,"avatar_url":"https://avatars.githubusercontent.com/u/45051?v=3","gravatar_id":"","url":"https://api.github.com/users/traut","html_url":"https://github.com/traut","followers_url":"https://api.github.com/users/traut/followers","following_url":"https://api.github.com/users/traut/following{/other_user}","gists_url":"https://api.github.com/users/traut/gists{/gist_id}","starred_url":"https://api.github.com/users/traut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traut/subscriptions","organizations_url":"https://api.github.com/users/traut/orgs","repos_url":"https://api.github.com/users/traut/repos","events_url":"https://api.github.com/users/traut/events{/privacy}","received_events_url":"https://api.github.com/users/traut/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T16:06:02Z","updated_at":"2016-11-15T16:06:02Z","body":"@harleyh hm, I haven't seen this issue before - we tested Cabby with gzipped responses and it worked fine. I'll investigate.\r\n\r\nusing `response.content` in dispatcher helps because `requests` lib takes care of decompression. The drawback here is that this change makes useless stream parsing and leads to higher memory consumption."}}
{"actor":{"display_login":"traut"}}