From 82d81b06f084d807d0ca851c5d414d7f0032c97a Mon Sep 17 00:00:00 2001 From: Richard Gildea Date: Tue, 5 Jul 2022 20:42:03 +0100 Subject: [PATCH] Open gzip files in text mode Without this we get a byte string, which subsequently fails when we call line.startswith() a few lines below. --- pdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdb.py b/pdb.py index c125a02..6d95808 100644 --- a/pdb.py +++ b/pdb.py @@ -30,7 +30,7 @@ def __init__(self, cryst1_line): def read_metadata(pdb, print_errors): if pdb.endswith('.gz'): - f = gzip.open(pdb, 'rb') + f = gzip.open(pdb, 'rt') else: f = open(pdb) meta = None