Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39121: write gzip header OS information #17682

Open
wants to merge 6 commits into
base: master
from

Conversation

@wungad
Copy link

wungad commented Dec 23, 2019

@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Dec 23, 2019

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@wungad

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Misc/ACKS Outdated Show resolved Hide resolved
Lib/gzip.py Outdated Show resolved Hide resolved
Lib/gzip.py Outdated
@@ -17,6 +17,14 @@

READ, WRITE = 1, 2

# OS field values as specified in RFC 1952
OS_CODES = {
'linux': 3,

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Dec 23, 2019

Member

There are many other supported Unix flavors: FreeBSD, NetBSD, OpenBSD, AIX, OpenIndiana, etc.

This comment has been minimized.

Copy link
@wungad

wungad Dec 23, 2019

Author

I used C library (
http://git.savannah.gnu.org/cgit/gzip.git/tree/tailor.h#n113) as a
reference which sets 0x0b when it detects win32. From the looks of it a
value of 0x03 can be set for darwin, linux and aix.

Lib/gzip.py Outdated
# OS field values as specified in RFC 1952
OS_CODES = {
'linux': 3,
'os2': 6,

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Dec 23, 2019

Member

OS/2 no longer supported.

This comment has been minimized.

Copy link
@wungad

wungad Dec 23, 2019

Author

I was looking at RFC and used those code for which I was
certain that this is working.

Lib/gzip.py Outdated
OS_CODES = {
'linux': 3,
'os2': 6,
'win32': 11,

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Dec 23, 2019

Member

Actually two most common file systems on Windows are FAT and NTFS.

This comment has been minimized.

Copy link
@wungad

wungad Dec 23, 2019

Author

Looking at https://docs.python.org/3/library/sys.html we ave the following available:

  • aix
  • linux
  • win32
  • cygwin
  • darwin
wungad added 2 commits Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.