Skip to content

monkeyYaml part 2, or unexpected longevity

Ten years ago, I hacked out a limited parser in Python for YAML, which I named monkeyYaml. I even blogged about it.

It turns out that this code is still in use. Not only as a backup, but as the *only* parser for front matter in the test262 repository.

Initially, I used import yaml to parse the YAML front matter. When this change broke on some of Google’s vast Chromium test farm, on machines with Python 2 where yaml was not available, I wrote monkeyYaml as a backup parser.

Shortly after that, though, user jugglinmike (or, as I prefer to think of him, MegaMan) pointed out that using two different parsers was risky. A new test author might use a YAML feature not supported by monkeyYaml, and if they tested on a modern installation of Python 2 or Python 3, it would appear to work… only breaking when it eventually reached the Chromium test farm.

So, to ensure that we stay within the YAML subset supported by monkeyYaml, MegaMan made this change to ensure that monkeyYaml would be the only parser, not the fallback parser.

Post a Comment

Your email is never published nor shared. Required fields are marked *