dose3 yaml output is incorrect or ambiguous

Hi,

I'm working on https://debusine.debian.net/ , and we are parsing dose3 output to analyze build failures and dependencies inconsistencies.

Parsing the dose3 YAML output currently leads to 2 main issues:

  • packages are unquoted and some troublesome package names are parsed incorrectly by the YAML reader (e.g. package 0xffff is parsed as number 65535)
  • versions are unquoted and can be incorrectly parsed as floats (e.g. 1.70 -> 1.7 or 0.6e-7 -> 6.0e-08)
    • this also applies to dose's own output-version: 1.2 field although that's less likely to cause an issue (until it reaches 1.10 ;))

This was first publicly reported (with more details) at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834059

There is a Python-specific work-around, but this doesn't work for other languages, and is more generally error-prone.

I can dedicate some time working on a patch.