bobfang1992 / pytomlpp

A python wrapper for tomlplusplus

Home Page:https://bobfang1992.github.io/pytomlpp/pytomlpp.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Carriage return should fail parsing

pwwang opened this issue · comments

Hmm, this was fixed in toml++ 3.0.0, on which this library is based. Are you using a current version of pytomlpp?

Edit: Actually, looking at the list of "invalid" parses that pytomlpp fails in your third link, it seems to be that there's some newline normalisation going on before parsing. Both of those things are definitely fixed in toml++.

You are right. The normalization happened when the file is read by Path.read_text() or open(path, "r").

Path.read_bytes() or open(path, "rb") should be the right way.

@pwwang nice project, btw. Interesting to see that using tomli's benchmark data shows pytomlpp as being faster than rtoml, but then using pytomlpp's own data it's the other way around. Looks like tomli's benchmark data tests a few more paths of the parser.

Yep, it's funny. I noticed that, too. And it is actually sort of reproducible, even though the difference is negligible.