From 4832d278d39b7ff537d9cfde56cfe4261f2d6c13 Mon Sep 17 00:00:00 2001 From: Ogi Moore Date: Tue, 30 Dec 2014 17:53:29 -0800 Subject: [PATCH] Updated scikit-to-dash.py for python3.4 The code as it was errored out with urllib.urlretreive and I received a 'str' does not support buffer interface error on line 106. --- scikit-to-dash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scikit-to-dash.py b/scikit-to-dash.py index 4b432c4..df3d543 100644 --- a/scikit-to-dash.py +++ b/scikit-to-dash.py @@ -1,7 +1,7 @@ import requests import sqlite3 import os -import urllib +import urllib.request from bs4 import BeautifulSoup as bs @@ -20,7 +20,7 @@ def main(): # add icon icon = 'http://nbviewer.ipython.org/github/glouppe/talk-sklearn-mloss-nips2013/blob/master/oral/sklearn-logo.png' - urllib.urlretrieve(icon, docset_name + "/icon.png") + urllib.request.urlretrieve(icon, docset_name + "/icon.png") return docset_name @@ -103,7 +103,7 @@ def add_infoplist(): ""\ "".format(name, name, name, 'scikit-learn.org/stable/' + 'index.html') - open(docset_name + '/Contents/info.plist', 'wb').write(info) + open(docset_name + '/Contents/info.plist', 'wb').write(bytes(info, 'UTF-8')) if __name__ == '__main__':