I'm hitting an issue with DictOption `fromfile` po...
# development
b
I'm hitting an issue with DictOption
fromfile
pointing to a YAML file where a newline at the end makes a difference. but the parsing code uses
.strip()
on the file contents. I think thats a bug?
c
what difference does the newline do?
b
It depends on the plugin, no?
In this case the copyright header being stamped is eating the first line 🙂
c
oh… 👀
in my experience so is relying on whitespace in files, especially at the end, a source of headaches
b
Shouldn't the underlying parsing libraries handle that though?
json.loads()
and
yaml_safe_load
?
c
oh, they do. I mean that from a users perspective, so can the absence or presence of a final newline trip them up if that’s significant
b
YAML is a god-awful spec, but... better than handcrafting JSON
c
agree
b
OK I'm gonna PR this
👀 1
c
I see, so in this case, we tripped the user up, with no sensible out 😛
h
Yeah, that is a bug
We should not strip if the newline is significant!
I’ll bet I was the one that introduced that .strip() unnecessarily