Modify ↓
Ticket #21 (closed defect: duplicate)
yaml emitter bug
| Reported by: | rwb123@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by xi) (diff)
The following code produces bad yaml output, which subsequently dies in the yaml.load(). This is with pyyaml 3.0.3 on python 2.4.1.
import yaml e = {"texas: '": 92.5} yammy = yaml.dump(e) print yammy e2 = yaml.load(yammy) print e2
The yaml output is:
$ python yamlbug2.py
{'texas: '': 92.5}
Traceback (most recent call last):
File "yamlbug2.py", line 10, in ?
e2 = yaml.load(yammy)
File "/home/blahblah/dl/yaml/PyYAML-3.03/lib/yaml/__init__.py", line 61, in load
return loader.get_data()
... etc.
Attachments
Change History
comment:2 Changed 7 years ago by xi
- Status changed from new to closed
- Resolution set to duplicate
- Description modified (diff)
Duplicate of #17, fixed in [197].
If you don't want to checkout the code from svn, replace the file yaml/emitter.py with http://svn.pyyaml.org/pyyaml/trunk/lib/yaml/emitter.py.
Note: See
TracTickets for help on using
tickets.

Let's try again:
Code:
import yaml e = {"texas: '": 92.5} yammy = yaml.dump(e) print yammy e2 = yaml.load(yammy) print e2Output:
$ python yamlbug2.py {'texas: '': 92.5} Traceback (most recent call last): File "yamlbug2.py", line 10, in ? e2 = yaml.load(yammy) File "/home/blahblah/dl/yaml/PyYAML-3.03/lib/yaml/__init__.py", line 61, in load return loader.get_data() File "/home/blahblah/dl/yaml/PyYAML-3.03/lib/yaml/constructor.py", line 41, inget_data