@@ -471,11 +471,15 @@ msgid ""
471471"call. *h_errno* is a numeric value, while *string* represents the "
472472"description of *h_errno*, as returned by the :c:func:`hstrerror` C function."
473473msgstr ""
474+ ":exc:`OSError` 的子类,本异常通常表示与地址相关的错误,比如那些在 POSIX C API 中使用了 *h_errno* 的函数,包括 "
475+ ":func:`gethostbyname_ex` 和 :func:`gethostbyaddr`。附带的值是一对 ``(h_errno, "
476+ "string)``,代表库调用返回的错误。*h_errno* 是一个数字,而 *string* 表示 *h_errno* 的描述,它们由 C 函数 "
477+ ":c:func:`hstrerror` 返回。"
474478
475479#: ../../library/socket.rst:247 ../../library/socket.rst:260
476480#: ../../library/socket.rst:271
477481msgid "This class was made a subclass of :exc:`OSError`."
478- msgstr ""
482+ msgstr "此类是 :exc:`OSError` 的子类。 "
479483
480484#: ../../library/socket.rst:252
481485msgid ""
@@ -486,6 +490,10 @@ msgid ""
486490"by the :c:func:`gai_strerror` C function. The numeric *error* value will "
487491"match one of the :const:`EAI_\\ *` constants defined in this module."
488492msgstr ""
493+ ":exc:`OSError` 的子类,本异常来自 :func:`getaddrinfo` 和 "
494+ ":func:`getnameinfo`,表示与地址相关的错误。附带的值是一对 ``(error, "
495+ "string)``,代表库调用返回的错误。*string* 表示 *error* 的描述,它由 C 函数 :c:func:`gai_strerror` "
496+ "返回。数字值 *error* 与本模块中定义的 :const:`EAI_\\ *` 常量之一匹配。"
489497
490498#: ../../library/socket.rst:265
491499msgid ""
@@ -495,6 +503,9 @@ msgid ""
495503":func:`~socket.setdefaulttimeout`). The accompanying value is a string "
496504"whose value is currently always \" timed out\" ."
497505msgstr ""
506+ ":exc:`OSError` 的子类,当套接字发生超时,且事先已调用过 :meth:`~socket.settimeout` (或隐式地通过 "
507+ ":func:`~socket.setdefaulttimeout` )启用了超时,则会抛出此异常。附带的值是一个字符串,其值总是 \" timed "
508+ "out\" 。"
498509
499510#: ../../library/socket.rst:276
500511msgid "Constants"
@@ -505,6 +516,8 @@ msgid ""
505516"The AF_* and SOCK_* constants are now :class:`AddressFamily` and "
506517":class:`SocketKind` :class:`.IntEnum` collections."
507518msgstr ""
519+ "AF_* 和 SOCK_* 常量现在都在 :class:`AddressFamily` 和 :class:`SocketKind` 这两个 "
520+ ":class:`.IntEnum` 集合内。"
508521
509522#: ../../library/socket.rst:287
510523msgid ""
@@ -513,6 +526,8 @@ msgid ""
513526"defined then this protocol is unsupported. More constants may be available "
514527"depending on the system."
515528msgstr ""
529+ "这些常量表示地址(和协议)簇,用于 :func:`.socket` 的第一个参数。如果 :const:`AF_UNIX` "
530+ "常量未定义,即表示不支持该协议。不同系统可能会有更多其他常量可用。"
516531
517532#: ../../library/socket.rst:299
518533msgid ""
0 commit comments