Support running on gz files directly
Is there an existing proposal for this?
- [X] I have searched the existing proposals
Is your feature request related to a problem?
Core dumps are often automatically archived to save disk space (in my case using the .gz) format. However, pystack does not allow running directly on these files, requiring a raw core dump. This means it introduces an extra manual step of unzipping the core dump before I can use pystack to see the stacktrace.
Describe the solution you'd like
pystack should automate this kind of core dump extraction; it could see the file ends with .gz and call gzip unarchive in a temp file, and run against the temp file. This would be a quality of life improvement.
Alternatives you considered
Keep doing the manual method...
This sounds reasonable to me. It seems reasonable to check whether a file is or isn't a gzip file (not based on its file extension but based on its contents), and if so to extract it to a temp file. Without checking the code, I'm guessing that we probably need a NamedTemporaryFile and can't get by with just a tempfile.TemporaryFile
Fixed by #171