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

ValueError: need more than 1 value to unpack #7

Closed frodrigo closed 6 years ago

frodrigo commented 6 years ago

With the input Mo-Su,PH 14:00-18:00; Fr off; Jan 01,easter,easter +1 day,May 01,May 08,easter +39 days,easter +49 days,easter +50 days,Jul 14,Aug 15,Nov 01,Nov 11,Dec 25 off I got

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 48, in node
    return self.sanitize_tags(tags)
  File "/home/fred/frodrigo-osmose-backend/plugins/TagFix_Opening_Hours.py", line 38, 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 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 115, in day_offset
    offset_sign, days = args[0].value.strip("days ")  
ValueError: need more than 1 value to unpack
rezemika commented 6 years ago

Fixed by c316ca2, it will be in the next release. Thank you!

rezemika commented 6 years ago

Since there is (apparently) no other problems, I just uploaded a v0.1.4 version. Sorry for the late, I was quite busy...

frodrigo commented 6 years ago

Ok, for this issue. But I was waiting you release to test again.