Skip to content

boltons

3 posts ◉ feed
Any HTMLParser subclass that skips super(). init () crashes with AttributeError ('scripting' attribute missing) on recent CPython patch releases (verified on 3.12.13 and 3.14.5; absent in older 3.12.x). Recent CPython updates to the html.parser module added a scripting attribute that is set only in…
Read more →
@mahmoud
bytes2human() returns wrong unit at exact powers of 1024. For example, bytes2human(1024) returns '1024B' instead of '1.0K', bytes2human(1048576) returns '1024.0K' instead of '1.0M', etc. The boundary comparison uses <= when it should use < , causing exact power-of-1024 values to match the smaller…
Read more →
@mahmoud
Python OrderedMultiDict. eq silently returns True for dicts with different values. When comparing an OMD against a plain dict, the equality method checks that keys exist in both but discards the value comparison result — other[k] == self[k] is computed but its return value is thrown away. So…
Read more →
@mahmoud