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.
Projectjustinmayer/smartypants.py
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
| 57 | 57 | ||
| 58 | 58 | def smartyPants(text, attr=default_smartypants_attr): | |
| 59 | 59 | # should we translate " entities into normal quotes? | |
| 60 | - | convert_quot = False | |
| 60 | + | convert_quot = 0 | |
| 61 | 61 | ||
| 62 | 62 | # Parse attributes: | |
| 63 | 63 | # 0 : do nothing | |
| ⋯ | |||
| 122 | 122 | elif c == "e": | |
| 123 | 123 | do_ellipses = 1 | |
| 124 | 124 | elif c == "w": | |
| 125 | - | convert_quot = "1" | |
| 125 | + | convert_quot = 1 | |
| 126 | 126 | else: | |
| 127 | 127 | pass | |
| 128 | 128 | # ignore unknown option | |
| ⋯ | |||
| 167 | 167 | if not in_pre: | |
| 168 | 168 | t = processEscapes(t) | |
| 169 | 169 | ||
| 170 | - | if convert_quot != "0": | |
| 170 | + | if convert_quot: | |
| 171 | 171 | t = re.sub('"', '"', t) | |
| 172 | 172 | ||
| 173 | 173 | if do_dashes: | |
The check that tells the two apart
fail→pass·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
- 2018-05-19convert_quotes
- 2013-09-21_tokenize
- 2013-09-19_tokenize