6 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
The article explains why the ISO country code "NO" is incorrectly parsed as false in YAML. It covers the issue's history from YAML v1.0 to v1.2 and discusses why popular libraries still exhibit this behavior in 2026. The text also presents workarounds and the complexities of YAML's specification.
If you do, here's more
YAML's Norway problem arises when the country code "NO" for Norway gets interpreted as a boolean false during parsing. This issue is rooted in YAML's design, which allows natural language-like representations. The word "no" is treated as a boolean false, leading to confusion when "NO" appears in lists alongside other country codes. The original YAML specifications added this behavior to enhance readability, but it has caused significant problems in practice. A common workaround is to wrap "NO" in quotes, forcing it to be treated as a string instead of a boolean.
YAML has evolved over multiple versions, with v1.0 and v1.1 maintaining the problematic implicit typing that allows "no" to be parsed as false. In contrast, v1.2 aimed to address these issues by defining "no" as a string, yet many widely used libraries still rely on the older v1.1 version. As of January 2026, popular libraries like PyYaml and LibYaml have not implemented v1.2 support, leaving the Norway problem unresolved in practical applications. Users have created alternative parsers or unofficial libraries to partially support v1.2 features, but these have not gained widespread traction.
The complexity of YAML's specification contributes to the persistence of this issue. With a multitude of features, including implicit and explicit typing, and various syntax rules, implementing changes is no small task. The gap between version releases stretches into years, making it difficult for libraries to stay current. The article highlights the ongoing challenges that developers face in effectively using YAML due to these legacy behaviors and the slow adoption of updated specifications.
Questions about this article
No questions yet.