summaryrefslogtreecommitdiff
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-15 18:11:16 -0700
committerSenthil Kumaran <senthil@uthcode.com>2012-03-15 18:11:16 -0700
commit6b3434ae04f32a20e20498ec5a594d527e1c24e3 (patch)
tree47bc983269e09238ee3fdca6377a8dd6b855bb30 /Lib/urllib/request.py
parent73277fe0ebd07b470e43804c24282a4947a63341 (diff)
downloadcpython-git-6b3434ae04f32a20e20498ec5a594d527e1c24e3.tar.gz
Explain the use of charset parameter with Content-Type header. Issue11082
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 94b713e885..fe2cfcdbbe 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1062,8 +1062,9 @@ class AbstractHTTPHandler(BaseHandler):
if request.data is not None: # POST
data = request.data
if isinstance(data, str):
- raise TypeError("POST data should be bytes"
- " or an iterable of bytes. It cannot be str.")
+ msg = "POST data should be bytes or an iterable of bytes."\
+ "It cannot be str"
+ raise TypeError(msg)
if not request.has_header('Content-type'):
request.add_unredirected_header(
'Content-type',