Modify ↓
Ticket #60 (closed defect: fixed)
Error loading timestamps
| Reported by: | miki@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pysyck |
| Severity: | critical | Keywords: | |
| Cc: |
Description
Try the following script:
#!/usr/bin/env python
import syck
from datetime import datetime
for i in range(10000):
now = datetime.now()
dumped = syck.dump(now)
loaded = syck.load(dumped)
if now != loaded:
print "original:", now
print "result:", loaded
print "dump:", dumped
break
I get:
original: 2007-09-17 11:04:08.091612 result: 2007-09-17 11:04:08.916120 dump: --- !timestamp 2007-09-17T11:04:08.091612
The YAML looks OK, so the parsing is wrong.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

Seems like the offending code is in loaders.py 249-251
if micro: while 10*micro < 1000000: micro *= 10Commenting out this code makes the bug go away. I don't understand why is this code needed ...