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

ING DIBA - get_holdings method broken #85

Open
matwid opened this issue Jul 8, 2019 · 3 comments
Open

ING DIBA - get_holdings method broken #85

matwid opened this issue Jul 8, 2019 · 3 comments

Comments

@matwid
Copy link

matwid commented Jul 8, 2019

Hi Raphael, hi everybody,

thanks for this great project. Recently I found the get_holdings method is not working anymore for the ING.

Problem:

It seems they return bytes instead of strings:
TypeError: descriptor 'splitlines' requires a 'str' object but received a 'bytes'

Hence, the following line in client.py doesn't work anymore for me:
mt535_lines = str.splitlines(resp.holdings)

Solution:

with the following (dirty) hack:

            try:
                mt535_lines = str.splitlines(resp.holdings)                
                del mt535_lines[0] # The first line is empty - drop it.
            except:
                mt535_lines = str(resp).split('\\r\\n')
                mt535_lines = mt535_lines[:-1]  # The last line is empty - drop it.

it works again.
Would be great to have this, or in another (better) way implemented.

Thank you very much in advance and best wishes,
Mat

@raphaelm
Copy link
Owner

Hi @matwid, thanks for reporting! I can't really work on this function as I don't have a bank account that supports it.

Can you check if it's sufficient to just replace str.splitlines(resp.holdings) by str.splitlines(resp.holdings.decode())? The type change might be a side effect of the parser rewrite in 2.0.

@foo-git
Copy link

foo-git commented Jul 19, 2019

Hi Raphael,
I experienced the same bug as @matwid (but I did a different workaround), and I can confirm your change works for the bank account I use.

However, I have two bank accounts which yield different resp types when querying the holdings, and in that case I have to resort to the original code. My workaround in client.py (lines 626 and below) introduces an if-else clause and looks therefore like that:

for resp in responses:
    if type(resp.holdings) == bytes:
        holding_str = resp.holdings.decode()
    else:
        holding_str = resp.holdings

    mt535_lines = str.splitlines(holding_str)
    # The first line is empty - drop it.
    del mt535_lines[0]
    ....

Hope that helps.

@Tricade
Copy link

Tricade commented Feb 11, 2020

Hi @foo-git and @matwid,

can i ask you both, how you pass the TAN at the ING?

Exception: Cannot change TAN mechanism with a standing dialog
The above exception was the direct cause of the following exception:

I always get this Exception.

Grretings,
Tricade

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

No branches or pull requests

4 participants