File: fix_pyyaml_default_flow_style.patch

package info (click to toggle)
python-asdf 2.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,248 kB
  • sloc: python: 13,104; makefile: 125
file content (36 lines) | stat: -rw-r--r-- 1,279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
Date: Thu, 19 Sep 2019 15:45:53 +0200
Subject: Force yaml.dump() calls to specify default_flow_style=None

default_flow_style changed to False by default, which actually changes
the output format. Make sure we retain the previous behavior expected
by the tests.

cf. https://github.com/yaml/pyyaml/issues/265
---
 asdf/block.py    | 1 +
 asdf/yamlutil.py | 1 +
 2 files changed, 2 insertions(+)

diff --git a/asdf/block.py b/asdf/block.py
index a1e6c42..10e5b37 100644
--- a/asdf/block.py
+++ b/asdf/block.py
@@ -395,6 +395,7 @@ class BlockManager:
                 offsets, Dumper=yamlutil._yaml_base_dumper, stream=fd,
                 explicit_start=True, explicit_end=True,
                 version=yaml_version,
+                default_flow_style=None,
                 allow_unicode=True, encoding='utf-8')
 
     _re_index_content = re.compile(
diff --git a/asdf/yamlutil.py b/asdf/yamlutil.py
index f9f7492..db95eaf 100644
--- a/asdf/yamlutil.py
+++ b/asdf/yamlutil.py
@@ -352,4 +352,5 @@ def dump_tree(tree, fd, ctx):
         explicit_start=True, explicit_end=True,
         version=yaml_version,
         allow_unicode=True, encoding='utf-8',
+        default_flow_style=None,
         tags=tags)