@@ -330,6 +330,7 @@ msgid ""
330330"The :exc:`~urllib.error.HTTPError` instance raised will have an integer "
331331"'code' attribute, which corresponds to the error sent by the server."
332332msgstr ""
333+ "被引发的 :exc:`~urllib.error.HTTPError` 实例将有一个整数形式的 'code' 属性,对应于服务器发送的错误信息。"
333334
334335#: ../../howto/urllib2.rst:241
335336msgid "Error Codes"
@@ -360,6 +361,9 @@ msgid ""
360361"attribute, it also has read, geturl, and info, methods as returned by the "
361362"``urllib.response`` module::"
362363msgstr ""
364+ "当错误被引发时服务器会通过返回 HTTP 错误码 *和* 错误页面进行响应。 你可以在返回的页面上使用 "
365+ ":exc:`~urllib.error.HTTPError` 实例作为响应。 这意味着除了 code 属性之外,它还像 "
366+ "``urllib.response`` 模块: 所返回对象那样具有 read, geturl 和 info 等方法::"
363367
364368#: ../../howto/urllib2.rst:339
365369msgid "Wrapping it Up"
@@ -371,6 +375,8 @@ msgid ""
371375":exc:`~urllib.error.URLError` there are two basic approaches. I prefer the "
372376"second approach."
373377msgstr ""
378+ "因此当你想为 :exc:`~urllib.error.HTTPError` *或* :exc:`~urllib.error.URLError` "
379+ "做好准备时有两种基本的方案。 我更倾向使用第二种方案。"
374380
375381#: ../../howto/urllib2.rst:345
376382msgid "Number 1"
@@ -381,6 +387,8 @@ msgid ""
381387"The ``except HTTPError`` *must* come first, otherwise ``except URLError`` "
382388"will *also* catch an :exc:`~urllib.error.HTTPError`."
383389msgstr ""
390+ "``except HTTPError`` *必须* 首先被处理,否则 ``except URLError`` 将会 *同时* 捕获 "
391+ ":exc:`~urllib.error.HTTPError`。"
384392
385393#: ../../howto/urllib2.rst:371
386394msgid "Number 2"
@@ -396,6 +404,8 @@ msgid ""
396404"instance) has two useful methods :meth:`info` and :meth:`geturl` and is "
397405"defined in the module :mod:`urllib.response`.."
398406msgstr ""
407+ "urlopen 返回的响应 (或 :exc:`~urllib.error.HTTPError` 实例) 包含两个有用的方法 :meth:`info` 和"
408+ " :meth:`geturl` 并且是在模块 :mod:`urllib.response` 中定义的。"
399409
400410#: ../../howto/urllib2.rst:398
401411msgid ""
0 commit comments