Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Apr 10, 2016

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

@laanwj
Copy link
Member

laanwj commented Apr 11, 2016

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

@laanwj
Copy link
Member

laanwj commented Apr 14, 2016

tACK faa41ee

@laanwj laanwj merged commit faa41ee into bitcoin:master Apr 14, 2016
laanwj added a commit that referenced this pull request Apr 14, 2016
faa41ee [qa] py2: Unfiddle strings into bytes explicitly (MarcoFalke)
@mruddy
Copy link
Contributor

mruddy commented Apr 14, 2016

@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

@maflcko maflcko deleted the Mf1604-qaBytes branch April 14, 2016 17:34
@maflcko
Copy link
Member Author

maflcko commented Apr 14, 2016

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

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Apr 15, 2016
Github-Pull: bitcoin#7853
Rebased-From: faa41ee, fa7abe0

 Conflicts:
	qa/rpc-tests/invalidtxrequest.py
	qa/rpc-tests/p2p-feefilter.py
	qa/rpc-tests/proxy_test.py
	qa/rpc-tests/test_framework/mininode.py
	qa/rpc-tests/test_framework/netutil.py
	src/test/bctest.py
str4d added a commit to str4d/zcash that referenced this pull request Feb 8, 2017
zkbot added a commit to zcash/zcash that referenced this pull request Feb 9, 2017
zkbot added a commit to zcash/zcash that referenced this pull request Feb 9, 2017
codablock pushed a commit to codablock/dash that referenced this pull request Dec 20, 2017
Missed due to conflict resolution in out-of-order backports
zkbot added a commit to zcash/zcash that referenced this pull request Aug 17, 2021
ZIP 239 preparations 4

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#5913
  - Replaces #3111.
  - Includes an extra commit included by upstream in the merge outside the PR.
- bitcoin/bitcoin#6519
- bitcoin/bitcoin#7179
- bitcoin/bitcoin#7853
- bitcoin/bitcoin#7960
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants