Custom Query (121 matches)
Results (22 - 24 of 121)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #27 | worksforme | yaml.dump seems to be broken | xi | anonymous |
| 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 |
| 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@… |
| 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')) |
|||
