Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnucash2ledger: -s option triggers AttributeError: 'NoneType' object has no attribute 'upper' #6

Open
jmarshallidau opened this issue Aug 1, 2022 · 0 comments

Comments

@jmarshallidau
Copy link

If invoked with -s gnucash2ledger emits the following error. The attached patch "fixes" the problem in that the -s functionality now works, but I'm sure it's not the proper soution. I'm not a python programmer but I'm guessing it's some kind of type mismatch with "None".

Error

Traceback (most recent call last):
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 791, in <module>
    main()
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 778, in main
    convertor = LedgerConvertor(args)
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 482, in __init__
    self.gcashData = GnucashData(
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 453, in __init__
    Account(self.accountDb, acc, useSymbols=useSymbols)
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 120, in __init__
    self.commodity = get_currency_symbol(
  File "/Users/john/rwfin/2022/gnucash2ledger.py", line 594, in get_currency_symbol
    return CurrencySymbols.get_symbol(currency_code) or currency_code
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/currency_symbols/currency_symbols.py", line 23, in get_symbol
    return CURRENCY_SYMBOLS_MAP.get(currency.upper(), None)
AttributeError: 'NoneType' object has no attribute 'upper'

Patch

currency_code.diff.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant