"urllib.error" --- Exception classes raised by urllib.request
*************************************************************

**ソースコード:** Lib/urllib/error.py

======================================================================

"urllib.error" は "urllib.request" によって投げられる例外を定義してい
ます。基底クラスは "URLError" です。

"urllib.error" は必要に応じて以下の例外が送出します:

exception urllib.error.URLError

   ハンドラが何らかの問題に遭遇した場合、この例外 (またはこの例外から
   派生した例外)を送出します。この例外は "OSError" のサブクラスです。

   reason

      このエラーの理由。メッセージ文字列あるいは他の例外インスタンスで
      す。

   バージョン 3.3 で変更: "URLError" used to be a subtype of
   "IOError", which is now an alias of "OSError".

exception urllib.error.HTTPError(url, code, msg, hdrs, fp)

   "HTTPError" は例外 ("URLError" のサブクラス) ですが、同時に例外では
   ない file-like な戻り値を返す関数でもあります ("urlopen()" の戻り値
   と同じです)。これは、例えばサーバからの認証リクエストのように、変わ
   った HTTP エラーを処理するのに役立ちます。

   url

      Contains the request URL. An alias for *filename* attribute.

   code

      **RFC 2616** に定義されているHTTPステータスコード。 この数値型の
      値は、 "http.server.BaseHTTPRequestHandler.responses" の辞書に登
      録されているコードに対応します。

   reason

      This is usually a string explaining the reason for this error.
      An alias for *msg* attribute.

   headers

      The HTTP response headers for the HTTP request that caused the
      "HTTPError". An alias for *hdrs* attribute.

      Added in version 3.4.

   fp

      A file-like object where the HTTP error body can be read from.

exception urllib.error.ContentTooShortError(msg, content)

   This exception is raised when the "urlretrieve()" function detects
   that the amount of the downloaded data is less than the expected
   amount (given by the *Content-Length* header).

   content

      The downloaded (and supposedly truncated) data.
