Add `osid` to gzip module

Maybe it’s YAGNI, but I was noticing that the gzip header contains an “operating system ID” byte. Python learned to consistently set this byte to 255 when writing files (an aid to reproducibility of gzippped). However, there’s not a way to retrieve the value for a file that’s being read (this can occasionally be of interest), or to set it to a value specified in code.

I’ve worked up a branch that implements this: gzip: Add `osid` · jepler/cpython@32429fb · GitHub with a test but incomplete documentation as of now.

Thoughts? I’d be happy to create an issue & PR for this, but not if there’s no interest.

2 Likes