airr-community / airr-standards

AIRR Community Data Standards
https://docs.airr-community.org
Creative Commons Attribution 4.0 International
35 stars 23 forks source link

python error when using airr.read_rearrangement with gzip file #787

Open schristley opened 1 month ago

schristley commented 1 month ago

When using airr.read_rearrangement on a gzip file, get this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/airr/io.py", line 89, in __next__
    row = next(self.dict_reader)
  File "/usr/lib/python3.8/csv.py", line 110, in __next__
    self.fieldnames
  File "/usr/lib/python3.8/csv.py", line 97, in fieldnames
    self._fieldnames = next(self.reader)
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)

it seems we don't have a python test for this.

schristley commented 1 month ago

open with 'rt' seems to work.