Issue #409: csv importer crashes on Python 3.8 (blais/beancount)

21 views
Skip to first unread message

Toke Høiland-Jørgensen

unread,
Nov 18, 2019, 5:45:33 AM11/18/19
to bean...@googlegroups.com
New issue 409: csv importer crashes on Python 3.8
https://bitbucket.org/blais/beancount/issues/409/csv-importer-crashes-on-python-38

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:



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




Reply all
Reply to author
Forward
0 new messages