beancount / beangulp

Importers framework for Beancount
GNU General Public License v2.0
54 stars 22 forks source link

csv importer crashes on Python 3.8 #20

Closed blais closed 3 years ago

blais commented 4 years ago

Original report by Toke Høiland-Jørgensen.


When trying to use the csv ingester with Python 3.8, I get a crash with a traceback ending in this:

  File "/usr/lib/python3.8/site-packages/beancount/ingest/importers/csv.py", line 162, in __init__
    super().__init__(**kwds)
  File "/usr/lib/python3.8/site-packages/beancount/ingest/importers/mixins/identifier.py", line 65, in __init__
    super().__init__(**kwds)
  File "/usr/lib/python3.8/site-packages/beancount/ingest/importers/mixins/filing.py", line 30, in __init__
    super().__init__(**kwds)
TypeError: object.__init__() takes exactly one argument (the instance to initialize)

It seems it is no longer possible to just blindly pass up args to __init__ like that.

I’ve locally patched the init method of FilingMixin to do this instead, which seems to work:

        if isinstance(super(), importer.ImporterProtocol):
            super().__init__(**kwds)

blais commented 4 years ago

Original comment by Daniele Nicolodi (Bitbucket: daniele, GitHub: dnicolodi).


I cannot reproduce this and I don’t understand how your solution could help: how does the FilingMixing class end inheriting from anything else than importer.ImporterProtocol? Can you please share a complete and minimal reproducer fro the issue? Thank you!

blais commented 4 years ago

Original comment by Toke Høiland-Jørgensen.


Huh, that’s weird. I reverted my “fix”, and now I can’t reproduce the issue either :/

Ah well, let’s just close this issue for now, and I’ll re-open with a reproducer if I run into it again…

blais commented 4 years ago

Original comment by Toke Høiland-Jørgensen.


Can't reproduce