[qa] py2: Unfiddle strings into bytes explicitly #7853

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1604-qaBytes changing 28 files +205 −213
  1. MarcoFalke commented at 3:25 PM on April 10, 2016: member

    This will explicitly mark most strings as bytes. (Required for py3)

  2. [qa] py2: Unfiddle strings into bytes explicitly faa41ee204
  3. MarcoFalke force-pushed on Apr 10, 2016
  4. laanwj added the label Tests on Apr 11, 2016
  5. laanwj commented at 11:00 AM on April 11, 2016: member

    Awesome, this is the shittiest part of porting to Python 3. Concept ACK.

  6. laanwj commented at 3:41 PM on April 14, 2016: member

    tACK faa41ee

  7. laanwj merged this on Apr 14, 2016
  8. laanwj closed this on Apr 14, 2016

  9. laanwj referenced this in commit 6ef5e000a2 on Apr 14, 2016
  10. mruddy commented at 4:54 PM on April 14, 2016: contributor

    @MarcoFalke

    i noticed a new error when running make check:

    Running test/bitcoin-util-test.py...
    Traceback (most recent call last):
      File "./test/bitcoin-util-test.py", line 12, in <module>
        "bitcoin-util-test.json",buildenv)
      File "/home/black/Desktop/bitcoin/src/test/bctest.py", line 52, in bctester
        bctest(testDir, testObj, buildenv.exeext)
      File "/home/black/Desktop/bitcoin/src/test/bctest.py", line 30, in bctest
        outs = proc.communicate(input=inputData)
      File "/usr/lib/python3.4/subprocess.py", line 962, in communicate
        stdout, stderr = self._communicate(input, endtime, timeout)
      File "/usr/lib/python3.4/subprocess.py", line 1601, in _communicate
        self._save_input(input)
      File "/usr/lib/python3.4/subprocess.py", line 1677, in _save_input
        self._input = self._input.encode(self.stdin.encoding)
    AttributeError: 'bytes' object has no attribute 'encode'
    

    this makes the error go away, but is probably not what you want since it only undoes one of this PR's changes:

    diff --git a/src/test/bctest.py b/src/test/bctest.py
    index fc59152..dbff278 100644
    --- a/src/test/bctest.py
    +++ b/src/test/bctest.py
    @@ -17,7 +17,7 @@ def bctest(testDir, testObj, exeext):
            inputData = None
            if "input" in testObj:
                    filename = testDir + "/" + testObj['input']
    -               inputData = open(filename, 'rb').read()
    +               inputData = open(filename).read()
                    stdinCfg = subprocess.PIPE
    
            outputFn = None
    
  11. MarcoFalke deleted the branch on Apr 14, 2016
  12. MarcoFalke commented at 5:35 PM on April 14, 2016: member

    @mruddy Thanks for reporting, I will take a look...

  13. MarcoFalke referenced this in commit 551a38b1e5 on Apr 15, 2016
  14. MarcoFalke referenced this in commit f1f1b82033 on Apr 15, 2016
  15. nomnombtc referenced this in commit a8f2079c8e on Nov 11, 2016
  16. nomnombtc referenced this in commit 2386dd3087 on Nov 12, 2016
  17. nomnombtc referenced this in commit f8a577cea9 on Nov 13, 2016
  18. sickpig referenced this in commit 5236cc16e7 on Nov 14, 2016
  19. str4d referenced this in commit 5ed8edcf3d on Jan 31, 2017
  20. str4d referenced this in commit c7cb3c13ea on Feb 8, 2017
  21. zkbot referenced this in commit 36df5a92f8 on Feb 9, 2017
  22. zkbot referenced this in commit dd8b38316f on Feb 9, 2017
  23. zkbot referenced this in commit 253c610783 on Feb 9, 2017
  24. codablock referenced this in commit 147e9c96a7 on Sep 16, 2017
  25. codablock referenced this in commit c4589a5071 on Sep 19, 2017
  26. codablock referenced this in commit ac53190bfe on Dec 20, 2017
  27. zkbot referenced this in commit 19a8c45f42 on Aug 13, 2021
  28. zkbot referenced this in commit 8e9f44cbe2 on Aug 13, 2021
  29. zkbot referenced this in commit cf9a0799b4 on Aug 17, 2021
  30. MarcoFalke 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: 2026-04-14 15:15 UTC

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