Note that rpcuser.py
seems to handle either version when called explicitly like python2 rpcuser.py
/ python3 rpcuser.py
. This change allows the user’s python
to be used to interpret the script.
There’s not always a python2
installed, e.g. if only Python 3.0+ is installed as python
/ python3
, like on Arch Linux (https://github.com/hkjn/src/blob/master/bitcoin/Dockerfile#L14) but python
is almost always present.
Tested
Script is already compatible with both major versions:
0$ python2 share/rpcuser/rpcuser.py foobar
1String to be appended to bitcoin.conf:
2rpcauth=foobar:2951d04c215769c8887c1fa4a8f712c$63c9a08e3b69f811e3837c0d5b6a355b7f798afc7094d80008f5c56a056c387f
3Your password:
4TV4I54T6W38v1sj3iF4Xsw7A-wYav-Cn8uTr8qv4xZ8=
5
6$ python3 share/rpcuser/rpcuser.py foobar
7String to be appended to bitcoin.conf:
8rpcauth=foobar:129afbbd214c1f85fb6b9941402506f$4c5af73a2f3fd0a1d8232c28bc5c36f9b0cffd62b7b139beb328d089b16028dc
9Your password:
10qqbeWrGHqbYL1tUDh1wHKkejzxiGvOa3SPkDbbCwBfs=
11
12$ python2 --version
13Python 2.7.12
14
15$ python3 --version
16Python 3.5.2