~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/library/urllib.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
205
205
.. function:: quote(string[, safe])
206
206
 
207
207
   Replace special characters in *string* using the ``%xx`` escape. Letters,
208
 
   digits, and the characters ``'_.-'`` are never quoted. The optional *safe*
209
 
   parameter specifies additional characters that should not be quoted --- its
210
 
   default value is ``'/'``.
 
208
   digits, and the characters ``'_.-'`` are never quoted. By default, this
 
209
   function is intended for quoting the path section of the URL.The optional
 
210
   *safe* parameter specifies additional characters that should not be quoted
 
211
   --- its default value is ``'/'``.
211
212
 
212
213
   Example: ``quote('/~connolly/')`` yields ``'/%7econnolly/'``.
213
214
 
215
216
.. function:: quote_plus(string[, safe])
216
217
 
217
218
   Like :func:`quote`, but also replaces spaces by plus signs, as required for
218
 
   quoting HTML form values.  Plus signs in the original string are escaped unless
219
 
   they are included in *safe*.  It also does not have *safe* default to ``'/'``.
 
219
   quoting HTML form values when building up a query string to go into a URL.
 
220
   Plus signs in the original string are escaped unless they are included in
 
221
   *safe*.  It also does not have *safe* default to ``'/'``.
220
222
 
221
223
 
222
224
.. function:: unquote(string)
263
265
   to decode *path*.
264
266
 
265
267
 
 
268
.. function:: getproxies()
 
269
 
 
270
   This helper function returns a dictionary of scheme to proxy server URL
 
271
   mappings. It scans the environment for variables named ``<scheme>_proxy``
 
272
   for all operating systems first, and when it cannot find it, looks for proxy
 
273
   information from Mac OSX System Configuration for Mac OS X and Windows
 
274
   Systems Registry for Windows.
 
275
 
 
276
 
266
277
URL Opener objects
267
278
------------------
268
279