Custom Query (171 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 171)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#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'))
#31 fixed PyYAML for Python 2.5 xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

Could you compile a Windows binary of PyYAML for Python 2.5 (released fairly recently)? Ideally with libyaml support built in...

#32 fixed patch to make libyaml compile in visual studio xi roel _ dot _ vanhout _ at _ gmail _ dot _ com

Reported by roel _ dot _ vanhout _ at _ gmail _ dot _ com, 8 years ago.

Description

2 issues:

  • pointer arithmetic on void*'s is a gcc-ism. I 'solved' it by casting them all to a unsigned char (typedef'd), I'm not sure if a unsigned char is guaranteed to be the same size as a void* on all architectures - it worked on 32-bit Windows, FWIW.
  • A shorthand struct assignment didn't work, I'm not sure if it's valid C or not but whatever, by writing it out in full it compiled ok.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.