File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 5656class PRVTrace (Trace ):
5757 def _gather_metadata (self ):
5858
59- with zipopen (self ._tracefile , "r " ) as fh :
60- headerline = fh .readline ().decode (). strip ()
59+ with zipopen (self ._tracefile , "rt " ) as fh :
60+ headerline = fh .readline ().strip ()
6161
6262 elem = headerline .replace (":" , ";" , 1 ).split (":" , 4 )
6363
Original file line number Diff line number Diff line change 1414
1515
1616def zipopen (path , mode = "rt" ):
17+
18+ # Default modes of open() and gzip.open() are not the same ('t' and 'b' respectively)
19+ # so ensure a consistent default of text mode
20+ if not any (x in mode for x in ('t' , 'b' )):
21+ mode = "{}t" .format (mode )
22+
1723 try :
1824 if gzip .open (path , mode = mode ).readline ():
1925 return gzip .open (path , mode = mode )
You can’t perform that action at this time.
0 commit comments