]> granicus.if.org Git - python/commitdiff
cpython:Fix the wrong urllib exampls which use str for POST data. Closes Issue11261
authorSenthil Kumaran <senthil@uthcode.com>
Thu, 15 Mar 2012 01:11:46 +0000 (18:11 -0700)
committerSenthil Kumaran <senthil@uthcode.com>
Thu, 15 Mar 2012 01:11:46 +0000 (18:11 -0700)
1  2 
Doc/howto/urllib2.rst
Doc/library/urllib.request.rst

Simple merge
index ef5d2daf6fa2fba600a47ab67beea3316196d024,24e24443ab2316afad5518efef5f3488d2bc537a..0bcd0bca5558f6160c3541e144e97e3f1c812592
@@@ -1174,16 -1120,9 +1173,16 @@@ some point in the future
     third argument may be ``-1`` on older FTP servers which do not return a file
     size in response to a retrieval request.
  
 +   The following example illustrates the most common usage scenario::
 +
 +      >>> import urllib.request
 +      >>> local_filename, headers = urllib.request.urlretrieve('http://python.org/')
 +      >>> html = open(local_filename)
 +      >>> html.close()
 +
     If the *url* uses the :file:`http:` scheme identifier, the optional *data*
     argument may be given to specify a ``POST`` request (normally the request
-    type is ``GET``).  The *data* argument must in standard
+    type is ``GET``).  The *data* argument must be a bytes object in standard
     :mimetype:`application/x-www-form-urlencoded` format; see the
     :func:`urlencode` function below.