From 85ccc76615bf33eb0077ede73fd1cf37189761d7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 6 Dec 2017 12:04:32 +0100 Subject: [PATCH] Merge #11830: rpcuser.py: Use 'python' not 'python2' 6d2f277 rpcuser.py: Use 'python' not 'python2' (Henrik Jonsson) Pull request description: 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: ``` $ python2 share/rpcuser/rpcuser.py foobar String to be appended to bitcoin.conf: rpcauth=foobar:2951d04c215769c8887c1fa4a8f712c$63c9a08e3b69f811e3837c0d5b6a355b7f798afc7094d80008f5c56a056c387f Your password: TV4I54T6W38v1sj3iF4Xsw7A-wYav-Cn8uTr8qv4xZ8= $ python3 share/rpcuser/rpcuser.py foobar String to be appended to bitcoin.conf: rpcauth=foobar:129afbbd214c1f85fb6b9941402506f$4c5af73a2f3fd0a1d8232c28bc5c36f9b0cffd62b7b139beb328d089b16028dc Your password: qqbeWrGHqbYL1tUDh1wHKkejzxiGvOa3SPkDbbCwBfs= $ python2 --version Python 2.7.12 $ python3 --version Python 3.5.2 ``` Tree-SHA512: b5d6de15507cfd8dbb520325cf0b67fa471fa4fe3661de4ea6841fadb6ec9ba65d0c4f545f58578168c9ce9f6e483d613cce31ab3dd28117510bf9cada3b7b91 --- share/rpcuser/rpcuser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/rpcuser/rpcuser.py b/share/rpcuser/rpcuser.py index ab3d8c4ed3..6d9b44f699 100755 --- a/share/rpcuser/rpcuser.py +++ b/share/rpcuser/rpcuser.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python3 -# Copyright (c) 2015 The Bitcoin Core developers +#!/usr/bin/env python +# Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php.