summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-04-23 08:33:36 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-04-23 08:33:36 +0200
commita648518ebda2003a61649c86938dd3846810a9b0 (patch)
tree18f7d93d37e50073fa3eb12f4af9138761f5228f /scanner.py
parent0d1300c8b70de0ad2990b3f95629305dee870f0a (diff)
downloadruamel.yaml-a648518ebda2003a61649c86938dd3846810a9b0.tar.gz
add line-break to EOF comment without one0.15.94
fixes issue #286 *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'scanner.py')
-rw-r--r--scanner.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scanner.py b/scanner.py
index 1967a56..46247f1 100644
--- a/scanner.py
+++ b/scanner.py
@@ -1877,6 +1877,10 @@ class RoundTripScanner(Scanner):
while ch not in _THE_END:
ch = srp()
if ch == '\0': # don't gobble the end-of-stream character
+ # but add an explicit newline as "YAML processors should terminate
+ # the stream with an explicit line break
+ # https://yaml.org/spec/1.2/spec.html#id2780069
+ comment += '\n'
break
comment += ch
srf()