summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2021-12-24 10:37:24 +0100
committerAnthon van der Neut <anthon@mnt.org>2021-12-24 10:37:24 +0100
commitb3b16d923784da2209ff80e894c5751e398ad416 (patch)
treeb0ef15a0e9ef1dc76f1fd46fffc8c50e0eaf812a
parent979c329bd89792206072dbef7e5889fef956cd84 (diff)
downloadruamel.yaml-b3b16d923784da2209ff80e894c5751e398ad416.tar.gz
fix in folded scalar, update ruamel.yaml.clib version
-rw-r--r--README.rst4
-rw-r--r--__init__.py3
-rw-r--r--constructor.py2
-rw-r--r--parser.py2
-rw-r--r--scanner.py2
5 files changed, 9 insertions, 4 deletions
diff --git a/README.rst b/README.rst
index 0db06d2..68056d7 100644
--- a/README.rst
+++ b/README.rst
@@ -72,6 +72,10 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
+NEXT:
+ - copy-paste error in folded scalar comment attachment (reported by `Stephan Geulette
+ <https://sourceforge.net/u/sgeulette/profile/>`__)
+
0.17.17 (2021-10-31):
- extract timestamp matching/creation to util
diff --git a/__init__.py b/__init__.py
index 5124d2c..65a3423 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,7 +13,7 @@ _package_data = dict(
entry_points=None,
since=2014,
extras_require={
- ':platform_python_implementation=="CPython" and python_version<"3.10"': ['ruamel.yaml.clib>=0.1.2'], # NOQA
+ ':platform_python_implementation=="CPython" and python_version<"3.11"': ['ruamel.yaml.clib>=0.2.6'], # NOQA
'jinja2': ['ruamel.yaml.jinja2>=0.2'],
'docs': ['ryd'],
},
@@ -24,6 +24,7 @@ _package_data = dict(
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup',
diff --git a/constructor.py b/constructor.py
index bb4eb32..6049c0c 100644
--- a/constructor.py
+++ b/constructor.py
@@ -1071,7 +1071,7 @@ class RoundTripConstructor(SafeConstructor):
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
+ fss.comment = self.comment(node.comment[1][0]) # type: ignore
if fold_positions:
fss.fold_pos = fold_positions # type: ignore
return fss
diff --git a/parser.py b/parser.py
index 28ca33c..48e5c48 100644
--- a/parser.py
+++ b/parser.py
@@ -233,7 +233,7 @@ class Parser:
# end_mark.line != self.scanner.peek_token().start_mark.line:
# self.loader.scalar_after_indicator = False
event = DocumentStartEvent(
- start_mark, end_mark, explicit=True, version=version, tags=tags
+ start_mark, end_mark, explicit=True, version=version, tags=tags, comment=token.comment
) # type: Any
self.states.append(self.parse_document_end)
self.state = self.parse_document_content
diff --git a/scanner.py b/scanner.py
index 67fc3b3..61cae63 100644
--- a/scanner.py
+++ b/scanner.py
@@ -2406,7 +2406,7 @@ class RoundTripScannerSC(Scanner): # RoundTripScanner Split Comments
mark = self.reader.get_mark()
comment = '#'
else:
- # print('breaking on', repr(ch))
+ # xprintf('breaking on', repr(ch))
break
else:
comment += ch