88# ppcfish <[email protected] >, 2019991010# Jiuh-star <[email protected] >, 202111- # Freesand Leo <[email protected] >, 20211211# Dai Xu <[email protected] >, 202112+ # Freesand Leo <[email protected] >, 20211313#
1414#, fuzzy
1515msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818"Report-Msgid-Bugs-To : \n "
1919"POT-Creation-Date : 2021-03-02 05:36+0000\n "
2020"PO-Revision-Date : 2017-02-16 23:34+0000\n "
21- "Last-Translator : Dai Xu <daixu61@hotmail .com>, 2021\n "
21+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2021\n "
2222"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2323"MIME-Version : 1.0\n "
2424"Content-Type : text/plain; charset=UTF-8\n "
@@ -1393,7 +1393,7 @@ msgstr "HTTPBasicAuthHandler 对象"
13931393#: ../../library/urllib.request.rst:995 ../../library/urllib.request.rst:1006
13941394#: ../../library/urllib.request.rst:1031 ../../library/urllib.request.rst:1042
13951395msgid "Retry the request with authentication information, if available."
1396- msgstr ""
1396+ msgstr "如果可用的话,请用身份认证信息重试请求。 "
13971397
13981398#: ../../library/urllib.request.rst:1001
13991399msgid "ProxyBasicAuthHandler Objects"
@@ -1410,6 +1410,8 @@ msgid ""
14101410"to, *req* should be the (failed) :class:`Request` object, and *headers* "
14111411"should be the error headers."
14121412msgstr ""
1413+ "*authreq* 应为请求中有关 realm 的头部信息名称,*host* 应为需要进行身份认证的主机,*req* 应为(已失败的) "
1414+ ":class:`Request` 对象, *headers* 则应为出错的头部信息。"
14131415
14141416#: ../../library/urllib.request.rst:1026
14151417msgid "HTTPDigestAuthHandler Objects"
@@ -1427,7 +1429,7 @@ msgstr "HTTPHandler 对象"
14271429msgid ""
14281430"Send an HTTP request, which can be either GET or POST, depending on "
14291431"``req.has_data()``."
1430- msgstr ""
1432+ msgstr "发送 HTTP 请求,根据 ``req.has_data()`` 的结果,可能是 GET 或 POST 格式。 "
14311433
14321434#: ../../library/urllib.request.rst:1060
14331435msgid "HTTPSHandler Objects"
@@ -1437,7 +1439,7 @@ msgstr "HTTPSHandler 对象"
14371439msgid ""
14381440"Send an HTTPS request, which can be either GET or POST, depending on "
14391441"``req.has_data()``."
1440- msgstr ""
1442+ msgstr "发送 HTTPS 请求,根据 ``req.has_data()`` 的结果,可能是 GET 或 POST 格式。 "
14411443
14421444#: ../../library/urllib.request.rst:1072
14431445msgid "FileHandler Objects"
@@ -1447,13 +1449,13 @@ msgstr "FileHandler 对象"
14471449msgid ""
14481450"Open the file locally, if there is no host name, or the host name is "
14491451"``'localhost'``."
1450- msgstr ""
1452+ msgstr "若无主机名或主机名为 ``'localhost'`` ,则打开本地文件。 "
14511453
14521454#: ../../library/urllib.request.rst:1080
14531455msgid ""
14541456"This method is applicable only for local hostnames. When a remote hostname "
14551457"is given, an :exc:`~urllib.error.URLError` is raised."
1456- msgstr ""
1458+ msgstr "本方法仅适用于本地主机名。如果给出的是远程主机名,将会触发 :exc:`~urllib.error.URLError` 。 "
14571459
14581460#: ../../library/urllib.request.rst:1088
14591461msgid "DataHandler Objects"
@@ -1468,6 +1470,9 @@ msgid ""
14681470"mind about a missing padding at the end of a base64 encoded data URL, this "
14691471"implementation will raise an :exc:`ValueError` in that case."
14701472msgstr ""
1473+ "读取内含数据的 URL。这种 URL 本身包含了经过编码的数据。 :rfc:`2397` 中给出了数据 URL 的语法定义。目前的代码库将忽略经过 "
1474+ "base64 编码的数据 URL 中的空白符,因此 URL 可以放入任何源码文件中。如果数据 URL 的 base64 "
1475+ "编码尾部缺少填充,即使某些浏览器不介意,但目前的代码库仍会引发 :exc:`ValueError`。"
14711476
14721477#: ../../library/urllib.request.rst:1103
14731478msgid "FTPHandler Objects"
@@ -1477,7 +1482,7 @@ msgstr "FTPHandler 对象"
14771482msgid ""
14781483"Open the FTP file indicated by *req*. The login is always done with empty "
14791484"username and password."
1480- msgstr ""
1485+ msgstr "打开由 *req* 给出的 FTP 文件。登录时的用户名和密码总是为空。 "
14811486
14821487#: ../../library/urllib.request.rst:1115
14831488msgid "CacheFTPHandler Objects"
@@ -1487,31 +1492,31 @@ msgstr "CacheFTPHandler 对象"
14871492msgid ""
14881493":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the "
14891494"following additional methods:"
1490- msgstr ""
1495+ msgstr ":class:`CacheFTPHandler` 对象即为加入以下方法的 :class:`FTPHandler` 对象: "
14911496
14921497#: ../../library/urllib.request.rst:1123
14931498msgid "Set timeout of connections to *t* seconds."
1494- msgstr ""
1499+ msgstr "设置连接超时为 *t* 秒。 "
14951500
14961501#: ../../library/urllib.request.rst:1128
14971502msgid "Set maximum number of cached connections to *m*."
1498- msgstr ""
1503+ msgstr "设置已缓存的最大连接数为 *m* 。 "
14991504
15001505#: ../../library/urllib.request.rst:1134
15011506msgid "UnknownHandler Objects"
15021507msgstr "UnknownHandler 对象"
15031508
15041509#: ../../library/urllib.request.rst:1139
15051510msgid "Raise a :exc:`~urllib.error.URLError` exception."
1506- msgstr ""
1511+ msgstr "触发 :exc:`~urllib.error.URLError` 异常。 "
15071512
15081513#: ../../library/urllib.request.rst:1145
15091514msgid "HTTPErrorProcessor Objects"
15101515msgstr "HTTPErrorProcessor 对象"
15111516
15121517#: ../../library/urllib.request.rst:1151
15131518msgid "For 200 error codes, the response object is returned immediately."
1514- msgstr ""
1519+ msgstr "对于 200 错误码,响应对象将立即返回。 "
15151520
15161521#: ../../library/urllib.request.rst:1153
15171522msgid ""
@@ -1521,14 +1526,17 @@ msgid ""
15211526"will raise an :exc:`~urllib.error.HTTPError` if no other handler handles the"
15221527" error."
15231528msgstr ""
1529+ "对于 200 以外的错误码,只通过 :meth:`OpenerDirector.error` 将任务传给 handler 的 "
1530+ ":meth:`http_error_\\ <type\\ >` 方法。如果最终没有 handler 处理错误, "
1531+ ":class:`HTTPDefaultErrorHandler` 将触发 :exc:`~urllib.error.HTTPError`。"
15241532
15251533#: ../../library/urllib.request.rst:1161
15261534msgid "Process HTTPS error responses."
1527- msgstr ""
1535+ msgstr "HTTPS 出错响应的处理。 "
15281536
15291537#: ../../library/urllib.request.rst:1163
15301538msgid "The behavior is same as :meth:`http_response`."
1531- msgstr ""
1539+ msgstr "与 :meth:`http_response` 方法相同。 "
15321540
15331541#: ../../library/urllib.request.rst:1169
15341542msgid "Examples"
@@ -1538,13 +1546,13 @@ msgstr "示例"
15381546msgid ""
15391547"In addition to the examples below, more examples are given in :ref:`urllib-"
15401548"howto`."
1541- msgstr ""
1549+ msgstr ":ref:`urllib-howto` 中给出了更多的示例。 "
15421550
15431551#: ../../library/urllib.request.rst:1174
15441552msgid ""
15451553"This example gets the python.org main page and displays the first 300 bytes "
15461554"of it. ::"
1547- msgstr ""
1555+ msgstr "以下示例将读取 python.org 主页并显示前 300 个字节的内容: "
15481556
15491557#: ../../library/urllib.request.rst:1187
15501558msgid ""
@@ -1554,44 +1562,48 @@ msgid ""
15541562"returned bytes object to string once it determines or guesses the "
15551563"appropriate encoding."
15561564msgstr ""
1565+ "请注意,urlopen 将返回字节串对象。这是因为 urlopen 无法自动确定由 HTTP "
1566+ "服务器收到的字节流的编码。通常,只要能确定或猜出编码格式,就应将返回的字节串解码为字符串。"
15571567
15581568#: ../../library/urllib.request.rst:1193
15591569msgid ""
15601570"The following W3C document, https://www.w3.org/International/O-charset\\ , "
15611571"lists the various ways in which an (X)HTML or an XML document could have "
15621572"specified its encoding information."
15631573msgstr ""
1574+ "下述 W3C 文档 https://www.w3.org/International/O-charset\\ 列出了可用于指明(X)HTML 或 XML"
1575+ " 文档编码信息的多种方案。 "
15641576
15651577#: ../../library/urllib.request.rst:1197
15661578msgid ""
15671579"As the python.org website uses *utf-8* encoding as specified in its meta "
15681580"tag, we will use the same for decoding the bytes object. ::"
1569- msgstr ""
1581+ msgstr "python.org 网站已在 meta 标签中指明,采用的是 *utf-8* 编码,因此这里将用同样的格式对字节串进行解码。 "
15701582
15711583#: ../../library/urllib.request.rst:1206
15721584msgid ""
15731585"It is also possible to achieve the same result without using the "
15741586":term:`context manager` approach. ::"
1575- msgstr ""
1587+ msgstr "不用 :term:`context manager` 方法也能获得同样的结果: "
15761588
15771589#: ../../library/urllib.request.rst:1215
15781590msgid ""
15791591"In the following example, we are sending a data-stream to the stdin of a CGI"
15801592" and reading the data it returns to us. Note that this example will only "
15811593"work when the Python installation supports SSL. ::"
1582- msgstr ""
1594+ msgstr "以下示例将会把数据流发送给某 CGI 的 stdin,并读取返回数据。请注意,该示例只能工作于 Python 装有 SSL 支持的环境。 "
15831595
15841596#: ../../library/urllib.request.rst:1227
15851597msgid "The code for the sample CGI used in the above example is::"
1586- msgstr ""
1598+ msgstr "上述示例中的 CGI 代码如下所示: "
15871599
15881600#: ../../library/urllib.request.rst:1234
15891601msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::"
1590- msgstr ""
1602+ msgstr "下面是利用 :class:`Request` 发送``PUT`` 请求的示例: "
15911603
15921604#: ../../library/urllib.request.rst:1244
15931605msgid "Use of Basic HTTP Authentication::"
1594- msgstr ""
1606+ msgstr "基本 HTTP 认证示例: "
15951607
15961608#: ../../library/urllib.request.rst:1258
15971609msgid ""
@@ -1601,17 +1613,22 @@ msgid ""
16011613"URL scheme involved. For example, the :envvar:`http_proxy` environment "
16021614"variable is read to obtain the HTTP proxy's URL."
16031615msgstr ""
1616+ ":func:`build_opener` 默认提供了很多现成的 handler,包括 :class:`ProxyHandler`。 "
1617+ "默认情况下,:class:`ProxyHandler` 会使用名为 ``<scheme>_proxy`` 的环境变量,其中的 ``<scheme>`` "
1618+ "是相关的 URL 协议。 例如,可以读取 :envvar:`http_proxy` 环境变量来获取 HTTP 代理的 URL。"
16041619
16051620#: ../../library/urllib.request.rst:1264
16061621msgid ""
16071622"This example replaces the default :class:`ProxyHandler` with one that uses "
16081623"programmatically-supplied proxy URLs, and adds proxy authorization support "
16091624"with :class:`ProxyBasicAuthHandler`. ::"
16101625msgstr ""
1626+ "以下示例将默认的 :class:`ProxyHandler` 替换为自己的 handler,由程序提供代理 URL,并利用 "
1627+ ":class:`ProxyBasicAuthHandler` 加入代理认证的支持:"
16111628
16121629#: ../../library/urllib.request.rst:1276
16131630msgid "Adding HTTP headers:"
1614- msgstr ""
1631+ msgstr "添加 HTTP 头部信息: "
16151632
16161633#: ../../library/urllib.request.rst:1278
16171634msgid "Use the *headers* argument to the :class:`Request` constructor, or::"
0 commit comments