{"action":"closed","issue":{"url":"https://api.github.com/repos/jamescasbon/PyVCF/issues/217","labels_url":"https://api.github.com/repos/jamescasbon/PyVCF/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/jamescasbon/PyVCF/issues/217/comments","events_url":"https://api.github.com/repos/jamescasbon/PyVCF/issues/217/events","html_url":"https://github.com/jamescasbon/PyVCF/issues/217","id":118936935,"number":217,"title":"UnicodeDecodeError using tabix indexed vcf","user":{"login":"krlk89","id":9166242,"avatar_url":"https://avatars.githubusercontent.com/u/9166242?v=3","gravatar_id":"","url":"https://api.github.com/users/krlk89","html_url":"https://github.com/krlk89","followers_url":"https://api.github.com/users/krlk89/followers","following_url":"https://api.github.com/users/krlk89/following{/other_user}","gists_url":"https://api.github.com/users/krlk89/gists{/gist_id}","starred_url":"https://api.github.com/users/krlk89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlk89/subscriptions","organizations_url":"https://api.github.com/users/krlk89/orgs","repos_url":"https://api.github.com/users/krlk89/repos","events_url":"https://api.github.com/users/krlk89/events{/privacy}","received_events_url":"https://api.github.com/users/krlk89/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-25T22:46:36Z","updated_at":"2015-11-28T13:38:53Z","closed_at":"2015-11-28T13:38:53Z","body":"I compressed my vcf file with bgzip and indexed it with tabix. Trying to iterate over a specific chromosome gives me the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"vcf_test.py\", line 39, in <module>\r\n    mask_seq()\r\n  File \"vcf_test.py\", line 11, in mask_seq\r\n    vcf = vcf.Reader(open(argv[1]))\r\n  File \"/home/krlk89/.local/lib/python3.4/site-packages/PyVCF-0.6.7-py3.4.egg/vcf/parser.py\", line 288, in __init__\r\n    self._parse_metainfo()\r\n  File \"/home/krlk89/.local/lib/python3.4/site-packages/PyVCF-0.6.7-py3.4.egg/vcf/parser.py\", line 304, in _parse_metainfo\r\n    line = next(self.reader)\r\n  File \"/home/krlk89/.local/lib/python3.4/site-packages/PyVCF-0.6.7-py3.4.egg/vcf/parser.py\", line 268, in <genexpr>\r\n    self.reader = (line.strip() for line in self._reader if line.strip())\r\n  File \"/home/krlk89/.local/lib/python3.4/codecs.py\", line 638, in __next__\r\n    line = self.readline()\r\n  File \"/home/krlk89/.local/lib/python3.4/codecs.py\", line 551, in readline\r\n    data = self.read(readsize, firstline=True)\r\n  File \"/home/krlk89/.local/lib/python3.4/codecs.py\", line 491, in read\r\n    newdata = self.stream.read(size)\r\n  File \"/home/krlk89/.local/lib/python3.4/gzip.py\", line 365, in read\r\n    if not self._read(readsize):\r\n  File \"/home/krlk89/.local/lib/python3.4/gzip.py\", line 433, in _read\r\n    if not self._read_gzip_header():\r\n  File \"/home/krlk89/.local/lib/python3.4/gzip.py\", line 292, in _read_gzip_header\r\n    magic = self.fileobj.read(2)\r\n  File \"/home/krlk89/.local/lib/python3.4/gzip.py\", line 90, in read\r\n    self.file.read(size-self._length+read)\r\n  File \"/home/krlk89/.local/lib/python3.4/codecs.py\", line 319, in decode\r\n    (result, consumed) = self._buffer_decode(data, self.errors, final)\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte\r\n```\r\nMy code sample looks like this:\r\n```\r\nfor record in vcf.fetch(\"1\"):\r\n    print(record)\r\n```"}}