I have a directory filled with .gz text archives. To scan these archives, I use the following python code:
:§f Press [§bJ§f]
Python gives me this error:
I tried other modes, besides "rb". I really have no idea what else to try.
with gzip.open(logDir+"\\"+fileName, mode="rb") as archive: for filename in archive: print(filename.decode().strip())All used to work, however, the new system adds lines similar to this:
:§f Press [§bJ§f]
Python gives me this error:
File "C:\Users\Me\Documents\Python\ConvertLog.py", line 16, in readZIP print(filename.decode().strip()) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 49: invalid start byteAnyone know a way of dealing with strange characters that pop up? I can't just ignore the line. This happens to be one of the few lines I need to strip out and write to a condensed report.
I tried other modes, besides "rb". I really have no idea what else to try.