Skip to content

Update Markdown delimiter cache stubs for 3.11.4 - #16912

Closed
xixi-box wants to merge 1 commit into
python:mainfrom
xixi-box:fix/issue-16911-605aee1-4e75b51f
Closed

xixi-box wants to merge 1 commit into
python:mainfrom
xixi-box:fix/issue-16911-605aee1-4e75b51f

Conversation

@xixi-box

Copy link
Copy Markdown
Contributor

Fixes #16911

Markdown 3.11.4 changed the inline delimiter cache API within the supported version range, causing stubtest to report five mismatches.

Target Markdown 3.11.4 and later compatible patch releases, replace the removed cache method with build_cache, match the new get_cached_result signature, and declare EvaluatedText as a str subclass.

Upstream implementation

Tests: /bin/sh -c 'source .venv-313/bin/activate && python tests/regr_test.py Markdown --python-version 3.13 --verbosity VERBOSE'.
Result: source .venv/bin/activate && UV_PYTHON=3.13.17 xvfb-run -a python tests/stubtest_third_party.py --ci-platforms-only --num-shards 4 --shard-index 3: exploratory exit 1. Markdown reproduced the five stubtest mismatches before the edit. ldap3 and pycups had unrelated local dependency-installation failures. Other tested distributions passed or were skipped by the runner.
Result: source .venv-313/bin/activate && UV_PYTHON=3.13.17 xvfb-run -a python tests/stubtest_third_party.py --ci-platforms-only Markdown: base exit 1, 5 errors across 33 modules with Markdown 3.11.4.
Result: source .venv-313/bin/activate && python tests/regr_test.py Markdown --python-version 3.13 --verbosity VERBOSE: base exit 1 with 6 diagnostics for the missing class and stale delimiter cache API.
Result: source .venv-313/bin/activate && python tests/regr_test.py Markdown --python-version 3.13 --verbosity VERBOSE: patched exit 0, Test completed successfully!
Result: source .venv-313/bin/activate && UV_PYTHON=3.13.17 xvfb-run -a python tests/stubtest_third_party.py --ci-platforms-only Markdown: patched exit 0, Markdown... success (4.78 s).
Result: source .venv-313/bin/activate && UV_PYTHON=3.13.17 xvfb-run -a python -u tests/runtests.py --run-stubtest stubs/Markdown: patched exit 0. Pre-commit, repository structure, Pyright, ty, pyrefly, mypy, stubtest, and both regression runners passed.
Result: PYTHONPATH=/tmp/oss-scout-markdown-3113 .venv-313/bin/python /tmp/oss-scout-markdown-cache-check.py && PYTHONPATH=/tmp/oss-scout-markdown-3114 .venv-313/bin/python /tmp/oss-scout-markdown-cache-check.py: exit 0. Both upstream versions produced the expected HTML for all four inputs. The 3.11.4 trace observed cache reads with no position and with position 26.
Regression coverage: stubs/Markdown/@tests/test_cases/check_inlinepatterns.py.

Drafted by Codex.

Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau closed this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily tests failed on Fri Nov 27 2026

2 participants