Skip to content

Commit bcf573e

Browse files
author
Martin Journois
committed
Fix python3 bug with base64 encode
1 parent 121508a commit bcf573e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

folium/element.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ENV = Environment(loader=PackageLoader('folium', 'templates'))
1212
from collections import OrderedDict
1313
import json
14+
import base64
1415

1516
from .six import urlopen
1617
from .utilities import _camelify, _parse_size
@@ -266,7 +267,7 @@ def _repr_html_(self, **kwargs):
266267

267268
iframe = '<iframe src="{html}" width="{width}px" height="{height}px"></iframe>'\
268269
.format(\
269-
html = "data:text/html;base64,"+html.encode('utf8').encode('base64'),
270+
html = b"data:text/html;base64,"+base64.b64encode(html.encode('utf8')),
270271
#html = self.HTML.replace('"','&quot;'),
271272
width = int(60.*width),
272273
height= int(60.*height),

0 commit comments

Comments
 (0)