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-01-01 16:02+0000\n "
2020"PO-Revision-Date : 2019-09-01 03:31+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 "
@@ -1382,7 +1382,7 @@ msgstr "HTTPBasicAuthHandler 对象"
13821382#: ../../library/urllib.request.rst:996 ../../library/urllib.request.rst:1007
13831383#: ../../library/urllib.request.rst:1032 ../../library/urllib.request.rst:1043
13841384msgid "Retry the request with authentication information, if available."
1385- msgstr ""
1385+ msgstr "如果可用的话,请用身份认证信息重试请求。 "
13861386
13871387#: ../../library/urllib.request.rst:1002
13881388msgid "ProxyBasicAuthHandler Objects"
@@ -1399,6 +1399,8 @@ msgid ""
13991399"to, *req* should be the (failed) :class:`Request` object, and *headers* "
14001400"should be the error headers."
14011401msgstr ""
1402+ "*authreq* 应为请求中有关 realm 的头部信息名称,*host* 应为需要进行身份认证的主机,*req* 应为(已失败的) "
1403+ ":class:`Request` 对象, *headers* 则应为出错的头部信息。"
14021404
14031405#: ../../library/urllib.request.rst:1027
14041406msgid "HTTPDigestAuthHandler Objects"
@@ -1416,7 +1418,7 @@ msgstr "HTTPHandler 对象"
14161418msgid ""
14171419"Send an HTTP request, which can be either GET or POST, depending on "
14181420"``req.has_data()``."
1419- msgstr ""
1421+ msgstr "发送 HTTP 请求,根据 ``req.has_data()`` 的结果,可能是 GET 或 POST 格式。 "
14201422
14211423#: ../../library/urllib.request.rst:1061
14221424msgid "HTTPSHandler Objects"
@@ -1426,7 +1428,7 @@ msgstr "HTTPSHandler 对象"
14261428msgid ""
14271429"Send an HTTPS request, which can be either GET or POST, depending on "
14281430"``req.has_data()``."
1429- msgstr ""
1431+ msgstr "发送 HTTPS 请求,根据 ``req.has_data()`` 的结果,可能是 GET 或 POST 格式。 "
14301432
14311433#: ../../library/urllib.request.rst:1073
14321434msgid "FileHandler Objects"
@@ -1436,13 +1438,13 @@ msgstr "FileHandler 对象"
14361438msgid ""
14371439"Open the file locally, if there is no host name, or the host name is "
14381440"``'localhost'``."
1439- msgstr ""
1441+ msgstr "若无主机名或主机名为 ``'localhost'`` ,则打开本地文件。 "
14401442
14411443#: ../../library/urllib.request.rst:1081
14421444msgid ""
14431445"This method is applicable only for local hostnames. When a remote hostname "
14441446"is given, an :exc:`~urllib.error.URLError` is raised."
1445- msgstr ""
1447+ msgstr "本方法仅适用于本地主机名。如果给出的是远程主机名,将会触发 :exc:`~urllib.error.URLError` 。 "
14461448
14471449#: ../../library/urllib.request.rst:1089
14481450msgid "DataHandler Objects"
@@ -1457,6 +1459,9 @@ msgid ""
14571459"mind about a missing padding at the end of a base64 encoded data URL, this "
14581460"implementation will raise an :exc:`ValueError` in that case."
14591461msgstr ""
1462+ "读取内含数据的 URL。这种 URL 本身包含了经过编码的数据。 :rfc:`2397` 中给出了数据 URL 的语法定义。目前的代码库将忽略经过 "
1463+ "base64 编码的数据 URL 中的空白符,因此 URL 可以放入任何源码文件中。如果数据 URL 的 base64 "
1464+ "编码尾部缺少填充,即使某些浏览器不介意,但目前的代码库仍会引发 :exc:`ValueError`。"
14601465
14611466#: ../../library/urllib.request.rst:1104
14621467msgid "FTPHandler Objects"
@@ -1466,7 +1471,7 @@ msgstr "FTPHandler 对象"
14661471msgid ""
14671472"Open the FTP file indicated by *req*. The login is always done with empty "
14681473"username and password."
1469- msgstr ""
1474+ msgstr "打开由 *req* 给出的 FTP 文件。登录时的用户名和密码总是为空。 "
14701475
14711476#: ../../library/urllib.request.rst:1116
14721477msgid "CacheFTPHandler Objects"
@@ -1476,31 +1481,31 @@ msgstr "CacheFTPHandler 对象"
14761481msgid ""
14771482":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the "
14781483"following additional methods:"
1479- msgstr ""
1484+ msgstr ":class:`CacheFTPHandler` 对象即为加入以下方法的 :class:`FTPHandler` 对象: "
14801485
14811486#: ../../library/urllib.request.rst:1124
14821487msgid "Set timeout of connections to *t* seconds."
1483- msgstr ""
1488+ msgstr "设置连接超时为 *t* 秒。 "
14841489
14851490#: ../../library/urllib.request.rst:1129
14861491msgid "Set maximum number of cached connections to *m*."
1487- msgstr ""
1492+ msgstr "设置已缓存的最大连接数为 *m* 。 "
14881493
14891494#: ../../library/urllib.request.rst:1135
14901495msgid "UnknownHandler Objects"
14911496msgstr "UnknownHandler 对象"
14921497
14931498#: ../../library/urllib.request.rst:1140
14941499msgid "Raise a :exc:`~urllib.error.URLError` exception."
1495- msgstr ""
1500+ msgstr "触发 :exc:`~urllib.error.URLError` 异常。 "
14961501
14971502#: ../../library/urllib.request.rst:1146
14981503msgid "HTTPErrorProcessor Objects"
14991504msgstr "HTTPErrorProcessor 对象"
15001505
15011506#: ../../library/urllib.request.rst:1152
15021507msgid "For 200 error codes, the response object is returned immediately."
1503- msgstr ""
1508+ msgstr "对于 200 错误码,响应对象应立即返回。 "
15041509
15051510#: ../../library/urllib.request.rst:1154
15061511msgid ""
@@ -1510,14 +1515,17 @@ msgid ""
15101515"will raise an :exc:`~urllib.error.HTTPError` if no other handler handles the"
15111516" error."
15121517msgstr ""
1518+ "对于 200 以外的错误码,只通过 :meth:`OpenerDirector.error` 将任务传给 handler 的 "
1519+ ":meth:`http_error_\\ <type\\ >` 方法。如果最终没有 handler 处理错误, "
1520+ ":class:`HTTPDefaultErrorHandler` 将触发 :exc:`~urllib.error.HTTPError`。"
15131521
15141522#: ../../library/urllib.request.rst:1162
15151523msgid "Process HTTPS error responses."
1516- msgstr ""
1524+ msgstr "HTTPS 出错响应的处理。 "
15171525
15181526#: ../../library/urllib.request.rst:1164
15191527msgid "The behavior is same as :meth:`http_response`."
1520- msgstr ""
1528+ msgstr "与 :meth:`http_response` 方法相同。 "
15211529
15221530#: ../../library/urllib.request.rst:1170
15231531msgid "Examples"
@@ -1527,13 +1535,13 @@ msgstr "例子"
15271535msgid ""
15281536"In addition to the examples below, more examples are given in :ref:`urllib-"
15291537"howto`."
1530- msgstr ""
1538+ msgstr ":ref:`urllib-howto` 中给出了更多的示例。 "
15311539
15321540#: ../../library/urllib.request.rst:1175
15331541msgid ""
15341542"This example gets the python.org main page and displays the first 300 bytes "
15351543"of it. ::"
1536- msgstr ""
1544+ msgstr "以下示例将读取 python.org 主页并显示前 300 个字节的内容: "
15371545
15381546#: ../../library/urllib.request.rst:1188
15391547msgid ""
@@ -1543,44 +1551,48 @@ msgid ""
15431551"returned bytes object to string once it determines or guesses the "
15441552"appropriate encoding."
15451553msgstr ""
1554+ "请注意,urlopen 将返回字节对象。这是因为 urlopen 无法自动确定由 HTTP "
1555+ "服务器收到的字节流的编码。通常,只要能确定或猜出编码格式,就应将返回的字节对象解码为字符串。"
15461556
15471557#: ../../library/urllib.request.rst:1194
15481558msgid ""
15491559"The following W3C document, https://www.w3.org/International/O-charset\\ , "
15501560"lists the various ways in which an (X)HTML or an XML document could have "
15511561"specified its encoding information."
15521562msgstr ""
1563+ "下述 W3C 文档 https://www.w3.org/International/O-charset\\ 列出了可用于指明(X)HTML 或 XML"
1564+ " 文档编码信息的多种方案。 "
15531565
15541566#: ../../library/urllib.request.rst:1198
15551567msgid ""
15561568"As the python.org website uses *utf-8* encoding as specified in its meta "
15571569"tag, we will use the same for decoding the bytes object. ::"
1558- msgstr ""
1570+ msgstr "python.org 网站已在 meta 标签中指明,采用的是 *utf-8* 编码,因此这里将用同样的格式对字节串进行解码。 "
15591571
15601572#: ../../library/urllib.request.rst:1207
15611573msgid ""
15621574"It is also possible to achieve the same result without using the "
15631575":term:`context manager` approach. ::"
1564- msgstr ""
1576+ msgstr "不用 :term:`context manager` 方法也能获得同样的结果: "
15651577
15661578#: ../../library/urllib.request.rst:1216
15671579msgid ""
15681580"In the following example, we are sending a data-stream to the stdin of a CGI"
15691581" and reading the data it returns to us. Note that this example will only "
15701582"work when the Python installation supports SSL. ::"
1571- msgstr ""
1583+ msgstr "以下示例将会把数据流发送给某 CGI 的 stdin,并读取返回数据。请注意,该示例只能工作于 Python 装有 SSL 支持的环境。 "
15721584
15731585#: ../../library/urllib.request.rst:1228
15741586msgid "The code for the sample CGI used in the above example is::"
1575- msgstr ""
1587+ msgstr "上述示例中的 CGI 代码如下所示: "
15761588
15771589#: ../../library/urllib.request.rst:1235
15781590msgid "Here is an example of doing a ``PUT`` request using :class:`Request`::"
1579- msgstr ""
1591+ msgstr "下面是利用 :class:`Request` 发送``PUT`` 请求的示例: "
15801592
15811593#: ../../library/urllib.request.rst:1245
15821594msgid "Use of Basic HTTP Authentication::"
1583- msgstr ""
1595+ msgstr "基本 HTTP 认证示例: "
15841596
15851597#: ../../library/urllib.request.rst:1259
15861598msgid ""
@@ -1590,17 +1602,22 @@ msgid ""
15901602"URL scheme involved. For example, the :envvar:`http_proxy` environment "
15911603"variable is read to obtain the HTTP proxy's URL."
15921604msgstr ""
1605+ ":func:`build_opener` 默认提供了很多现成的 handler,包括 :class:`ProxyHandler`。 "
1606+ "默认情况下,:class:`ProxyHandler` 会使用名为 ``<scheme>_proxy`` 的环境变量,其中的 ``<scheme>`` "
1607+ "是相关的 URL 协议。 例如,可以读取 :envvar:`http_proxy` 环境变量来获取 HTTP 代理的 URL。"
15931608
15941609#: ../../library/urllib.request.rst:1265
15951610msgid ""
15961611"This example replaces the default :class:`ProxyHandler` with one that uses "
15971612"programmatically-supplied proxy URLs, and adds proxy authorization support "
15981613"with :class:`ProxyBasicAuthHandler`. ::"
15991614msgstr ""
1615+ "以下示例将默认的 :class:`ProxyHandler` 替换为自己的 handler,由程序提供代理 URL,并利用 "
1616+ ":class:`ProxyBasicAuthHandler` 加入代理认证的支持:"
16001617
16011618#: ../../library/urllib.request.rst:1277
16021619msgid "Adding HTTP headers:"
1603- msgstr ""
1620+ msgstr "添加 HTTP 头部信息: "
16041621
16051622#: ../../library/urllib.request.rst:1279
16061623msgid "Use the *headers* argument to the :class:`Request` constructor, or::"
0 commit comments