diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-03-16 01:11:16 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-03-16 01:11:16 (GMT) |
commit | 6b3434ae04f32a20e20498ec5a594d527e1c24e3 (patch) | |
tree | 47bc983269e09238ee3fdca6377a8dd6b855bb30 /Lib/urllib | |
parent | 73277fe0ebd07b470e43804c24282a4947a63341 (diff) | |
download | cpython-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.py | 5 |
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', |