[bp] Missing Solésio Vie support
For some reason, calling get_history()
for the retirement_hist
case is limited with account.type
== Account.TYPE_PERP
, while it would seem to make sense for Account.TYPE_LIFE_INSURANCE
as well. The latter is used for e.g. “Solésio Vie” plans.
I don't have the exact date when it broke, but AFAICT Solésio Vie used to work until around early 2017.
The attached patch makes it work (again) and tools/local_run.sh boobank history -f csv
on that specific account gets me something along those lines:
id;url;date;rdate;vdate;bdate;type;raw;category;label;amount;card;commission;original_amount;original_currency;country;original_commission;original_commission_currency;investments
@bp;Not loaded;2019-07-03;Not loaded;Not loaded;Not loaded;0;Not loaded;Not loaded;Versement régulier;XXXX.XX;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;[]
@bp;Not loaded;2019-06-11;Not loaded;Not loaded;Not loaded;0;Not loaded;Not loaded;Réinvestissement de dividendes;XXXXX.XX;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;Not loaded;[]
Printing that on the console is fine but trying to redirect to a file or a pipe explodes with encoding-related issues though:
File "/home/kibi/work/tools/weboob-devel-bp.git/weboob/tools/application/formatters/csv.py", line 59, in write_dict
writer.writerow([to_unicode(v).encode('utf-8') for v in item.values()])
File "/usr/lib/python2.7/codecs.py", line 369, in write
data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 94: ordinal not in range(128)
Switching from the default python2
to python3
by adding a -3
flag to tools/local_run.sh
makes the encoding issue go away.
I'm not sure what the issue is, given the use of CleanText()
, which is supposed to coerce stuff to Unicode anyway.
0001-bp-Allow-TYPE_LIFE_INSURANCE-to-call-get_history-for.patch