changeset 948:f2fbe2b0d25d

Use unicode to log messages.
author Brian Neal <bgneal@gmail.com>
date Sat, 16 May 2015 15:02:04 -0500
parents 49646a78e965
children b8c3863e34d2
files oembed/management/commands/oembed_refresh.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/oembed/management/commands/oembed_refresh.py	Sat May 16 14:36:31 2015 -0500
+++ b/oembed/management/commands/oembed_refresh.py	Sat May 16 15:02:04 2015 -0500
@@ -49,7 +49,7 @@
             endpoint = p.api_endpoint
             break
     else:
-        logger.error("No provider found for %s", oembed)
+        logger.error(u"No provider found for %s", oembed)
         return
 
     html = None
@@ -60,18 +60,18 @@
                             scheme='https')
     except urllib2.HTTPError as ex:
         if 400 <= ex.code < 500:
-            logger.error("Server could not handle request for %s: %d", oembed, ex.code)
+            logger.error(u"Server could not handle request for %s: %d", oembed, ex.code)
             html = error_html(oembed)
         else:
-            logger.critical("Server error during request for %s: %d", oembed, ex.code)
+            logger.critical(u"Server error during request for %s: %d", oembed, ex.code)
 
     except urllib2.URLError as ex:
-        logger.critical("Failed to reach provider for %s: %s", oembed, ex.reason)
+        logger.critical(u"Failed to reach provider for %s: %s", oembed, ex.reason)
     else:
         html = result['html']
 
     if html:
-        logger.info("Updating %s", oembed)
+        logger.info(u"Updating %s", oembed)
         oembed.html = html
         oembed.save()