0

I am working on a function with Python 3 which retrieves the name of a zipped file in a compressed folder.
Fortunately I found a solution at the following link How do I list contents of a gz file without extracting it in python?
The problem is that if I compile in Python 2.7.x everything works fine, while if I compile in Python 3.9.x it falls into error on the method gzip.read32.
Error:

AttributeError: module 'gzip' has no attribute 'read32'

Could this method have been omitted or renamed in Python 3?
Thanks in advance.

Memmo
  • 298
  • 3
  • 8
  • 31
  • Here's the exact issue that led to `read32` being removed, according to the relevant commits in the source code: https://bugs.python.org/issue1159051. Might be a good starting point. – Random Davis Mar 30 '21 at 16:59
  • @user3840170 Because that returns the container file's name, not the original file name which the compressed data had. – tripleee Mar 30 '21 at 17:09
  • I added a new answer on the question you link to. Thus I think it would now make sense to close this as a duplicate (but I'm out of close votes for today). – tripleee Mar 30 '21 at 17:09

0 Answers0