diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-03-16 01:15:34 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-03-16 01:15:34 (GMT) |
commit | e53d977e8077759e8123da3da563e6b73392ed8b (patch) | |
tree | faa4a6080a07916bd82bec55c7eee60458c3c964 /Lib/urllib | |
parent | df2aecbf61a157b8a6a865cb2d946e65b887b774 (diff) | |
parent | 6b3434ae04f32a20e20498ec5a594d527e1c24e3 (diff) | |
download | cpython-e53d977e8077759e8123da3da563e6b73392ed8b.zip cpython-e53d977e8077759e8123da3da563e6b73392ed8b.tar.gz cpython-e53d977e8077759e8123da3da563e6b73392ed8b.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 7a5b0e2..a5f0866 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1172,8 +1172,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', |