Skip to content

Problem: Error when building Handcrafting Transactions docs #476

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

Merged
merged 2 commits into from
Sep 11, 2018
Merged

Problem: Error when building Handcrafting Transactions docs #476

merged 2 commits into from
Sep 11, 2018

Conversation

ttmc
Copy link
Contributor

@ttmc ttmc commented Sep 6, 2018

The docs would build, but the generated "Handcrafting Transactions" page was full of valid Python errors of the form:
TypeError: Object of type 'bytes' is not JSON serializable

I guess sometimes people want to show the actual error messages in their docs, so such errors don't prevent Sphinx from thinking everything is okay.

Solution: Use base58.b58encode(key).decode() which is a str, instead of base58.b58encode(key) which is a bytes object. I defined a little helper function named b58() to reduce verbosity.

I don't know if this will get ReadTheDocs to start working (as per issue #475), but it does remove all the "Traceback" messages in the "Handcrafting Transactions" page of the docs.

TypeError: Object of type 'bytes' is not JSON serializable

Solution: Use base58.b58encode(key).decode() which is a str,
instead of base58.b58encode(key) which is a bytes object
@ttmc ttmc added the docs label Sep 6, 2018
@ttmc ttmc self-assigned this Sep 6, 2018
@ttmc ttmc requested a review from codegeschrei September 6, 2018 19:35
@ttmc
Copy link
Contributor Author

ttmc commented Sep 6, 2018

@codegeschrei I'm not sure why some tests in Travis are failing. They seem unrelated to the changes I made in this pull request.

@codecov-io
Copy link

Codecov Report

Merging #476 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #476   +/-   ##
=======================================
  Coverage   98.74%   98.74%           
=======================================
  Files           5        5           
  Lines         239      239           
=======================================
  Hits          236      236           
  Misses          3        3

@ttmc ttmc merged commit 49862f3 into bigchaindb:master Sep 11, 2018
@ttmc ttmc deleted the fix-encoding-errors-in-docs branch September 11, 2018 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants