FS#68922 - [jupyter-nbconvert] nbconvert failed: module 'base64' has no attribute 'encodestring'

Attached to Project: Community Packages
Opened by Paul Hervot (Dettorer) - Thursday, 10 December 2020, 13:21 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 11 February 2023, 10:48 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Kyle Keen (keenerd)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When trying to render a jupyter notebook that contains SVG images to PDF (using "download as"), it fails with the internal error:

nbconvert failed: module 'base64' has no attribute 'encodestring'

Additional info:
* package version: 5.6.1-3
* This seems to be fixed in the latest versions of nbconvert: https://github.com/jupyter/nbconvert/commit/d9a893bf60e0e028259c953f2c9e272f0ae1b6c9

Steps to reproduce:
* open jupyter with `jupyter notebook`
* create a new Python3 notebook
* add the following code:

from graphviz import Source
from IPython.display import display
dot = """graph {2 -- 3}"""
display(Source(dot))

* run the cell(s), the output of the last one should be a simple graph rendered in SVG
* click "File" -> "Download as" -> "PDF via LaTeX (.pdf)"
* an error 500 should happen

I attached a minimal notebook containing the code referenced in the previous steps, along with the complete log of the jupyter session I got when reproducing the error with this notebook, and the error 500 I saw in the browser at the final step.
This task depends upon

Closed by  Antonio Rojas (arojas)
Saturday, 11 February 2023, 10:48 GMT
Reason for closing:  Fixed
Comment by Kyle Keen (keenerd) - Thursday, 31 December 2020, 04:51 GMT
Do you still get this error with 6.0.7?
Comment by Paul Hervot (Dettorer) - Sunday, 03 January 2021, 17:08 GMT
No, it's fixed, thank you!

Loading...