The Norway Problem in Yaml

Norway's ISO country code is NO. Under the YAML 1.1 spec, unquoted no (case-insensitive, along with yes, on, off, y, n, true, false) is treated as a boolean and not a string. You can see the problem here. ~ cat test . yaml countries : - NO - SE - NL - IN - US - SG ~ python >>> import yaml >>> with open ( "test.yaml" ) as f : ... data = yaml . safe_load ( f ) ... >>> print ( data ) { 'countries' :…