@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.14\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-08-25 14:20 +0000\n "
14
+ "POT-Creation-Date : 2025-10-05 14:11 +0000\n "
15
15
"PO-Revision-Date : 2025-09-16 00:00+0000\n "
16
16
"Last-Translator : python-doc bot, 2025\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -41,7 +41,7 @@ msgid ""
41
41
"Here is an example of a TCP echo client written using asyncio streams::"
42
42
msgstr "下面是一个使用 asyncio streams 编写的 TCP echo 客户端示例::"
43
43
44
- #: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:440
44
+ #: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:441
45
45
msgid ""
46
46
"import asyncio\n"
47
47
"\n"
@@ -146,7 +146,7 @@ msgstr "移除了 *loop* 形参。"
146
146
147
147
#: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131
148
148
#: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:202
149
- #: ../../library/asyncio-stream.rst:407
149
+ #: ../../library/asyncio-stream.rst:408
150
150
msgid "Added the *ssl_shutdown_timeout* parameter."
151
151
msgstr "添加了 *ssl_shutdown_timeout* 形参。"
152
152
@@ -407,92 +407,92 @@ msgid ""
407
407
"until it can be sent."
408
408
msgstr "此方法会尝试立即将 *data* 写入到下层的套接字。 如果写入失败,数据会被排入内部写缓冲队列直到可以被发送。"
409
409
410
- #: ../../library/asyncio-stream.rst:319 ../../library/asyncio-stream.rst:334
410
+ #: ../../library/asyncio-stream.rst:319
411
+ msgid ""
412
+ "The *data* buffer should be a bytes, bytearray, or C-contiguous one-"
413
+ "dimensional memoryview object."
414
+ msgstr ""
415
+
416
+ #: ../../library/asyncio-stream.rst:322 ../../library/asyncio-stream.rst:335
411
417
msgid "The method should be used along with the ``drain()`` method::"
412
418
msgstr "此方法应当与 ``drain()`` 方法一起使用::"
413
419
414
- #: ../../library/asyncio-stream.rst:321
420
+ #: ../../library/asyncio-stream.rst:324
415
421
msgid ""
416
422
"stream.write(data)\n"
417
423
"await stream.drain()"
418
424
msgstr ""
419
425
"stream.write(data)\n"
420
426
"await stream.drain()"
421
427
422
- #: ../../library/asyncio-stream.rst:325
423
- msgid ""
424
- "The *data* buffer should be a C contiguous one-dimensional :term:`bytes-like"
425
- " object <bytes-like object>`."
426
- msgstr "*data* 缓冲区应该是一个 C 语言风格的连续一维 :term:`字节型对象 <bytes-like object>`。"
427
-
428
- #: ../../library/asyncio-stream.rst:329
428
+ #: ../../library/asyncio-stream.rst:330
429
429
msgid ""
430
430
"The method writes a list (or any iterable) of bytes to the underlying socket"
431
431
" immediately. If that fails, the data is queued in an internal write buffer "
432
432
"until it can be sent."
433
433
msgstr "此方法会立即尝试将一个字节串列表(或任何可迭代对象)写入到下层的套接字。 如果写入失败,数据会被排入内部写缓冲队列直到可以被发送。"
434
434
435
- #: ../../library/asyncio-stream.rst:336
435
+ #: ../../library/asyncio-stream.rst:337
436
436
msgid ""
437
437
"stream.writelines(lines)\n"
438
438
"await stream.drain()"
439
439
msgstr ""
440
440
"stream.writelines(lines)\n"
441
441
"await stream.drain()"
442
442
443
- #: ../../library/asyncio-stream.rst:341
443
+ #: ../../library/asyncio-stream.rst:342
444
444
msgid "The method closes the stream and the underlying socket."
445
445
msgstr "此方法会关闭流以及下层的套接字。"
446
446
447
- #: ../../library/asyncio-stream.rst:343
447
+ #: ../../library/asyncio-stream.rst:344
448
448
msgid ""
449
449
"The method should be used, though not mandatory, along with the "
450
450
"``wait_closed()`` method::"
451
451
msgstr "此方法应当于 ``wait_closed()`` 方法一起使用,但这并非强制要求::"
452
452
453
- #: ../../library/asyncio-stream.rst:346
453
+ #: ../../library/asyncio-stream.rst:347
454
454
msgid ""
455
455
"stream.close()\n"
456
456
"await stream.wait_closed()"
457
457
msgstr ""
458
458
"stream.close()\n"
459
459
"await stream.wait_closed()"
460
460
461
- #: ../../library/asyncio-stream.rst:351
461
+ #: ../../library/asyncio-stream.rst:352
462
462
msgid ""
463
463
"Return ``True`` if the underlying transport supports the :meth:`write_eof` "
464
464
"method, ``False`` otherwise."
465
465
msgstr "如果下层的传输支持 :meth:`write_eof` 方法则返回 ``True``,否则返回 ``False``。"
466
466
467
- #: ../../library/asyncio-stream.rst:356
467
+ #: ../../library/asyncio-stream.rst:357
468
468
msgid ""
469
469
"Close the write end of the stream after the buffered write data is flushed."
470
470
msgstr "在已缓冲的写入数据被刷新后关闭流的写入端。"
471
471
472
- #: ../../library/asyncio-stream.rst:361
472
+ #: ../../library/asyncio-stream.rst:362
473
473
msgid "Return the underlying asyncio transport."
474
474
msgstr "返回下层的 asyncio 传输。"
475
475
476
- #: ../../library/asyncio-stream.rst:365
476
+ #: ../../library/asyncio-stream.rst:366
477
477
msgid ""
478
478
"Access optional transport information; see "
479
479
":meth:`BaseTransport.get_extra_info` for details."
480
480
msgstr "访问可选的传输信息;详情参见 :meth:`BaseTransport.get_extra_info`。"
481
481
482
- #: ../../library/asyncio-stream.rst:371
482
+ #: ../../library/asyncio-stream.rst:372
483
483
msgid ""
484
484
"Wait until it is appropriate to resume writing to the stream. Example::"
485
485
msgstr "等待直到可以适当地恢复写入到流。 示例::"
486
486
487
- #: ../../library/asyncio-stream.rst:374
487
+ #: ../../library/asyncio-stream.rst:375
488
488
msgid ""
489
489
"writer.write(data)\n"
490
490
"await writer.drain()"
491
491
msgstr ""
492
492
"writer.write(data)\n"
493
493
"await writer.drain()"
494
494
495
- #: ../../library/asyncio-stream.rst:377
495
+ #: ../../library/asyncio-stream.rst:378
496
496
msgid ""
497
497
"This is a flow control method that interacts with the underlying IO write "
498
498
"buffer. When the size of the buffer reaches the high watermark, *drain()* "
@@ -503,25 +503,25 @@ msgstr ""
503
503
"这是一个与下层的 IO 写缓冲区进行交互的流程控制方法。 当缓冲区大小达到最高水位(最大上限)时,*drain()* "
504
504
"会阻塞直到缓冲区大小减少至最低水位以便恢复写入。 当没有要等待的数据时,:meth:`drain` 会立即返回。"
505
505
506
- #: ../../library/asyncio-stream.rst:388
506
+ #: ../../library/asyncio-stream.rst:389
507
507
msgid "Upgrade an existing stream-based connection to TLS."
508
508
msgstr "将现有基于流的连接升级到 TLS。"
509
509
510
- #: ../../library/asyncio-stream.rst:390
510
+ #: ../../library/asyncio-stream.rst:391
511
511
msgid "Parameters:"
512
512
msgstr "参数:"
513
513
514
- #: ../../library/asyncio-stream.rst:392
514
+ #: ../../library/asyncio-stream.rst:393
515
515
msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`."
516
516
msgstr "*sslcontext* :一个已经配置好的 :class:`~ssl.SSLContext` 实例。"
517
517
518
- #: ../../library/asyncio-stream.rst:394
518
+ #: ../../library/asyncio-stream.rst:395
519
519
msgid ""
520
520
"*server_hostname*: sets or overrides the host name that the target server's "
521
521
"certificate will be matched against."
522
522
msgstr "*server_hostname* :设置或者覆盖目标服务器证书中相对应的主机名。"
523
523
524
- #: ../../library/asyncio-stream.rst:397
524
+ #: ../../library/asyncio-stream.rst:398
525
525
msgid ""
526
526
"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake"
527
527
" to complete before aborting the connection. ``60.0`` seconds if ``None`` "
@@ -530,7 +530,7 @@ msgstr ""
530
530
"*ssl_handshake_timeout* 是在放弃连接之前要等待 TLS 握手完成的秒数。 如为 ``None`` (默认值) 则使用 "
531
531
"``60.0``。"
532
532
533
- #: ../../library/asyncio-stream.rst:401
533
+ #: ../../library/asyncio-stream.rst:402
534
534
msgid ""
535
535
"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown "
536
536
"to complete before aborting the connection. ``30.0`` seconds if ``None`` "
@@ -539,35 +539,35 @@ msgstr ""
539
539
"*ssl_shutdown_timeout* 是在放弃连接之前要等待 SSL 关闭完成的秒数。 如为 ``None`` (默认值) 则使用 "
540
540
"``30.0``。"
541
541
542
- #: ../../library/asyncio-stream.rst:413
542
+ #: ../../library/asyncio-stream.rst:414
543
543
msgid ""
544
544
"Return ``True`` if the stream is closed or in the process of being closed."
545
545
msgstr "如果流已被关闭或正在被关闭则返回 ``True``。"
546
546
547
- #: ../../library/asyncio-stream.rst:421
547
+ #: ../../library/asyncio-stream.rst:422
548
548
msgid "Wait until the stream is closed."
549
549
msgstr "等待直到流被关闭。"
550
550
551
- #: ../../library/asyncio-stream.rst:423
551
+ #: ../../library/asyncio-stream.rst:424
552
552
msgid ""
553
553
"Should be called after :meth:`close` to wait until the underlying connection"
554
554
" is closed, ensuring that all data has been flushed before e.g. exiting the "
555
555
"program."
556
556
msgstr "应当在 :meth:`close` 之后调用以等待直到下层连接被关闭,确保所有数据在退出程序之前已刷新。"
557
557
558
- #: ../../library/asyncio-stream.rst:431
558
+ #: ../../library/asyncio-stream.rst:432
559
559
msgid "Examples"
560
560
msgstr "例子"
561
561
562
- #: ../../library/asyncio-stream.rst:436
562
+ #: ../../library/asyncio-stream.rst:437
563
563
msgid "TCP echo client using streams"
564
564
msgstr "使用流的 TCP 回显客户端"
565
565
566
- #: ../../library/asyncio-stream.rst:438
566
+ #: ../../library/asyncio-stream.rst:439
567
567
msgid "TCP echo client using the :func:`asyncio.open_connection` function::"
568
568
msgstr "使用 :func:`asyncio.open_connection` 函数的 TCP 回显客户端::"
569
569
570
- #: ../../library/asyncio-stream.rst:462
570
+ #: ../../library/asyncio-stream.rst:463
571
571
msgid ""
572
572
"The :ref:`TCP echo client protocol "
573
573
"<asyncio_example_tcp_echo_client_protocol>` example uses the low-level "
@@ -576,15 +576,15 @@ msgstr ""
576
576
"使用低层级 :meth:`loop.create_connection` 方法的 :ref:`TCP 回显客户端协议 "
577
577
"<asyncio_example_tcp_echo_client_protocol>` 示例。"
578
578
579
- #: ../../library/asyncio-stream.rst:469
579
+ #: ../../library/asyncio-stream.rst:470
580
580
msgid "TCP echo server using streams"
581
581
msgstr "使用流的 TCP 回显服务器"
582
582
583
- #: ../../library/asyncio-stream.rst:471
583
+ #: ../../library/asyncio-stream.rst:472
584
584
msgid "TCP echo server using the :func:`asyncio.start_server` function::"
585
585
msgstr "TCP 回显服务器使用 :func:`asyncio.start_server` 函数::"
586
586
587
- #: ../../library/asyncio-stream.rst:473
587
+ #: ../../library/asyncio-stream.rst:474
588
588
msgid ""
589
589
"import asyncio\n"
590
590
"\n"
@@ -644,7 +644,7 @@ msgstr ""
644
644
"\n"
645
645
"asyncio.run(main())"
646
646
647
- #: ../../library/asyncio-stream.rst:505
647
+ #: ../../library/asyncio-stream.rst:506
648
648
msgid ""
649
649
"The :ref:`TCP echo server protocol "
650
650
"<asyncio_example_tcp_echo_server_protocol>` example uses the "
@@ -653,16 +653,16 @@ msgstr ""
653
653
"使用 :meth:`loop.create_server` 方法的 :ref:`TCP 回显服务器协议 "
654
654
"<asyncio_example_tcp_echo_server_protocol>` 示例。"
655
655
656
- #: ../../library/asyncio-stream.rst:510
656
+ #: ../../library/asyncio-stream.rst:511
657
657
msgid "Get HTTP headers"
658
658
msgstr "获取 HTTP 标头"
659
659
660
- #: ../../library/asyncio-stream.rst:512
660
+ #: ../../library/asyncio-stream.rst:513
661
661
msgid ""
662
662
"Simple example querying HTTP headers of the URL passed on the command line::"
663
663
msgstr "查询命令行传入 URL 的 HTTP 标头的简单示例::"
664
664
665
- #: ../../library/asyncio-stream.rst:514
665
+ #: ../../library/asyncio-stream.rst:515
666
666
msgid ""
667
667
"import asyncio\n"
668
668
"import urllib.parse\n"
@@ -736,33 +736,33 @@ msgstr ""
736
736
"url = sys.argv[1]\n"
737
737
"asyncio.run(print_http_headers(url))"
738
738
739
- #: ../../library/asyncio-stream.rst:551
739
+ #: ../../library/asyncio-stream.rst:552
740
740
msgid "Usage::"
741
741
msgstr "用法:"
742
742
743
- #: ../../library/asyncio-stream.rst:553
743
+ #: ../../library/asyncio-stream.rst:554
744
744
msgid "python example.py http://example.com/path/page.html"
745
745
msgstr "python example.py http://example.com/path/page.html"
746
746
747
- #: ../../library/asyncio-stream.rst:555
747
+ #: ../../library/asyncio-stream.rst:556
748
748
msgid "or with HTTPS::"
749
749
msgstr "或使用 HTTPS::"
750
750
751
- #: ../../library/asyncio-stream.rst:557
751
+ #: ../../library/asyncio-stream.rst:558
752
752
msgid "python example.py https://example.com/path/page.html"
753
753
msgstr "python example.py https://example.com/path/page.html"
754
754
755
- #: ../../library/asyncio-stream.rst:563
755
+ #: ../../library/asyncio-stream.rst:564
756
756
msgid "Register an open socket to wait for data using streams"
757
757
msgstr "注册一个打开的套接字以等待使用流的数据"
758
758
759
- #: ../../library/asyncio-stream.rst:565
759
+ #: ../../library/asyncio-stream.rst:566
760
760
msgid ""
761
761
"Coroutine waiting until a socket receives data using the "
762
762
":func:`open_connection` function::"
763
763
msgstr "使用 :func:`open_connection` 函数实现等待直到套接字接收到数据的协程::"
764
764
765
- #: ../../library/asyncio-stream.rst:568
765
+ #: ../../library/asyncio-stream.rst:569
766
766
msgid ""
767
767
"import asyncio\n"
768
768
"import socket\n"
@@ -824,7 +824,7 @@ msgstr ""
824
824
"\n"
825
825
"asyncio.run(wait_for_data())"
826
826
827
- #: ../../library/asyncio-stream.rst:600
827
+ #: ../../library/asyncio-stream.rst:601
828
828
msgid ""
829
829
"The :ref:`register an open socket to wait for data using a protocol "
830
830
"<asyncio_example_create_connection>` example uses a low-level protocol and "
@@ -833,7 +833,7 @@ msgstr ""
833
833
"使用低层级协议以及 :meth:`loop.create_connection` 方法的 :ref:`注册一个打开的套接字以等待使用协议的数据 "
834
834
"<asyncio_example_create_connection>` 示例。"
835
835
836
- #: ../../library/asyncio-stream.rst:604
836
+ #: ../../library/asyncio-stream.rst:605
837
837
msgid ""
838
838
"The :ref:`watch a file descriptor for read events "
839
839
"<asyncio_example_watch_fd>` example uses the low-level "
0 commit comments