Blob Blame History Raw
From d9a893bf60e0e028259c953f2c9e272f0ae1b6c9 Mon Sep 17 00:00:00 2001
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Date: Sat, 22 Feb 2020 21:32:21 +0530
Subject: [PATCH] Use encodebytes instead of encodestring in Python 3.9.

---
 nbconvert/preprocessors/svg2pdf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nbconvert/preprocessors/svg2pdf.py b/nbconvert/preprocessors/svg2pdf.py
index 3a1aa22a..33514ecc 100644
--- a/nbconvert/preprocessors/svg2pdf.py
+++ b/nbconvert/preprocessors/svg2pdf.py
@@ -123,6 +123,6 @@ def convert_figure(self, data_format, data):
             if os.path.isfile(output_filename):
                 with open(output_filename, 'rb') as f:
                     # PDF is a nb supported binary, data type, so base64 encode.
-                    return base64.encodestring(f.read())
+                    return base64.encodebytes(f.read())
             else:
                 raise TypeError("Inkscape svg to pdf conversion failed")