YAML? That's Norway Problem
The article discusses the 'Norway problem' in YAML, where the country code 'NO' is incorrectly parsed as false. This issue arises from YAML's design, which interprets certain strings as booleans based on their natural language meaning. The article also explores the history of YAML and provides solutions to avoid this parsing error.
- ▪YAML is a data serialization language popular for configuration files.
- ▪The 'Norway problem' occurs when the country code 'NO' is parsed as false due to its similarity to the English word 'no'.
- ▪One workaround to this issue is to quote the country code as '"NO"' in the YAML file.
Opening excerpt (first ~120 words) tap to expand
< Back to LAB174.com YAML? That’s Norway problem 2026-01-12 Abstract A deep dive into YAML’s Norway problem: why the country code NO gets parsed as false, its history from YAML v1.0 to v1.2, and why popular libraries still exhibit this behavior in 2026. What is yaml Yaml is a well-known data serialization language designed for human readability. It’s a popular choice for configuration files and metadata. Here’s a simple example: # project.yaml title: Nonoverse description: Beautiful puzzle game about nonograms. link: https://lab174.com/nonoverse countries: - DE - FR - PL - RO Let’s verify that the above example parses correctly. We’ll use Python1 with PyYaml2 version 6.0.3 (the latest version as of this writing).
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at LAB174.