99# Junkai Shao <[email protected] >, 20181010# ChenYuan <[email protected] >, 20191111# Kade For, 2019
12+ 1213#
1314#, fuzzy
1415msgid ""
@@ -17,7 +18,7 @@ msgstr ""
1718"Report-Msgid-Bugs-To : \n "
1819"POT-Creation-Date : 2019-01-01 10:14+0900\n "
1920"PO-Revision-Date : 2017-02-16 17:46+0000\n "
20- "Last-Translator : Kade For , 2019\n "
21+ "
Last-Translator :
钢 彭 <[email protected] > , 2019\n"
2122"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2223"MIME-Version : 1.0\n "
2324"Content-Type : text/plain; charset=UTF-8\n "
@@ -43,6 +44,8 @@ msgid ""
4344"available at `urllib2 - Le Manuel manquant "
4445"<http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_."
4546msgstr ""
47+ "这份 HOWTO 文档的早期版本有一份法语的译文,可在 `urllib2 - Le Manuel manquant "
48+ "<http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_ 处查阅。"
4649
4750#: ../../howto/urllib2.rst:18
4851msgid "Introduction"
@@ -52,17 +55,18 @@ msgstr "概述"
5255msgid ""
5356"You may also find useful the following article on fetching web resources "
5457"with Python:"
55- msgstr ""
58+ msgstr "关于使用 Python 获取网页资源,你或许还可以找到下列有用的文章: "
5659
5760#: ../../howto/urllib2.rst:25
5861msgid ""
5962"`Basic Authentication "
6063"<http://www.voidspace.org.uk/python/articles/authentication.shtml>`_"
6164msgstr ""
65+ "`基本的验证 <http://www.voidspace.org.uk/python/articles/authentication.shtml>`_"
6266
6367#: ../../howto/urllib2.rst:27
6468msgid "A tutorial on *Basic Authentication*, with examples in Python."
65- msgstr ""
69+ msgstr "关于 *基本的验证* 的入门指南,带有一些 Python 的示例。 "
6670
6771#: ../../howto/urllib2.rst:29
6872msgid ""
@@ -73,6 +77,10 @@ msgid ""
7377"common situations - like basic authentication, cookies, proxies and so on. "
7478"These are provided by objects called handlers and openers."
7579msgstr ""
80+ "**urllib.request** 是一个用于获取 URL (统一资源定位地址)的 Python 模块。它以 *urlopen* "
81+ "函数的形式提供了一个非常简单的接口。该接口能够使用不同的协议获取 "
82+ "URL。同时它也提供了一个略微复杂的接口来处理常见情形——如:基本验证、cookies、代理等等。这些功能是通过叫做 handlers 和 opener"
83+ " 的对象来提供的。"
7684
7785#: ../../howto/urllib2.rst:36
7886msgid ""
@@ -82,6 +90,9 @@ msgid ""
8290"protocols (e.g. FTP, HTTP). This tutorial focuses on the most common case, "
8391"HTTP."
8492msgstr ""
93+ "urllib.request 支持多种 \" URL 网址方案\" (通过 URL中 ``\" :\" `` 之前的字符串加以区分——如 URL 地址 "
94+ "``\" ftp://python.org/\" ` 中的 ``\" ftp\" ```) ,使用与之相关的网络协议(如:FTP、 HTTP)来获取 URL "
95+ "资源。本指南重点关注最常用的情形—— HTTP。"
8596
8697#: ../../howto/urllib2.rst:41
8798msgid ""
@@ -109,6 +120,8 @@ msgid ""
109120"location, you can do so via the :func:`shutil.copyfileobj` and "
110121":func:`tempfile.NamedTemporaryFile` functions::"
111122msgstr ""
123+ "如果你想通过 URL 获取资源并保存某个临时的地方,你可以通过 :func:`shutil.copyfileobj` 和 "
124+ ":func:`tempfile.NamedTemporaryFile` 函数::"
112125
113126#: ../../howto/urllib2.rst:74
114127msgid ""
@@ -245,7 +258,7 @@ msgstr ""
245258
246259#: ../../howto/urllib2.rst:214
247260msgid "URLError"
248- msgstr ""
261+ msgstr "URLError "
249262
250263#: ../../howto/urllib2.rst:216
251264msgid ""
@@ -254,14 +267,16 @@ msgid ""
254267"case, the exception raised will have a 'reason' attribute, which is a tuple "
255268"containing an error code and a text error message."
256269msgstr ""
270+ "通常,引发 URLError 的原因是没有网络连接(或者没有到指定服务器的路由),或者指定的服务器不存在。该情况下,将会引发该异常,并带有一个 "
271+ "'reason' 属性,该属性是一个包含错误代码和文本错误信息的元组。"
257272
258273#: ../../howto/urllib2.rst:221
259274msgid "e.g. ::"
260275msgstr ""
261276
262277#: ../../howto/urllib2.rst:232
263278msgid "HTTPError"
264- msgstr ""
279+ msgstr "HTTPError "
265280
266281#: ../../howto/urllib2.rst:234
267282msgid ""
@@ -274,6 +289,11 @@ msgid ""
274289"errors include '404' (page not found), '403' (request forbidden), and '401' "
275290"(authentication required)."
276291msgstr ""
292+ "从服务器返回的每个 HTTP 响应都包含一个数字的 "
293+ "“状态码”。有时该状态码表明服务器无法完成该请求。默认的处理器(函数?)将会为你处理这其中的一些响应。(例如,如果响应包含了 "
294+ "\" redirection\" ,将会要求客户端去向另外的 URL 获取文档,urllib "
295+ "将会为你处理该情形)。对于那些它无法处理的(状态代码),urlopen 将会引发一个 :exc:`HTTPError` "
296+ "。典型的错误包括:‘404’(页面无法找到)、‘403’(请求遭拒绝)和 ’401‘ (需要身份验证)。"
277297
278298#: ../../howto/urllib2.rst:242
279299msgid ""
@@ -347,6 +367,8 @@ msgid ""
347367"useful methods :meth:`info` and :meth:`geturl` and is defined in the module "
348368":mod:`urllib.response`.."
349369msgstr ""
370+ "由 urlopen (或者 :exc:`HTTPError` 实例)所返回的响应包含两个有用的方法: :meth:`info` 和 "
371+ ":meth:`geturl`,该响应由模块 :mod:`urllib.response` 定义。"
350372
351373#: ../../howto/urllib2.rst:405
352374msgid ""
@@ -355,13 +377,17 @@ msgid ""
355377"redirect. The URL of the page fetched may not be the same as the URL "
356378"requested."
357379msgstr ""
380+ "**geturl** - 返回所获取页面的真实 URL。该方法很有用,因为 ``urlopen`` (或者所使用的 opener "
381+ "对象)可能回包括一次重定向。所获取页面的 URL 未必就是所请求的 URL 。"
358382
359383#: ../../howto/urllib2.rst:409
360384msgid ""
361385"**info** - this returns a dictionary-like object that describes the page "
362386"fetched, particularly the headers sent by the server. It is currently an "
363387":class:`http.client.HTTPMessage` instance."
364388msgstr ""
389+ "**info** - 该方法返回一个类似字典的对象,描述了所获取的页面,特别是由服务器送出的头部信息(headers) 。目前它是一个 "
390+ ":class:`http.client.HTTPMessage` 实例。"
365391
366392#: ../../howto/urllib2.rst:413
367393msgid ""
0 commit comments