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

AttributeError: 'NoneType' object has no attribute 'write' #40

Open
pusteckiy opened this issue Sep 15, 2024 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'write' #40

pusteckiy opened this issue Sep 15, 2024 · 1 comment

Comments

@pusteckiy
Copy link

Got this error while getting account state.

File "/home/cloud/src/parsers/user.py", line 113, in get_user_data
    state = await client.get_account_state(sc_address)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/balancer.py", line 353, in get_account_state
    return await self.execute_method('get_account_state', **self._get_args(locals()))
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/balancer.py", line 267, in execute_method
    resp = await peer_meth(*args, **kwargs)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/client.py", line 488, in get_account_state
    return SimpleAccount.from_raw((await self.raw_get_account_state(address))[0], address)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/client.py", line 462, in raw_get_account_state
    result = await self.liteserver_request('getAccountState', data)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/client.py", line 288, in liteserver_request
    return await self.liteserver_query(data, qid)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/client.py", line 275, in liteserver_query
    resp = await self.send_and_encrypt(data, qid)
  File "/home/cloud/env/lib/python3.10/site-packages/pytoniq/liteclient/client.py", line 137, in send_and_encrypt
    self.writer.write(self.encrypt(data))
AttributeError: 'NoneType' object has no attribute 'write'
@pavelhardzei
Copy link

pavelhardzei commented Oct 15, 2024

Got the same error for unknown reason while parsing transactions. Managed to solve just replaced declaration of LiteBalancer using context manager ( async with statement )

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

No branches or pull requests

2 participants