in RoundTripConstructor class, method construct_scalar, under if node.style == '>' you will find the following lines:
fss = FoldedScalarString(node.value.replace('\a', ''), anchor=node.anchor)
if self.loader and self.loader.comment_handling is None:
if node.comment and node.comment[1]:
fss.comment = node.comment[1][0] # type: ignore
else:
# NEWCMNT
if node.comment is not None and node.comment[1]:
# nprintf('>>>>nc2', node.comment)
# EOL comment after >
lss.comment = self.comment(node.comment[1][0]) # type: ignore
The last line is maybe incorrect ? lss => fss
Yes that looks like a copy-paste not updated. Should add some more tests as this is probably not covered yet. Thanks for reporting.
Should be fixed in 0.17.18