Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3702927

Browse files
committed
[po] auto sync bot
1 parent 1db1eb8 commit 3702927

4 files changed

Lines changed: 64 additions & 25 deletions

File tree

extending/extending.po

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,19 +1237,24 @@ msgid ""
12371237
"this was the last reference to that object, it would free the memory "
12381238
"associated with it, thereby invalidating ``item``."
12391239
msgstr ""
1240+
"既然是Python写的, :meth:`__del__` 方法可以执行任意Python代码。是否可能在 :c:func:`bug` 的 ``item``"
1241+
" 废止引用呢,是的。假设列表传递到 :c:func:`bug` 会被 :meth:`__del__` 方法所访问,就可以执行一个语句来实现 ``del "
1242+
"list[0]`` ,然后假设这是最后一个对对象的引用,就需要释放内存,从而使得 ``item`` 无效化。"
12401243

12411244
#: ../../extending/extending.rst:1037
12421245
msgid ""
12431246
"The solution, once you know the source of the problem, is easy: temporarily "
12441247
"increment the reference count. The correct version of the function reads::"
1245-
msgstr ""
1248+
msgstr "解决方法是,当你知道了问题的根源,就容易了:临时增加引用计数。正确版本的函数代码如下:"
12461249

12471250
#: ../../extending/extending.rst:1051
12481251
msgid ""
12491252
"This is a true story. An older version of Python contained variants of this"
12501253
" bug and someone spent a considerable amount of time in a C debugger to "
12511254
"figure out why his :meth:`__del__` methods would fail..."
12521255
msgstr ""
1256+
"这是个真实的故事。一个旧版本的Python包含了这个bug的变种,而一些人花费了大量时间在C调试器上去寻找为什么 :meth:`__del__` "
1257+
"方法会失败。"
12531258

12541259
#: ../../extending/extending.rst:1055
12551260
msgid ""
@@ -1263,6 +1268,10 @@ msgid ""
12631268
"complete. Obviously, the following function has the same problem as the "
12641269
"previous one::"
12651270
msgstr ""
1271+
"这个问题的第二种情况是借用的引用涉及线程的变种。通常,Python解释器里多个线程无法进入对方的路径,因为有个全局锁保护着Python整个对象空间。但可以使用宏"
1272+
" :c:macro:`Py_BEGIN_ALLOW_THREADS` 来临时释放这个锁,重新获取锁用 "
1273+
":c:macro:`Py_END_ALLOW_THREADS` "
1274+
"。这通常围绕在阻塞I/O调用外,使得其他线程可以在等待I/O期间使用处理器。显然,如下函数会跟之前那个有一样的问题:"
12661275

12671276
#: ../../extending/extending.rst:1078
12681277
msgid "NULL Pointers"
@@ -1279,20 +1288,27 @@ msgid ""
12791288
"*NULL*, there would be a lot of redundant tests and the code would run more "
12801289
"slowly."
12811290
msgstr ""
1291+
"通常,函数接受对象引用作为参数,而非期待你传入 *NULL* 指针,你非这么干会导致dump core (或者之后导致core dumps) "
1292+
"。函数返回对象引用时,返回的 *NULL* 用以指示发生了异常。 *NULL* 参数的理由在从其他函数接收时并未测试,如果每个函数都测试 *NULL* "
1293+
",就会导致大量的冗余测试,并使得代码运行更慢。"
12821294

12831295
#: ../../extending/extending.rst:1088
12841296
msgid ""
12851297
"It is better to test for *NULL* only at the \"source:\" when a pointer that "
12861298
"may be *NULL* is received, for example, from :c:func:`malloc` or from a "
12871299
"function that may raise an exception."
12881300
msgstr ""
1301+
"好的方法是仅在 \"源头\" 测试 *NULL* ,当一个指针可能是 *NULL* 时,例如 :c:func:`malloc` "
1302+
"或者从一个可能抛出异常的函数。"
12891303

12901304
#: ../../extending/extending.rst:1092
12911305
msgid ""
12921306
"The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for "
12931307
"*NULL* pointers --- however, their variants :c:func:`Py_XINCREF` and "
12941308
":c:func:`Py_XDECREF` do."
12951309
msgstr ""
1310+
"宏 :c:func:`Py_INCREF` 和 :c:func:`Py_DECREF` 不会检查 *NULL* 指针。但他们的变种 "
1311+
":c:func:`Py_XINCREF` 和 :c:func:`Py_XDECREF` 会检查。"
12961312

12971313
#: ../../extending/extending.rst:1096
12981314
msgid ""
@@ -1302,19 +1318,21 @@ msgid ""
13021318
"expected types, and this would generate redundant tests. There are no "
13031319
"variants with *NULL* checking."
13041320
msgstr ""
1321+
"用以检查对象类型的宏( ``Pytype_Check()`` )不会检查 *NULL* "
1322+
"指针,有很多代码会多次测试一个对象是否是预期的类型,这可能产生冗余的测试。而 *NULL* 检查没有冗余。"
13051323

13061324
#: ../../extending/extending.rst:1102
13071325
msgid ""
13081326
"The C function calling mechanism guarantees that the argument list passed to"
13091327
" C functions (``args`` in the examples) is never *NULL* --- in fact it "
13101328
"guarantees that it is always a tuple [#]_."
1311-
msgstr ""
1329+
msgstr "C函数调用机制会确保传递到C函数的参数列表 (例如 ``args`` )不会是 *NULL* ,实际上会确保总是元组 [#]_ 。"
13121330

13131331
#: ../../extending/extending.rst:1106
13141332
msgid ""
13151333
"It is a severe error to ever let a *NULL* pointer \"escape\" to the Python "
13161334
"user."
1317-
msgstr ""
1335+
msgstr "把 *NULL* 指针转义给Python用户是个严重的错误。"
13181336

13191337
#: ../../extending/extending.rst:1117
13201338
msgid "Writing Extensions in C++"

library/asyncio-llapi-index.po

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -514,88 +514,95 @@ msgstr ":meth:`loop.set_exception_handler`"
514514

515515
#: ../../library/asyncio-llapi-index.rst:250
516516
msgid "Set a new exception handler."
517-
msgstr "设置一个新的异常处理可回调对象。"
517+
msgstr "设置一个新的异常处理器。"
518518

519519
#: ../../library/asyncio-llapi-index.rst:252
520520
msgid ":meth:`loop.get_exception_handler`"
521-
msgstr ""
521+
msgstr ":meth:`loop.get_exception_handler`"
522522

523523
#: ../../library/asyncio-llapi-index.rst:253
524524
msgid "Get the current exception handler."
525-
msgstr ""
525+
msgstr "获取当前异常处理器。"
526526

527527
#: ../../library/asyncio-llapi-index.rst:255
528528
msgid ":meth:`loop.default_exception_handler`"
529-
msgstr ""
529+
msgstr ":meth:`loop.default_exception_handler`"
530530

531531
#: ../../library/asyncio-llapi-index.rst:256
532532
msgid "The default exception handler implementation."
533-
msgstr ""
533+
msgstr "默认异常处理器实现。"
534534

535535
#: ../../library/asyncio-llapi-index.rst:261
536536
msgid ""
537537
":ref:`Using asyncio.get_event_loop() and loop.run_forever() "
538538
"<asyncio_example_lowlevel_helloworld>`."
539539
msgstr ""
540+
":ref:`使用 asyncio.get_event_loop() 和 loop.run_forever() "
541+
"<asyncio_example_lowlevel_helloworld>`."
540542

541543
#: ../../library/asyncio-llapi-index.rst:264
542544
msgid ":ref:`Using loop.call_later() <asyncio_example_call_later>`."
543-
msgstr ""
545+
msgstr ":ref:`使用 loop.call_later() <asyncio_example_call_later>`."
544546

545547
#: ../../library/asyncio-llapi-index.rst:266
546548
msgid ""
547549
"Using ``loop.create_connection()`` to implement :ref:`an echo-client "
548550
"<asyncio_example_tcp_echo_client_protocol>`."
549551
msgstr ""
552+
"使用 ``loop.create_connection()`` 实现 :ref:`echo客户端 "
553+
"<asyncio_example_tcp_echo_client_protocol>`."
550554

551555
#: ../../library/asyncio-llapi-index.rst:269
552556
msgid ""
553557
"Using ``loop.create_connection()`` to :ref:`connect a socket "
554558
"<asyncio_example_create_connection>`."
555559
msgstr ""
560+
"使用``loop.create_connection()`` 去 :ref:`链接socket "
561+
"<asyncio_example_create_connection>`."
556562

557563
#: ../../library/asyncio-llapi-index.rst:272
558564
msgid ""
559565
":ref:`Using add_reader() to watch an FD for read events "
560566
"<asyncio_example_watch_fd>`."
561-
msgstr ""
567+
msgstr ":ref:`使用add_reader()监听FD(文件描述符)的读取事件 <asyncio_example_watch_fd>`."
562568

563569
#: ../../library/asyncio-llapi-index.rst:275
564570
msgid ":ref:`Using loop.add_signal_handler() <asyncio_example_unix_signals>`."
565-
msgstr ""
571+
msgstr ":ref:`使用loop.add_signal_handler() <asyncio_example_unix_signals>`."
566572

567573
#: ../../library/asyncio-llapi-index.rst:277
568574
msgid ""
569575
":ref:`Using loop.subprocess_exec() <asyncio_example_subprocess_proto>`."
570576
msgstr ""
577+
":ref:`使用loop.add_signal_handler() <asyncio_example_subprocess_proto>`。"
571578

572579
#: ../../library/asyncio-llapi-index.rst:281
573580
msgid "Transports"
574581
msgstr "传输"
575582

576583
#: ../../library/asyncio-llapi-index.rst:283
577584
msgid "All transports implement the following methods:"
578-
msgstr ""
585+
msgstr "所有传输都实现以下方法:"
579586

580587
#: ../../library/asyncio-llapi-index.rst:289
581588
msgid ":meth:`transport.close() <BaseTransport.close>`"
582-
msgstr ""
589+
msgstr ":meth:`transport.close() <BaseTransport.close>`"
583590

584591
#: ../../library/asyncio-llapi-index.rst:290
585592
msgid "Close the transport."
586-
msgstr ""
593+
msgstr "关闭传输。"
587594

588595
#: ../../library/asyncio-llapi-index.rst:292
589596
msgid ":meth:`transport.is_closing() <BaseTransport.is_closing>`"
590-
msgstr ""
597+
msgstr ":meth:`transport.is_closing() <BaseTransport.is_closing>`"
591598

592599
#: ../../library/asyncio-llapi-index.rst:293
593600
msgid "Return ``True`` if the transport is closing or is closed."
594-
msgstr ""
601+
msgstr "返回 ``True`` ,如果传输正在关闭或已经关闭。。"
595602

596603
#: ../../library/asyncio-llapi-index.rst:295
597604
msgid ":meth:`transport.get_extra_info() <BaseTransport.get_extra_info>`"
598-
msgstr ""
605+
msgstr ":meth:`transport.get_extra_info() <BaseTransport.get_extra_info>`"
599606

600607
#: ../../library/asyncio-llapi-index.rst:296
601608
msgid "Request for information about the transport."

library/asyncio-protocol.po

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# ww song <[email protected]>, 2018
1010
# Freesand Leo <[email protected]>, 2019
1111
# Pan Felix <[email protected]>, 2019
12+
# MuSheng Chen <[email protected]>, 2019
1213
#
1314
#, fuzzy
1415
msgid ""
@@ -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:49+0000\n"
20-
"Last-Translator: Pan Felix <tinylambda@gmail.com>, 2019\n"
21+
"Last-Translator: MuSheng Chen <sheng.2179@gmail.com>, 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"
@@ -226,7 +227,7 @@ msgstr ""
226227

227228
#: ../../library/asyncio-protocol.rst:148
228229
msgid "Close the transport."
229-
msgstr ""
230+
msgstr "关闭传输。"
230231

231232
#: ../../library/asyncio-protocol.rst:150
232233
msgid ""
@@ -239,7 +240,7 @@ msgstr ""
239240

240241
#: ../../library/asyncio-protocol.rst:159
241242
msgid "Return ``True`` if the transport is closing or is closed."
242-
msgstr ""
243+
msgstr "返回 ``True`` ,如果传输正在关闭或已经关闭。。"
243244

244245
#: ../../library/asyncio-protocol.rst:163
245246
msgid ""

library/multiprocessing.po

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ msgid ""
841841
"<multiprocessing.Queue.cancel_join_thread>`), then that process will not "
842842
"terminate until all buffered items have been flushed to the pipe."
843843
msgstr ""
844+
"正如刚才提到的,如果一个子进程将一些对象放进队列中 (并且它没有用 :meth:`JoinableQueue.cancel_join_thread "
845+
"<multiprocessing.Queue.cancel_join_thread>` "
846+
"方法),那么这个进程在所有缓冲区的对象被刷新进管道之前,是不会终止的。"
844847

845848
#: ../../library/multiprocessing.rst:731
846849
msgid ""
@@ -850,25 +853,28 @@ msgid ""
850853
"parent process may hang on exit when it tries to join all its non-daemonic "
851854
"children."
852855
msgstr ""
856+
"这意味着,除非你确定所有放入队列中的对象都已经被消费了,否则如果你试图等待这个进程,你可能会陷入死锁中。相似地,如果该子进程不是后台进程,那么父进程可能在试图等待所有非后台进程退出时挂起。"
853857

854858
#: ../../library/multiprocessing.rst:736
855859
msgid ""
856860
"Note that a queue created using a manager does not have this issue. See "
857861
":ref:`multiprocessing-programming`."
858-
msgstr ""
862+
msgstr "注意用管理器创建的队列不存在这个问题,详见 :ref:`multiprocessing-programming` 。"
859863

860864
#: ../../library/multiprocessing.rst:739
861865
msgid ""
862866
"For an example of the usage of queues for interprocess communication see "
863867
":ref:`multiprocessing-examples`."
864-
msgstr ""
868+
msgstr "该 :ref:`multiprocessing-examples` 展示了如何使用队列实现进程间通信。"
865869

866870
#: ../../library/multiprocessing.rst:745
867871
msgid ""
868872
"Returns a pair ``(conn1, conn2)`` of "
869873
":class:`~multiprocessing.connection.Connection` objects representing the "
870874
"ends of a pipe."
871875
msgstr ""
876+
"返回一对 :class:`~multiprocessing.connection.Connection`对象 ``(conn1, conn2)`` ,"
877+
" 分别表示管道的两端。 "
872878

873879
#: ../../library/multiprocessing.rst:749
874880
msgid ""
@@ -877,43 +883,50 @@ msgid ""
877883
" used for receiving messages and ``conn2`` can only be used for sending "
878884
"messages."
879885
msgstr ""
886+
"如果 *duplex* 被置为 ``True`` (默认值),那么该管道是双向的。如果 *duplex* 被置为 ``False`` "
887+
",那么该管道是单向的,即 ``conn1`` 只能用于接收消息,而 ``conn2`` 仅能用于发送消息。"
880888

881889
#: ../../library/multiprocessing.rst:757
882890
msgid ""
883891
"Returns a process shared queue implemented using a pipe and a few "
884892
"locks/semaphores. When a process first puts an item on the queue a feeder "
885893
"thread is started which transfers objects from a buffer into the pipe."
886-
msgstr ""
894+
msgstr "返回一个使用一个管道和少量锁和信号量实现的共享队列实例。当一个进程将一个对象放进队列中时,一个写入线程会启动并将对象从缓冲区写入管道中。"
887895

888896
#: ../../library/multiprocessing.rst:761
889897
msgid ""
890898
"The usual :exc:`queue.Empty` and :exc:`queue.Full` exceptions from the "
891899
"standard library's :mod:`queue` module are raised to signal timeouts."
892900
msgstr ""
901+
"一旦超时,将抛出标准库 :mod:`queue`  模块中常见的异常:exc:`queue.Empty` 和 :exc:`queue.Full`。"
893902

894903
#: ../../library/multiprocessing.rst:764
895904
msgid ""
896905
":class:`Queue` implements all the methods of :class:`queue.Queue` except for"
897906
" :meth:`~queue.Queue.task_done` and :meth:`~queue.Queue.join`."
898907
msgstr ""
908+
"除了 :meth:`~queue.Queue.task_done` 和 :meth:`~queue.Queue.join` "
909+
"之外,:class:`Queue`  实现了标准库类 :class:`queue.Queue` 中所有的方法。"
899910

900911
#: ../../library/multiprocessing.rst:769
901912
msgid ""
902913
"Return the approximate size of the queue. Because of "
903914
"multithreading/multiprocessing semantics, this number is not reliable."
904-
msgstr ""
915+
msgstr "返回队列的大致长度。由于多线程或者多进程的上下文,这个数字是不可靠的。"
905916

906917
#: ../../library/multiprocessing.rst:772
907918
msgid ""
908919
"Note that this may raise :exc:`NotImplementedError` on Unix platforms like "
909920
"Mac OS X where ``sem_getvalue()`` is not implemented."
910921
msgstr ""
922+
"注意,在 Unix 平台上,例如 Mac OS X ,这个方法可能会抛出 :exc:`NotImplementedError`  "
923+
"异常,因为该平台没有实现 ``sem_getvalue()`` 。"
911924

912925
#: ../../library/multiprocessing.rst:777
913926
msgid ""
914927
"Return ``True`` if the queue is empty, ``False`` otherwise. Because of "
915928
"multithreading/multiprocessing semantics, this is not reliable."
916-
msgstr ""
929+
msgstr "如果队列是空的,返回 ``True``  ,反之返回 ``False`` 。 同样由于多线程或多进程的存在,该状态是不可靠的。"
917930

918931
#: ../../library/multiprocessing.rst:782
919932
msgid ""

0 commit comments

Comments
 (0)