summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-16 01:11:16 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-03-16 01:11:16 (GMT)
commit6b3434ae04f32a20e20498ec5a594d527e1c24e3 (patch)
tree47bc983269e09238ee3fdca6377a8dd6b855bb30 /Lib/urllib
parent73277fe0ebd07b470e43804c24282a4947a63341 (diff)
downloadcpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.zip
cpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.tar.gz
cpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.tar.bz2
Explain the use of charset parameter with Content-Type header. Issue11082
Diffstat (limited to 'Lib/urllib')
-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 94b713e..fe2cfcd 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',