标签: python gzip
我有一个文件要解压缩。它存储在一个变量中。
代码:
print(bytes_db) with gzip.open(bytes_db, 'rb') as db: print(db) db.read()
结果是关闭的文件出错。完整输出:
<gzip on 0x7f2737f23250> <gzip gzip on 0x7f2737f23250 0x7f273c5e3430> ValueError: I/O operation on closed file