-
Notifications
You must be signed in to change notification settings - Fork 6
YAML trouble #1
Comments
In my case, a try/catch around the yaml.load(val) helped me get back results. I return "BROKEN!" in case of broken parsing. |
|
What is the actual value YAML is trying to parse? Sounds like this might be an issue somewhere upstream. |
Having gotten feedback that the trouble was bad data upstream, it might still be interesting to see what data can crash that parser:
|
Hmpf, the text content of that "tag" was the UTF-8 word "Møder". That should parse. Well. This is not a problem in "freckle" module, but it will trouble its Euro users. PyAML documentation has more detailed info. In Python 2: str objects are converted into !!str, !!python/str or !binary nodes depending on whether the object is an ASCII, UTF-8 or binary string. |
Traceback (most recent call last):
File "visu.py", line 17, in
projects = f.get_projects()
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/freckle-0.1-py2.7.egg/freckle.py", line 82, in get_projects
return self.request("%s/projects.xml" % self.endpoint)
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/freckle-0.1-py2.7.egg/freckle.py", line 41, in request
return self.parse_response(content)
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/freckle-0.1-py2.7.egg/freckle.py", line 93, in parse_response
as_python = getattr(self, parser)(item.text)
File "/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/freckle-0.1-py2.7.egg/freckle.py", line 127, in yaml_as_python
return yaml.load(val)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/init.py", line 58, in load
return loader.get_single_data()
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 44, in get_single_data
return self.construct_document(node)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 53, in construct_document
for dummy in generator:
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 403, in construct_yaml_map
value = self.construct_mapping(node)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 213, in construct_mapping
return BaseConstructor.construct_mapping(self, node, deep=deep)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 138, in construct_mapping
value = self.construct_object(value_node, deep=deep)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 93, in construct_object
data = constructor(self, node)
File "/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/yaml/constructor.py", line 419, in construct_undefined
node.start_mark)
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!binary'
in "", line 12, column 12:
:name: !binary |
^
The text was updated successfully, but these errors were encountered: