From ac560a764dca5eb36634458522db13a7e2212e83 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 13 Nov 2016 23:00:03 +0100 Subject: Update getisbn to Python3 There were some SSL-related issues with the urllib module. This was the easiest solution. --- getisbn.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/getisbn.py b/getisbn.py index 5377565..5755df5 100755 --- a/getisbn.py +++ b/getisbn.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # getisbn.py - script to get ISBN prefix data # -# Copyright (C) 2010, 2011, 2014 Arthur de Jong +# Copyright (C) 2010-2016 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,7 @@ to correctly split ISBNs into an EAN.UCC prefix, a group prefix, a registrant, an item number and a check-digit.""" from xml.etree import ElementTree -import urllib +import urllib.request # the location of the ISBN Ranges XML file @@ -55,7 +55,7 @@ def get(f=None): if f is None: yield '# generated from RangeMessage.xml, downloaded from' yield '# %s' % download_url - f = urllib.urlopen(download_url) + f = urllib.request.urlopen(download_url) else: yield '# generated from %r' % f @@ -87,4 +87,4 @@ def get(f=None): if __name__ == '__main__': # get('RangeMessage.xml') for row in get(): - print row.encode('utf-8') + print(row) -- cgit v1.2.3