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

Altcoin based nubit got error with NuParserv007.py #5

Open
followtheart opened this issue Apr 3, 2016 · 1 comment
Open

Altcoin based nubit got error with NuParserv007.py #5

followtheart opened this issue Apr 3, 2016 · 1 comment

Comments

@followtheart
Copy link

Get error when running NuParserv007:

/home/NuExplorerOS# python pythonparser/NuParserv007.py
Traceback (most recent call last):
  File "pythonparser/NuParserv007.py", line 32, in <module>
    BlockCount =  getInfo["blocks"]
TypeError: 'NoneType' object has no attribute '__getitem__'

I do some test:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from bitcoinrpc.authproxy import AuthServiceProxy
>>> import logging
>>> logging.basicConfig()
>>> logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)
>>> ac = AuthServiceProxy('http://user:pass@127.0.0.1:14001')
>>> ac.getinfo()
DEBUG:BitcoinRPC:-1-> getinfo []
DEBUG:BitcoinRPC:<-1- {"connections": 1, "errors": "", "blocks": 400, "keypoolsize": 101, "moneysupply": 80000000.0, "walletunit": "S", "ip": "xx.xx.4.190", "keypoololdest": 1459236028, "stake": 0.0, "paytxfee": 1.0, "walletversion": 1, "difficulty": 0.00024414, "testnet": false, "version": "v2.1.0.0-unk-beta", "parked": 0.0, "protocolversion": 50000, "timeoffset": 0, "newmint": 0.0, "balance": 0.0, "proxy": ""}
>>> acinfo = ac.getinfo()
DEBUG:BitcoinRPC:-2-> getinfo []
DEBUG:BitcoinRPC:<-2- {"connections": 1, "errors": "", "blocks": 400, "keypoolsize": 101, "moneysupply": 80000000.0, "walletunit": "S", "ip": "xx.xx.4.190", "keypoololdest": 1459236028, "stake": 0.0, "paytxfee": 1.0, "walletversion": 1, "difficulty": 0.00024414, "testnet": false, "version": "v2.1.0.0-unk-beta", "parked": 0.0, "protocolversion": 50000, "timeoffset": 0, "newmint": 0.0, "balance": 0.0, "proxy": ""}
>>> print(acinfo)
None
>>>

Ask for advices 🆘

@JetJet13
Copy link
Owner

JetJet13 commented Apr 7, 2016

Hey @followtheart thanks for showing interest in NuExplorer. In terms of your issue, TypeError: 'NoneType' object has no attribute '__getitem__' means that the variable getInfo is None, and so you can't return a value from a None variable. So one solution is to simply remove the variable getInfo, and replace it with BlockCount = access.getinfo()["blocks"]

Let me know if it works. Cheers.

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