@@ -496,10 +496,13 @@ msgid ""
496496"and in a Mac OS X environment proxy information is retrieved from the OS X "
497497"System Configuration Framework."
498498msgstr ""
499+ "让请求转去代理服务。若给出了 *proxies*,则其必须是一个将协议名称映射为代理 URL 的字典对象。默认是从环境变量 "
500+ "``<protocol>_proxy`` 中读取代理服务的列表。如果没有设置代理环境变量,则 Windows 会从注册表的 Internet "
501+ "设置部分获取代理设置,而 Mac OS X 则会从 OS X 系统配置框架中读取代理信息。"
499502
500503#: ../../library/urllib.request.rst:305
501504msgid "To disable autodetected proxy pass an empty dictionary."
502- msgstr ""
505+ msgstr "若要禁用自动检测出来的代理,请传入空的字典对象。 "
503506
504507#: ../../library/urllib.request.rst:307
505508msgid ""
@@ -508,23 +511,29 @@ msgid ""
508511" list of hostname suffixes, optionally with ``:port`` appended, for example "
509512"``cern.ch,ncsa.uiuc.edu,some.host:8080``."
510513msgstr ""
514+ "环境变量 :envvar:`no_proxy` 可用于指定不必通过代理访问的主机;应为逗号分隔的主机名后缀列表,可加上 ``:port`` ,例如 "
515+ "``cern.ch,ncsa.uiuc.edu,some.host:8080`` 。 "
511516
512517#: ../../library/urllib.request.rst:314
513518msgid ""
514519"``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see "
515520"the documentation on :func:`~urllib.request.getproxies`."
516521msgstr ""
522+ "如果设置了 ``REQUEST_METHOD`` 变量,则会忽略 ``HTTP_PROXY`` ;参阅 "
523+ ":func:`~urllib.request.getproxies` 文档。"
517524
518525#: ../../library/urllib.request.rst:320
519526msgid "Keep a database of ``(realm, uri) -> (user, password)`` mappings."
520- msgstr ""
527+ msgstr "维护 ``(realm, uri) -> (user, password)`` 映射数据库。 "
521528
522529#: ../../library/urllib.request.rst:325
523530msgid ""
524531"Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm "
525532"of ``None`` is considered a catch-all realm, which is searched if no other "
526533"realm fits."
527534msgstr ""
535+ "维护 ``(realm, uri) -> (user, password)`` 映射数据库。realm 为 ``None`` "
536+ "视作全匹配,若没有其他合适的安全区域就会检索它。"
528537
529538#: ../../library/urllib.request.rst:332
530539msgid ""
@@ -533,6 +542,9 @@ msgid ""
533542"BasicAuth handler to determine when to send authentication credentials "
534543"immediately instead of waiting for a ``401`` response first."
535544msgstr ""
545+ ":class:`HTTPPasswordMgrWithDefaultRealm` 的一个变体,也带有 ``uri -> "
546+ "is_authenticated`` 映射数据库。可被 BasicAuth 处理函数用于确定立即发送身份认证凭据的时机,而不是先等待 ``401`` "
547+ "响应。"
536548
537549#: ../../library/urllib.request.rst:342
538550msgid ""
@@ -552,6 +564,14 @@ msgid ""
552564"the URI, so that subsequent requests to the URI or any of its super-URIs "
553565"will automatically include the authentication credentials."
554566msgstr ""
567+ "这是一个帮助完成 HTTP 身份认证的混合类,对远程主机和代理都适用。参数 *password_mgr* 应与 "
568+ ":class:`HTTPPasswordMgr` 兼容;关于必须支持哪些接口,请参阅 :ref:`http-password-mgr` 对象的章节。如果"
569+ " *password_mgr* 还提供 ``is_authenticated`` 和 ``update_authenticated`` 方法(请参阅 "
570+ ":ref:`http-password-mgr-with-prior-auth` 对象),则 handler 将对给定 URI 用到 "
571+ "``is_authenticated`` 的结果,来确定是否随请求发送身份认证凭据。如果该 URI 的 ``is_authenticated`` 返回"
572+ " ``True``,则发送凭据。如果 ``is_authenticated`` 为 ``False`` ,则不发送凭据,然后若收到 ``401`` "
573+ "响应,则使用身份认证凭据重新发送请求。如果身份认证成功,则调用 ``update_authenticated`` 设置该 URI 的 "
574+ "``is_authenticated`` 为 ``True``,这样后续对该 URI 或其所有父 URI 的请求将自动包含该身份认证凭据。"
555575
556576#: ../../library/urllib.request.rst:359
557577msgid "Added ``is_authenticated`` support."
@@ -565,6 +585,9 @@ msgid ""
565585"be supported. HTTPBasicAuthHandler will raise a :exc:`ValueError` when "
566586"presented with a wrong Authentication scheme."
567587msgstr ""
588+ "处理与远程主机的身份验证。 *password_mgr* 应与 :class:`HTTPPasswordMgr` 兼容;有关哪些接口是必须支持的,请参阅"
589+ " :ref:`http-password-mgr` 章节。如果给出错误的身份认证方式, HTTPBasicAuthHandler 将会触发 "
590+ ":exc:`ValueError` 。"
568591
569592#: ../../library/urllib.request.rst:374 ../../library/urllib.request.rst:408
570593msgid ""
@@ -573,6 +596,8 @@ msgid ""
573596" :ref:`http-password-mgr` for information on the interface that must be "
574597"supported."
575598msgstr ""
599+ "处理有代理服务时的身份验证。 *password_mgr* 应与 :class:`HTTPPasswordMgr` "
600+ "兼容;有关哪些接口是必须支持的,请参阅 :ref:`http-password-mgr` 章节。"
576601
577602#: ../../library/urllib.request.rst:382
578603msgid ""
@@ -582,6 +607,8 @@ msgid ""
582607":`http-password-mgr` for information on the interface that must be "
583608"supported."
584609msgstr ""
610+ "这是一个帮助完成 HTTP 身份认证的混合类,对远程主机和代理都适用。参数 *password_mgr* 应与 "
611+ ":class:`HTTPPasswordMgr` 兼容;关于必须支持哪些接口,请参阅 :ref:`http-password-mgr` 的章节。"
585612
586613#: ../../library/urllib.request.rst:391
587614msgid ""
@@ -595,6 +622,10 @@ msgid ""
595622"raise a :exc:`ValueError` when presented with an authentication scheme other"
596623" than Digest or Basic."
597624msgstr ""
625+ "处理远程主机的身份验证。 *password_mgr* 应与 :class:`HTTPPasswordMgr` 兼容;有关哪些接口是必须支持的,请参阅 "
626+ ":ref:`http-password-mgr` 章节。如果同时添加了 digest 身份认证 handler 和basic 身份认证 "
627+ "handler,则会首先尝试 digest 身份认证。如果 digest 身份认证再返回 40x 响应,会再发送到 basic 身份验证 handler"
628+ " 进行处理。如果给出 Digest 和 Basic 之外的身份认证方式, 本 handler 方法将会触发 :exc:`ValueError` 。"
598629
599630#: ../../library/urllib.request.rst:401
600631msgid "Raise :exc:`ValueError` on unsupported Authentication Scheme."
0 commit comments