diff options
| author | Gertjan van Zwieten <git@gjvz.nl> | 2023-08-07 15:24:02 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-07 15:24:02 (GMT) |
| commit | 85793278793708ad6b7132a54ac9fb4b2c5bcac1 (patch) | |
| tree | 20879feeddb2c89ad209d1235607759442e08a73 /Lib/test/test_bytes.py | |
| parent | ed64204716035db58c7e11b78182596aa2d97176 (diff) | |
| download | cpython-85793278793708ad6b7132a54ac9fb4b2c5bcac1.zip cpython-85793278793708ad6b7132a54ac9fb4b2c5bcac1.tar.gz cpython-85793278793708ad6b7132a54ac9fb4b2c5bcac1.tar.bz2 | |
gh-107715: Escape class name in regular expression (GH-107716)
This patch escapes the class name before embedding it in the regular expression
for `pat` in `doctest.DocTestFinder._find_lineno`. While class names do not
ordinarily contain special characters, it is possible to encounter these when a
class is created dynamically. Escaping the name will correctly return `None` in
this scenario, rather than potentially matching a different class or raising
`re.error` depending on the symbols used.
Diffstat (limited to 'Lib/test/test_bytes.py')
0 files changed, 0 insertions, 0 deletions
