`.letter` is not valid with pycountry

Issue #12 resolved
Alex Barcelo created an issue

I see the following error:

Traceback (most recent call last):
  File "/home/abarcelo/virtualenv/sample_virtualenv/bin/csb2format", line 11, in <module>
    sys.exit(cmd.main())
  File "/home/abarcelo/virtualenv/sample_virtualenv/lib/python3.5/site-packages/csb43/utils/cmd.py", line 274, in main
    convert(args)
  File "/home/abarcelo/virtualenv/sample_virtualenv/lib/python3.5/site-packages/csb43/utils/cmd.py", line 237, in convert
    csb.showInfo(sys.stderr)
  File "/home/abarcelo/virtualenv/sample_virtualenv/lib/python3.5/site-packages/csb43/csb43/csb_file.py", line 395, in showInfo
    ib_currency=ac.currency.letter,
  File "/home/abarcelo/virtualenv/sample_virtualenv/lib/python3.5/site-packages/pycountry/db.py", line 22, in __getattr__
    raise AttributeError
AttributeError

It seems that csb43 is trying to use the .letter attribute on the pycountry's Currency object. But that object does not have a letter attribute. I don't know if that's something deprecated, or I have some version mix, or what. But it fails and I looked into the pycountry documentation and I am not sure how is supposed to work.

Problema descubierto con archivo "AEB43" (*.Q43) de "Caja Ingenieros". "Major" because that blocks the conversion originating from that file (could not come up with any workaround).

Comments (7)

  1. wmj repo owner

    Thank you for reporting. Could you please tell me which version of pycountry are you using?

    Gracias por avisar. ¿Podrías decirme la versión de pycountry que estás usando?

  2. Alex Barcelo reporter

    Sorry, forgot to include versions on the issue:

    Python 3.5.3

    csb43==0.5
    pycountry==17.1.8
    

    Everything freshly installed (today) through pip inside a virtualenv on a Linux (Ubuntu) machine. I haven't tested with any other csb files.

    OT: Do you prefer the follow-up for this issue in Spanish? Or do you prefer to have it in english? (Archival reasons maybe?)

  3. wmj repo owner

    Thank you. I'll try to reproduce the issue as soon as possible.

    OT: I don't really care the language, but I think by using English this issue can be found for more potentially affected people.

  4. wmj repo owner

    You were right, @alex_barcelo, pycountry renamed the field letter to alpha_3 in version 16.10.23rc1. I'll try to adapt the code in a few days.

  5. Log in to comment