[issue27525] Wrong OS header on file created by gzip module

Serhiy Storchaka report at bugs.python.org
Sun Jul 17 01:32:54 EDT 2016


Serhiy Storchaka added the comment:

This byte identifies the type of file system. How can you determine it? Note that different filesystems can be used on the same OS. FAT still widely used on Windows (and what about exFAT, should it be considered as a flavour of FAT or separate type?), virtually any file system can be mounted on Linux.

See 2.3.1.2 in RFC 1952:

         A compliant compressor must produce files with correct ID1,
         ID2, CM, CRC32, and ISIZE, but may set all the other fields in
         the fixed-length part of the header to default values (255 for
         OS, 0 for all others).

         [...] a decompressor may ignore FTEXT and OS
         and always produce binary output, and still be compliant.

Since the gzip module never sets the FTEXT flag, the value of the OS field is useless.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27525>
_______________________________________


More information about the Python-bugs-list mailing list