rpcuser.py: Use ‘python’ not ‘python2’ #11830

pull hkjn wants to merge 1 commits into bitcoin:master from hkjn:rpcuser-py changing 1 files +1 −1
  1. hkjn commented at 2:53 pm on December 5, 2017: contributor

    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
    
  2. rpcuser.py: Use 'python' not 'python2' 6d2f277b19
  3. TheBlueMatt commented at 4:40 pm on December 5, 2017: member
    Hmm, given the deprecation of rpcuser/rpcpassword in favor of the cookie auth, maybe we should simply remove rpcuser instead?
  4. achow101 commented at 4:41 pm on December 5, 2017: member
    @TheBlueMatt rpcuser.py is for rpcauth, not rpcuser/rpcpassword. It should probably be renamed.
  5. laanwj commented at 10:45 am on December 6, 2017: member
    utACK. (assuming you have tested compatibility of this code with python 3)
  6. laanwj added the label Utils/log/libs on Dec 6, 2017
  7. laanwj added the label Scripts and tools on Dec 6, 2017
  8. laanwj removed the label Utils/log/libs on Dec 6, 2017
  9. hkjn commented at 10:51 am on December 6, 2017: contributor
    Thanks @laanwj. I’ve updated the PR description to show compatibility with both major Python versions. @achow101 @TheBlueMatt: I’d be happy to rename rpcuser.py to rpcauth.py, or similar, in a follow-up PR.
  10. laanwj commented at 11:04 am on December 6, 2017: member

    I’ve updated the PR description to show compatibility with both major Python versions.

    Thanks, clear.

    I’d be happy to rename rpcuser.py to rpcauth.py, or similar, in a follow-up PR.

    Yes, let’s leave that for a future PR, and not diffuse the scope of this trivial change.

  11. laanwj merged this on Dec 6, 2017
  12. laanwj closed this on Dec 6, 2017

  13. laanwj referenced this in commit a13e443851 on Dec 6, 2017
  14. hkjn commented at 1:13 pm on December 6, 2017: contributor
    I sent #11836 as the follow-up to rename the script to rpcauth.py.
  15. hkjn deleted the branch on Dec 6, 2017
  16. laanwj referenced this in commit d44535d818 on Dec 11, 2017
  17. PastaPastaPasta referenced this in commit 1a713358c5 on Feb 13, 2020
  18. PastaPastaPasta referenced this in commit cce805d69a on Feb 13, 2020
  19. PastaPastaPasta referenced this in commit 6a53dc97cb on Feb 27, 2020
  20. PastaPastaPasta referenced this in commit 975e69eb25 on Feb 27, 2020
  21. PastaPastaPasta referenced this in commit 85ccc76615 on Feb 27, 2020
  22. PastaPastaPasta referenced this in commit 07316dda2c on Feb 27, 2020
  23. PastaPastaPasta referenced this in commit edfb8fcb6d on Mar 14, 2020
  24. PastaPastaPasta referenced this in commit d9c913479a on Mar 19, 2020
  25. PastaPastaPasta referenced this in commit 53fd996aaf on Mar 28, 2020
  26. ckti referenced this in commit 2f086cce9a on Mar 28, 2021
  27. ckti referenced this in commit 11fd85ff6d on Mar 28, 2021
  28. gades referenced this in commit 48881c3548 on Jun 28, 2021
  29. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me