Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (67 - 69 of 121)

Ticket Resolution Summary Owner Reporter
#118 fixed Strange case where yaml.load should error but actually loads xi xi

Reported by xi, 4 years ago.

Description
>>> yaml.load('-\n-3')
[-3]

Adding a newline actually does produce the desired error:

>>> yaml.load('-\n-3\n')
...
yaml.scanner.ScannerError: while scanning a simple key
  in "<string>", line 2, column 1:
    -3
    ^
could not found expected ':'
  in "<string>", line 3, column 1:
    
    ^
#30 fixed Timestamp support has floating-point roundoff xi edemaine@…

Reported by edemaine@…, 7 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'))
#146 invalid Trunk build fail xi lacombar@…

Reported by lacombar@…, 3 years ago.

Description

I got the following trunk build failure on a NetBSD host:

In file included from api.c:10: yaml_private.h:1234: error: expected '{' before 'typedef' yaml_private.h:1239: warning: data definition has no type or storage class

Note: See TracQuery for help on using queries.