Modify

Ticket #254 (new defect)

Opened 22 months ago

Errors with Numpy Dtypes

Reported by: cronburg@… Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords: pyyaml numpy dtype TypeError
Cc:

Description

Dumping / loading numpy floats works as expected, but it seems like most of the others fail:

import yaml import numpy as np yaml.load(yaml.dump(np.float64(10)))

10.0

yaml.load(yaml.dump(np.int32(10)))

Traceback (most recent call last):

File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/yaml/init.py", line 202, in dump

return dump_all([data], stream, Dumper=Dumper, kwds)

File "/usr/local/lib/python2.7/site-packages/yaml/init.py", line 190, in dump_all

dumper.represent(data)

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 28, in represent

node = self.represent_data(data)

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 61, in represent_data

node = self.yaml_multi_representers[data_type](self, data)

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 437, in represent_object

return self.represent_sequence(tag+function_name, args)

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 101, in represent_sequence

node_item = self.represent_data(item)

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 41, in represent_data

if self.ignore_aliases(data):

File "/usr/local/lib/python2.7/site-packages/yaml/representer.py", line 142, in ignore_aliases

if data in [None, ()]:

TypeError?: data type not understood

Attachments

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.