settings.allow_unicode
authorKenneth Reitz <me@kennethreitz.com>
Sat, 20 Aug 2011 23:43:36 +0000 (19:43 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Sat, 20 Aug 2011 23:43:36 +0000 (19:43 -0400)
requests/config.py
requests/models.py

index 39be2ed..5a7fcd3 100644 (file)
@@ -62,6 +62,7 @@ settings.proxies = None
 settings.verbose = None
 settings.timeout = None
 settings.max_redirects = 30
+settings.allow_unicode = True
 
 #: Use socket.setdefaulttimeout() as fallback?
 settings.timeout_fallback = True
index 2643689..d348314 100644 (file)
@@ -453,12 +453,8 @@ class Response(object):
                     pass
 
             # Decode unicode content.
-            try:
+            if settings.allow_unicode:
                 self._content = get_unicode_from_response(self)
-            # Don't trust this stuff.
-            except UserWarning, e:
-                print e
-
 
             return self._content