One function

compress_partitioned in sprymix/csscompressor

The author described this change as Fix a bug compress_partitioned with some specific 'max_linelen' (trailing \n). It counts as a record because the check below fails on the code as it stood at fe7fcf6b2 and passes on 5f98a44d8, with nothing else changed between the two runs.

Fix saved2014-04-04
Sharing licenceBSD-3-Clause · LICENSE
Change size+1 0

What the code was meant to do, written into the code itself as a docstring

Compress given CSS stylesheet into a set of files. Parameters: - max_linelen : int = 0 Has the same meaning as for "compress()" function. - max_rules_per_file : int = 0 Internet Explorers <= 9 have an artificial max number of rules per CSS file (4096; http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/10164546.aspx) When `max_rules_per_file` is a positive number, the function *always* returns a list of `str` objects, each limited to contain less than the passed number of rules. Always returns a `list` of `str` objects with compressed CSS.

The change

2121 assert max_rules_per_file > 0
2222
2323 css, preserved_tokens = _compress(css, max_linelen=max_linelen)
24+ css = css.strip()
2425
2526 bufs = []
2627 buf = []

The check that tells the two apart

failpass·csscompressor/tests/test_partition.py::Tests::test_partition_8

Check file csscompressor/tests/test_partition.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itfe7fcf6b26cf01e3a2992738c19cd32cc33ec245
Broken version dated2014-04-01
Modulecsscompressor.__init__
Units changedcompress_partitioned
Fingerprint9e8330a87d77e8c6
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in sprymix/csscompressor