Issue #287: oanda and yahoo sources fail with caching (blais/beancount)

32 views
Skip to first unread message

Jason Chu

unread,
Apr 30, 2018, 12:50:38 AM4/30/18
to bean...@googlegroups.com
New issue 287: oanda and yahoo sources fail with caching
https://bitbucket.org/blais/beancount/issues/287/oanda-and-yahoo-sources-fail-with-caching

Jason Chu:

If my price source looks like

1841-01-01 commodity CAD
export: "CASH"
name: "CA Dollar"
price: "USD:yahoo/^CAD=X"

or

1841-01-01 commodity CAD
export: "CASH"
name: "CA Dollar"
price: "USD:oanda/^USD_CAD"

bean-price gives me this output:

Traceback (most recent call last):
File "/usr/lib/python3.6/shelve.py", line 111, in __getitem__
value = self.cache[key]
KeyError: '36af117ec1697ec0980fa6e2b9309fbf'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/bean-price", line 4, in <module>
from beancount.prices.price import main; main()
File "/usr/lib/python3.6/site-packages/beancount/prices/price.py", line 349, in main
price_entries = sorted(price_entries, key=lambda e: e.currency)
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/beancount/prices/price.py", line 139, in fetch_price
srcprice = fetch_cached_price(source, psource.symbol, dprice.date)
File "/usr/lib/python3.6/site-packages/beancount/prices/price.py", line 84, in fetch_cached_price
timestamp_created, result = _CACHE[key]
File "/usr/lib/python3.6/shelve.py", line 114, in __getitem__
value = Unpickler(f).load()
AttributeError: Can't get attribute 'tzfile' on <module 'dateutil.zoneinfo' from '/usr/lib/python3.6/site-packages/dateutil/zoneinfo/__init__.py'>

If I call bean-price with --no-cache, everything works awesome. From what I can gather of the error, it looks like pickling some timezones isn't supported?


Reply all
Reply to author
Forward
0 new messages