November 2026
The hardest part of a parsing fix is not writing it. It is convincing a reviewer, and yourself, that the new behaviour is right in the cases you did not think of.
Sometimes there is a way out. If something else already computes the correct answer, you can stop reasoning and start comparing.
pdm#3978. A dependency marker like python_version > "3.8.0" has to be turned into a version range. The code that did it ignored the patch part, which is wrong in a way that depends on the operator. For > the patch does not matter, because the marker compares on major.minor. For >= a non-zero patch has to round up to the next minor, while a zero patch stays where it is.
I could have argued for that in a PR description and hoped. Instead I ran the function against packaging.markers.Marker.evaluate, which is the implementation that actually decides whether a marker matches, across four operators, nine marker versions and thirty-eight Python versions. That is 1368 comparisons. The existing code disagreed with the evaluator in 44 of them. The branch disagreed in none.
A thirteen-line diff, and the argument for it is a number anybody can reproduce. Nobody had to take my word for which rounding rule was correct, because the thing that defines correct was right there and importable.
This works more often than people use it. Markers, version specifiers, requirement strings, URL parsing, glob matching. In most of those a reference implementation exists and you can diff against it instead of writing six examples and calling it covered.
pdm#3969 was about pdm show not finding a package's homepage. Modern packages often omit Home-page and declare a Homepage row under Project-URL instead, and the reader did not fall back to it. Splitting also broke on any URL containing a comma, because the row was split on every comma rather than the first.
The interesting part was the test. The project's mock Distribution holds one value per metadata field, and these packages have several Project-URL lines, so the mock could not represent the input the bug needs. I had to write a real dist-info to the filesystem to reproduce it.
A test double that cannot express the shape of your data will hide this entire class of bug. It is worth noticing when the fixture is the thing standing between you and the failure.
moto#10387. Listing CodeBuild builds ignored sortOrder and returned oldest first, where AWS sorts by build number and defaults to newest first.
Underneath it was something worse. Each build got a buildNumber of randint(1, 100). A field whose entire job is to say which build came first held a random integer, so it could not order anything and two builds could share a number. Fixing the sort meant first making the number mean what it means, counting up from one per project.
Mocks accumulate these. A field gets filled with something that looks plausible to get a response shape passing, and the plausible value quietly becomes the behaviour. Nobody writes a bug report saying a number is random, because from one call it looks fine.
moto#10370 is the ignored-parameter bug I keep finding, with a twist worth writing down. AppConfig's list_configuration_profiles takes a Type filter and returned everything regardless.
The reason the handler never read it is that Type does not arrive in the body. It arrives on the query string, lowercased to type. Code looking for it under the name the documentation uses will not find it and will carry on without complaining.
So when a parameter appears unused, check where that protocol actually puts it before concluding the implementation forgot. Sometimes it did forget. Sometimes it looked in the wrong place, which produces the identical symptom and a different fix.