jamescasbon/PyVCF — pull request #34 by arq5x (2012-03-29 20:50:08+00:00)
Title: Handle String INFO values when Number=1 in header

Hi,

This patch fixes a bug that prevented full String values from being returned when the INFO tag is defined as String and Number = 1. This offending block of code in `_parse_info` is:

try:
if self.infos[ID].num == 1:
val = val[0]

which is intended to set `val` to the first element in a list if the Number=1 in the header. However, Strings values must be handled separately, otherwise only the first character of the string is handled.

try:
if self.infos[ID].num == 1 and entry_type != 'String':
val = val[0]