rezemika / oh_sanitizer

A corrector for the 'opening_hours' fields from OpenStreetMap
GNU Affero General Public License v3.0
2 stars 0 forks source link

TypeError: sequence item 0: expected string, NoneType found #8

Closed frodrigo closed 6 years ago

frodrigo commented 6 years ago
2018-07-27 17:58:52   Analysing file /data/work/fred/extracts/brazil.osm.pbf
((4375674821L, {u'opening_hours': u'S\xe1bado', u'amenity': u'marketplace', u'name': u'Feira Org\xe2nica Burle Marx'}, (-46.72243479
999979, -23.633272499999453)), {'lat': -23.633272499999453, 'tag': {u'opening_hours': u'S\xe1bado', u'amenity': u'marketplace', u'na
me': u'Feira Org\xe2nica Burle Marx'}, 'lon': -46.72243479999979, 'id': 4375674821L})
Traceback (most recent call last):
  File "/home/fred/frodrigo-osmose-backend/analysers/modules/OsmPbf.py", line 132, in NodeParse
    self._output.NodeCreate(data)
  File "/home/fred/frodrigo-osmose-backend/analysers/analyser_sax.py", line 172, in NodeCreate
    res = meth(data, tags)
  File "/home/fred/frodrigo-osmose-backend/plugins/TagFix_Opening_Hours.py", line 46, in node
    return self.sanitize_tags(tags)
  File "/home/fred/frodrigo-osmose-backend/plugins/TagFix_Opening_Hours.py", line 37, in sanitize_tags
    sanitized_field = sanitize_field(tags['opening_hours'])
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/oh_sanitizer/main.py", line 297, in sanitize_field
    new_field = SanitizerTransformer().transform(tree)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 113, in transform
    items.append(self.transform(c) if isinstance(c, Tree) else c)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/lark/tree.py", line 121, in transform
    return f(items)
  File "/home/fred/frodrigo-osmose-backend/venv/local/lib/python2.7/site-packages/oh_sanitizer/main.py", line 145, in weekday_range
    return '-'.join(args)
TypeError: sequence item 0: expected string, NoneType found
rezemika commented 6 years ago

Sorry for the inconvenience, I just released a v0.1.5 which fixes this bug. Thank you!