Modify

Ticket #21 (closed defect: duplicate)

Opened 8 years ago

Last modified 8 years ago

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:1 Changed 8 years ago by anonymous

Let's try again:

Code:

import yaml
e = {"texas: '": 92.5}
yammy = yaml.dump(e)
print yammy
e2 = yaml.load(yammy)
print e2

Output:

$ 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

comment:2 Changed 8 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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.