diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index 8555a85a8e..33ab6d7060 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -351,7 +351,7 @@ class Worker(Thread): # Get details {{{ if self.testing: import tempfile import uuid - with tempfile.NamedTemporaryFile(prefix=(asin or str(uuid.uuid4())) + '_', + with tempfile.NamedTemporaryFile(prefix=(asin or type('')(uuid.uuid4())) + '_', suffix='.html', delete=False) as f: f.write(raw) print('Downloaded html for', asin, 'saved in', f.name) diff --git a/src/calibre/ebooks/metadata/sources/edelweiss.py b/src/calibre/ebooks/metadata/sources/edelweiss.py index b9575663bf..8909491132 100644 --- a/src/calibre/ebooks/metadata/sources/edelweiss.py +++ b/src/calibre/ebooks/metadata/sources/edelweiss.py @@ -139,7 +139,7 @@ def get_basic_data(browser, log, *skus): 'orderID': '0', 'mailingID': '', 'tContentWidth': '926', - 'originalOrder': ','.join(str(i) for i in range(len(skus))), + 'originalOrder': ','.join(type('')(i) for i in range(len(skus))), 'selectedOrderID': '0', 'selectedSortColumn': '0', 'listType': '1', @@ -255,7 +255,7 @@ class Edelweiss(Source): return None params = { 'q': (' '.join(keywords)).encode('utf-8'), - '_': str(int(time.time())) + '_': type('')(int(time.time())) } return BASE_URL+urlencode(params) diff --git a/src/calibre/ebooks/metadata/sources/google.py b/src/calibre/ebooks/metadata/sources/google.py index 66f5787799..0f7a42e71c 100644 --- a/src/calibre/ebooks/metadata/sources/google.py +++ b/src/calibre/ebooks/metadata/sources/google.py @@ -121,7 +121,7 @@ def to_metadata(browser, log, entry_, timeout): # {{{ # ISBN isbns = [] for x in identifier(extra): - t = str(x.text).strip() + t = type('')(x.text).strip() if t[:5].upper() in ('ISBN:', 'LCCN:', 'OCLC:'): if t[:5].upper() == 'ISBN:': t = check_isbn(t[5:])