I am trying to load a YAML file using PyYAML module, however, I get a MemoryError. The file size seems reasonable, i.e. 28 MB. I have loaded larger files in the past without any issues. I am using Python27 32bit. Does anybody know what's going on and maybe can they please suggest a solution (I don't want to go down the road of splitting the yaml file).
Following is the Error that I get:
>> yaml_results_file = yaml.load(open
(parent_folder+yaml_results_file_path+yaml_results_file_name, "r"))
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
yaml_results_file = yaml.load(open(parent_folder+yaml_results_file_path+yaml_results_file_name, "r"))
File "C:\Python27\lib\site-packages\yaml\__init__.py", line 71, in load
return loader.get_single_data()
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 39, in get_single_data
return self.construct_document(node)
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 48, in construct_document
for dummy in generator:
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 398, in construct_yaml_map
value = self.construct_mapping(node)
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 208, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 127, in construct_mapping
key = self.construct_object(key_node, deep=deep)
File "C:\Python27\lib\site-packages\yaml\constructor.py", line 99, in construct_object
self.constructed_objects[node] = data
MemoryError