Issue #395: Using `bean-price --all` causes an error (blais/beancount)

23 views
Skip to first unread message

luc...@bitbucket.org

unread,
May 25, 2019, 11:40:15 PM5/25/19
to bean...@googlegroups.com
New issue 395: Using `bean-price --all` causes an error
https://bitbucket.org/blais/beancount/issues/395/using-bean-price-all-causes-an-error

lucassz:

When running a command such as `bean-price --all main.bean`, I get the following error:

```
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/beancount/prices/find_prices.py", line 147, in import_source
__import__(default_name)
ModuleNotFoundError: No module named 'beancount.prices.sources.True'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/bean-price", line 4, in <module>
from beancount.prices.price import main; main()
File "/usr/local/lib/python3.7/site-packages/beancount/prices/price.py", line 354, in main
args, jobs, entries, dcontext = process_args()
File "/usr/local/lib/python3.7/site-packages/beancount/prices/price.py", line 347, in process_args
entries, args.date, args.inactive, args.undeclared))
File "/usr/local/lib/python3.7/site-packages/beancount/prices/find_prices.py", line 366, in get_price_jobs_at_date
default_source = import_source(undeclared_source)
File "/usr/local/lib/python3.7/site-packages/beancount/prices/find_prices.py", line 151, in import_source
__import__(module_name)
TypeError: __import__() argument 1 must be str, not bool
```

Based on my debugging, it seems that this is because the [--undeclared argument is being set to True](https://github.com/beancount/beancount/blob/19c8160fbaa29fd71aa3ad0d5b32f16a8397de0b/beancount/prices/price.py#L309), whereas it needs to specify a default source as indicated in the documentation for the --undeclared option.


Reply all
Reply to author
Forward
0 new messages