Ticket #60 (closed defect: fixed)

Opened 10 months ago

Last modified 4 months ago

Error loading timestamps

Reported by: miki@fattoc.com Assigned to: 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

09/17/07 14:31:10 changed by miki@fattoc.com

Seems like the offending code is in loaders.py 249-251

        if micro:
            while 10*micro < 1000000:
                micro *= 10

Commenting out this code makes the bug go away. I don't understand why is this code needed ...

09/19/07 05:31:27 changed by xi

  • status changed from new to closed.
  • resolution set to fixed.

Thanks for the report. Fixed in [259].


Add/Change #60 (Error loading timestamps)




Change Properties
Action