You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python -m gzip ignores --fast and --best for file arguments #161086
python -m gzip --fast FILE and python -m gzip --best FILE compress at the default level. main() passes compresslevel to GzipFile only when reading stdin; the file-argument branch calls gzip.open(arg + ".gz", "wb") without it.
head -c 3000000 /dev/urandom | base64 > data
foroptin --fast --best;do cp data data$opt; python -m gzip $opt data$opt;done
ls -l data--fast.gz data--best.gz # identical sizes, XFL header byte is 0 in both
python -m gzip --fast < data | wc -c # differs from --best < data, as expected
Expected --fast and --best to produce different output (and XFL 4 and 2) for files, as they do for stdin. The options were added in gh-79150 (GH-9833), which wired them up only for stdin.
Activity
gh-161086: Honor --fast and --best for file arguments in gzip CLI (GH…
[3.14] gh-161086: Honor --fast and --best for file arguments in gzip …
[3.15] gh-161086: Honor --fast and --best for file arguments in gzip …