Whole file

justinmayer/smartypants.py

The author described this change as fix convert_quote, it was also turned on since False != "0". It counts as a record because the check below fails on the code as it stood at 736735b1b and passes on 9cbb19a3e, with nothing else changed between the two runs.

Fix saved2013-08-12
Sharing licenceBSD-2-Clause · COPYING
Change size+3 3

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

fix convert_quote, it was also turned on since False != "0"

The change

5757
5858 def smartyPants(text, attr=default_smartypants_attr):
5959 # should we translate " entities into normal quotes?
60- convert_quot = False
60+ convert_quot = 0
6161
6262 # Parse attributes:
6363 # 0 : do nothing
122122 elif c == "e":
123123 do_ellipses = 1
124124 elif c == "w":
125- convert_quot = "1"
125+ convert_quot = 1
126126 else:
127127 pass
128128 # ignore unknown option
167167 if not in_pre:
168168 t = processEscapes(t)
169169
170- if convert_quot != "0":
170+ if convert_quot:
171171 t = re.sub('"', '"', t)
172172
173173 if do_dashes:

The check that tells the two apart

failpass·tests/test.py::TestSmartypantsAllAttributes::test_convert_quot

Check file tests/test.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 it736735b1bcf7c76d1aa9c129d1268841686dd079
Broken version dated2013-08-12
Modulesmartypants
Units changedsmartyPants
Fingerprintdda511ea232d919a
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 justinmayer/smartypants.py