Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (16 - 18 of 121)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Ticket Resolution Summary Owner Reporter
#9 fixed Forcing block style xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

Is there an easy way to force the emitter to use block style instead of flow style? I have one particular case in mind where it would be particularly desirable: ordered dictionaries. For example:

>>> yaml.load('[hello: world, goodbye: world]')
[{'hello': 'world'}, {'goodbye': 'world'}]
>>> print yaml.dump(_)
- {hello: world}
- {goodbye: world}

In my opinion, the output would look much nicer as

- hello: world
- goodbye: world

Even if you don't agree with this opinion, there should be a way to force block style in all output. I did not see an easy way to do this, even with subclassing. Suggestions?

#129 fixed Incorrect Unicode BOM generation xi Valentin Nechayev <netchv@…>

Reported by Valentin Nechayev <netchv@…>, 5 years ago.

Description

py-YAML 3.07, with Python 2.5 and FreeBSD (package name py25-yaml-3.07_2)

When yaml.dump() generates stream in utf-16be or utf-16le, it generates byte-order mark (BOM), but makes it incorrectly. Example:

>>> yaml.dump("xyz", encoding = 'utf-16be')
'\x00\xff\x00\xfe\x00x\x00y\x00z\x00\n\x00.\x00.\x00.\x00\n'

Instead, it should generate:

'\xfe\xff\x00x\x00y\x00z\x00\n\x00.\x00.\x00.\x00\n'

Fix:

--- 01/PyYAML-3.07/lib/yaml/emitter.py  2008-12-29 01:36:32.000000000 +0200
+++ work/PyYAML-3.07/lib/yaml/emitter.py        2009-06-06 16:48:39.000000000 +0300
@@ -787,7 +787,7 @@
     def write_stream_start(self):
         # Write BOM if needed.
         if self.encoding and self.encoding.startswith('utf-16'):
-            self.stream.write(u'\xFF\xFE'.encode(self.encoding))
+            self.stream.write(u'\uFEFF'.encode(self.encoding))
 
     def write_stream_end(self):
         self.flush_stream()

P.S. I guess it also should generate BOMs for utf-32*

#28 worksforme Incorrect handling of strings with trailing spaces xi yang

Reported by yang, 8 years ago.

Description

The following fails because the trailing space is dropped. I don't know if this is incorrect dumping (should've quoted), loading (should not have ignored the space), or even both.

s = 'abc '
assert syck.load( syck.dump(s) ) == s
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Note: See TracQuery for help on using queries.