Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding error for sign_data on centos6 Python 2.7.5 #11

Open
F483 opened this issue Sep 22, 2015 · 3 comments
Open

Encoding error for sign_data on centos6 Python 2.7.5 #11

F483 opened this issue Sep 22, 2015 · 3 comments
Assignees
Labels

Comments

@F483
Copy link
Owner

F483 commented Sep 22, 2015

Source StorjOld/dataserv-client#83 (comment)

  File "/usr/lib/python2.7/site-packages/btctxstore/api.py", line 191, in sign_unicode
    return self.sign_data(wif, hexdata)
  File "/usr/lib/python2.7/site-packages/btctxstore/api.py", line 174, in sign_data
    sigdata = control.sign_data(self.testnet, data, key)
  File "/usr/lib/python2.7/site-packages/btctxstore/control.py", line 300, in sign_data
    sig = _add_recovery_params(i, compressed, sigdata)
  File "/usr/lib/python2.7/site-packages/btctxstore/control.py", line 283, in _add_recovery_params
    return struct.pack(">B", params) + sigdata
TypeError: Struct() argument 1 must be string, not unicode
@littleskunk
Copy link
Contributor

Bug in older python verison. See http://python-future.org/stdlib_incompatibilities.html

@littleskunk
Copy link
Contributor

wolfch [11:00]
If I patch the affected line: return struct.pack(">B", params) + sigdata
By encoding the stirng: return struct.pack(">B".encode('ascii'), params) + sigdata
Then everything works fine....

@F483
Copy link
Owner Author

F483 commented Oct 24, 2015

If that fixes everything, you should make a pull request with your changes.

littleskunk added a commit to littleskunk/btctxstore that referenced this issue Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants