Issue #141: beancount fails with ValueError: day is out of range for month on document (blais/beancount)

4 views
Skip to first unread message

Renato Alves

unread,
Oct 29, 2016, 4:13:05 PM10/29/16
to bean...@googlegroups.com
New issue 141: beancount fails with ValueError: day is out of range for month on document
https://bitbucket.org/blais/beancount/issues/141/beancount-fails-with-valueerror-day-is-out

Renato Alves:

This was a tricky one.

The error:

```
#!python
...
File "/virtualenvs/beancount/lib/python3.4/site-packages/beancount/ops/documents.py", line 141, in find_documents
date = datetime.date(*map(int, match.group(1, 2, 3)))
ValueError: day is out of range for month
```

Initially I thought I had mistyped a date in my document. Turned out the cause was a document named `2016-09-31.doc.pdf`.

Obviously beancount is correct in that the month 9 only has 30 days, therefore 31 is invalid. However it crashes with a traceback that provides no helpful information of what is wrong. Be it a line in the document or in this case, the name of the offending file.


Reply all
Reply to author
Forward
0 new messages