Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2016-11-13 23:00:03 +0100
committerArthur de Jong <arthur@arthurdejong.org>2016-11-13 23:00:06 +0100
commitac560a764dca5eb36634458522db13a7e2212e83 (patch)
tree646742f6985c89a47f08515414bd39824ac8a6e2
parent458c310d3bcc0dca4d4db776d3950757ff2b2c76 (diff)
Update getisbn to Python3
There were some SSL-related issues with the urllib module. This was the easiest solution.
-rwxr-xr-xgetisbn.py10
1 files 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)