summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.org>2014-11-12 12:36:03 -0500
committerKenneth Reitz <me@kennethreitz.org>2014-11-12 12:36:03 -0500
commit9dc660269f3270cf60ba5e1fd855e853241218d5 (patch)
tree093923b188f33f2e24cba5c5f7b73ac8a36436bc
parent1601387cbe1f91080803ddc6a9cb4d0df2d4869b (diff)
parentd505b94fa47dbce4eae4db09d0056b7808b71b01 (diff)
downloadpython-requests-9dc660269f3270cf60ba5e1fd855e853241218d5.tar.gz
Merge pull request #2309 from sigmavirus24/add-deprecation-warnings
Add DeprecationWarnings to inform users of plans
-rw-r--r--requests/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/requests/utils.py b/requests/utils.py
index 182348da..aa5c140e 100644
--- a/requests/utils.py
+++ b/requests/utils.py
@@ -19,6 +19,7 @@ import re
import sys
import socket
import struct
+import warnings
from . import __version__
from . import certs
@@ -287,6 +288,11 @@ def get_encodings_from_content(content):
:param content: bytestring to extract encodings from.
"""
+ warnings.warn((
+ 'In requests 3.0, get_encodings_from_content will be removed. For '
+ 'more information, please see the discussion on issue #2266. (This'
+ ' warning should only appear once.)'),
+ DeprecationWarning)
charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)
pragma_re = re.compile(r'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I)
@@ -354,6 +360,11 @@ def get_unicode_from_response(r):
2. fall back and replace all unicode characters
"""
+ warnings.warn((
+ 'In requests 3.0, get_unicode_from_response will be removed. For '
+ 'more information, please see the discussion on issue #2266. (This'
+ ' warning should only appear once.)'),
+ DeprecationWarning)
tried_encodings = []