Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (22 - 24 of 121)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Ticket Resolution Summary Owner Reporter
#27 worksforme yaml.dump seems to be broken xi anonymous

Reported by anonymous, 8 years ago.

Description

I may be missing something here, but this seems to be broken:

Example that works:

>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5, 'rarity': 45, 'weight': 10, 'cost': 50000, 'flags': ['INT', 'WIS', 'SPEED', 'STEALTH']})
cost: 50000
depth: 5
flags: [INT, WIS, SPEED, STEALTH]
name: The Cloak 'Colluin'
rarity: 45
weight: 10

Portion of above example:

>>> print yaml.dump({'name': "The Cloak 'Colluin'", 'depth': 5})
{depth: 5, name: The Cloak 'Colluin'}

I would expect to get:

depth: 5
name: The Cloak 'Colluin'
#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
#30 fixed Timestamp support has floating-point roundoff xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

Example:

>>> import yaml, datetime
>>> yaml.dump(datetime.datetime(2005, 7, 8, 17, 35, 4, 517600))
'2005-07-08 17:35:04.517600\n'
>>> yaml.load(_)
datetime.datetime(2005, 7, 8, 17, 35, 4, 517599)

This breaks the desired rule that yaml.load(yaml.dump(x)) == x in a case where there should be no roundoff. (datetime.datetime uses integers everywhere to avoid any error.)

The offending code seems to be line 321 in yaml/constructor.py:

fraction = int(float(values['fraction'])*1000000)

This seems to be an "easy" way to convert the trailing '.517600' into an integer, but it can go beyond floating-point precision. Wouldn't the following work?

fraction = int(values['fraction'][:6].ljust(6, '0'))
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Note: See TracQuery for help on using queries.