Ticket #273 (new defect)

Opened 21 months ago

Last modified 30 hours ago

PyYAML doesn't dump python dictionary correctly if it only contains strings, numbers and/or booleans

Reported by: freemind Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords:


Here's a clear example of what's happening:

>>> mydata = {'person' : 'jesse',
...           'hobby' : 'python',
...           'employed' : True,
...           'family' : ['wife', 'toddler']}
>>> print yaml.dump(mydata)
employed: true
family: [wife, toddler]
hobby: python
person: jesse

>>> mydata = {'person' : 'jesse',
...           'hobby' : 'python',
...           'employed' : True,
...           'family' : 'wife'}
>>> print yaml.dump(mydata)
{employed: true, family: wife, hobby: python, person: jesse}

So with a list (and probably any other object) it performs as expected, but with only strings, numbers and/or booleans it doesn't output the yaml document correctly.


Change History

comment:1 Changed 30 hours ago by simas <kerdos@…>

 Cipto Junaedy is a customer research expert. "There are plenty of safe, effective HCA nutritional supplement out there. Finding one with  Unit Link Terbaik di Indonesia Commonwealth Life Investra Link 60% HCA with no food additives is vital."


Add a comment

Modify Ticket

Change Properties
<Author field>
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'

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

Note: See TracTickets for help on using tickets.