Skip to content

Fixed Unicode coercion errors in logging. #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sickbeard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def getURLFileLike(url, validate=False, cookies = cookielib.CookieJar(), passwor
# Before python 2.7.9, there was no built-in way to validate SSL certificates
# Since our default is not to validate, it is of low priority to make it available here
if validate and sys.version_info < (2, 7, 9):
logger.log(u"The SSL certificate will not be validated for " + url + "(python 2.7.9+ required)", logger.MESSAGE)
logger.log(u"The SSL certificate will not be validated for " + str(url) + "(python 2.7.9+ required)", logger.MESSAGE)

opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
MultipartPostHandler.MultipartPostHandler,
Expand All @@ -224,42 +224,42 @@ def getURLFileLike(url, validate=False, cookies = cookielib.CookieJar(), passwor
return opener.open(url)

except urllib2.HTTPError, e:
logger.log(u"HTTP error " + str(e.code) + " while loading URL " + url, logger.WARNING)
logger.log(u"HTTP error " + str(e.code) + " while loading URL " + str(url), logger.WARNING)
if throw_exc:
raise
else:
return None

except urllib2.URLError, e:
logger.log(u"URL error " + str(e.reason) + " while loading URL " + url, logger.WARNING)
logger.log(u"URL error " + str(e.reason) + " while loading URL " + str(url), logger.WARNING)
if throw_exc:
raise
else:
return None

except BadStatusLine:
logger.log(u"BadStatusLine error while loading URL " + url, logger.WARNING)
logger.log(u"BadStatusLine error while loading URL " + str(url), logger.WARNING)
if throw_exc:
raise
else:
return None

except socket.timeout:
logger.log(u"Timed out while loading URL " + url, logger.WARNING)
logger.log(u"Timed out while loading URL " + str(url), logger.WARNING)
if throw_exc:
raise
else:
return None

except ValueError:
logger.log(u"Unknown error while loading URL " + url, logger.WARNING)
logger.log(u"Unknown error while loading URL " + str(url), logger.WARNING)
if throw_exc:
raise
else:
return None

except Exception:
logger.log(u"Unknown exception while loading URL " + url + ": " + traceback.format_exc(), logger.WARNING)
logger.log(u"Unknown exception while loading URL " + str(url) + ": " + traceback.format_exc(), logger.WARNING)
if throw_exc:
raise
else:
Expand Down