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

Skip to content

Commit 5105520

Browse files
sync with cpython 870cd901
1 parent 5f43a3c commit 5105520

File tree

9 files changed

+979
-977
lines changed

9 files changed

+979
-977
lines changed

faq/design.po

Lines changed: 110 additions & 96 deletions
Large diffs are not rendered by default.

faq/extending.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2023-07-29 10:36+0000\n"
10+
"POT-Creation-Date: 2024-03-14 00:03+0000\n"
1111
"PO-Revision-Date: 2023-02-18 13:08+0800\n"
1212
"Last-Translator: Adrian Liaw <[email protected]>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -90,10 +90,10 @@ msgid ""
9090
"If you need to interface to some C or C++ library for which no Python "
9191
"extension currently exists, you can try wrapping the library's data types "
9292
"and functions with a tool such as `SWIG <https://www.swig.org>`_. `SIP "
93-
"<https://riverbankcomputing.com/software/sip/intro>`__, `CXX <https://cxx."
94-
"sourceforge.net/>`_ `Boost <https://www.boost.org/libs/python/doc/index."
95-
"html>`_, or `Weave <https://github.com/scipy/weave>`_ are also alternatives "
96-
"for wrapping C++ libraries."
93+
"<https://github.com/Python-SIP/sip>`__, `CXX <https://cxx.sourceforge.net/"
94+
">`_ `Boost <https://www.boost.org/libs/python/doc/index.html>`_, or `Weave "
95+
"<https://github.com/scipy/weave>`_ are also alternatives for wrapping C++ "
96+
"libraries."
9797
msgstr ""
9898
"如果你需要連接到當前不存在 Python 擴充的某些 C 或 C++ 函式庫,你可以嘗試使用 "
9999
"`SWIG <https://www.swig.org>`_ 等工具包裝函式庫的資料型別和函式。 `SIP "

howto/logging-cookbook.po

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2024-02-13 00:03+0000\n"
10+
"POT-Creation-Date: 2024-03-14 00:03+0000\n"
1111
"PO-Revision-Date: 2018-05-23 14:36+0000\n"
1212
"Last-Translator: Adrian Liaw <[email protected]>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -1062,27 +1062,27 @@ msgid ""
10621062
"kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::"
10631063
msgstr ""
10641064

1065-
#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950
1065+
#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3973
10661066
msgid "Module :mod:`logging`"
10671067
msgstr ":mod:`logging` 模組"
10681068

1069-
#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950
1069+
#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3973
10701070
msgid "API reference for the logging module."
10711071
msgstr ""
10721072

1073-
#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953
1073+
#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3976
10741074
msgid "Module :mod:`logging.config`"
10751075
msgstr ":mod:`logging.config` 模組"
10761076

1077-
#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953
1077+
#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3976
10781078
msgid "Configuration API for the logging module."
10791079
msgstr ""
10801080

1081-
#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956
1081+
#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3979
10821082
msgid "Module :mod:`logging.handlers`"
10831083
msgstr ":mod:`logging.handlers` 模組"
10841084

1085-
#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956
1085+
#: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3979
10861086
msgid "Useful handlers included with the logging module."
10871087
msgstr ""
10881088

@@ -1853,17 +1853,17 @@ msgstr ""
18531853

18541854
#: ../../howto/logging-cookbook.rst:3421
18551855
msgid ""
1856-
"The code should work with recent releases of either ``PySide2`` or "
1857-
"``PyQt5``. You should be able to adapt the approach to earlier versions of "
1858-
"Qt. Please refer to the comments in the code snippet for more detailed "
1859-
"information."
1856+
"The code should work with recent releases of either ``PySide6``, ``PyQt6``, "
1857+
"``PySide2`` or ``PyQt5``. You should be able to adapt the approach to "
1858+
"earlier versions of Qt. Please refer to the comments in the code snippet for "
1859+
"more detailed information."
18601860
msgstr ""
18611861

1862-
#: ../../howto/logging-cookbook.rst:3635
1862+
#: ../../howto/logging-cookbook.rst:3658
18631863
msgid "Logging to syslog with RFC5424 support"
18641864
msgstr ""
18651865

1866-
#: ../../howto/logging-cookbook.rst:3637
1866+
#: ../../howto/logging-cookbook.rst:3660
18671867
msgid ""
18681868
"Although :rfc:`5424` dates from 2009, most syslog servers are configured by "
18691869
"default to use the older :rfc:`3164`, which hails from 2001. When "
@@ -1873,14 +1873,14 @@ msgid ""
18731873
"handlers.SysLogHandler` functionality has not been updated."
18741874
msgstr ""
18751875

1876-
#: ../../howto/logging-cookbook.rst:3644
1876+
#: ../../howto/logging-cookbook.rst:3667
18771877
msgid ""
18781878
"RFC 5424 contains some useful features such as support for structured data, "
18791879
"and if you need to be able to log to a syslog server with support for it, "
18801880
"you can do so with a subclassed handler which looks something like this::"
18811881
msgstr ""
18821882

1883-
#: ../../howto/logging-cookbook.rst:3710
1883+
#: ../../howto/logging-cookbook.rst:3733
18841884
msgid ""
18851885
"You'll need to be familiar with RFC 5424 to fully understand the above code, "
18861886
"and it may be that you have slightly different needs (e.g. for how you pass "
@@ -1889,55 +1889,55 @@ msgid ""
18891889
"using something like this::"
18901890
msgstr ""
18911891

1892-
#: ../../howto/logging-cookbook.rst:3724
1892+
#: ../../howto/logging-cookbook.rst:3747
18931893
msgid "How to treat a logger like an output stream"
18941894
msgstr ""
18951895

1896-
#: ../../howto/logging-cookbook.rst:3726
1896+
#: ../../howto/logging-cookbook.rst:3749
18971897
msgid ""
18981898
"Sometimes, you need to interface to a third-party API which expects a file-"
18991899
"like object to write to, but you want to direct the API's output to a "
19001900
"logger. You can do this using a class which wraps a logger with a file-like "
19011901
"API. Here's a short script illustrating such a class:"
19021902
msgstr ""
19031903

1904-
#: ../../howto/logging-cookbook.rst:3766
1904+
#: ../../howto/logging-cookbook.rst:3789
19051905
msgid "When this script is run, it prints"
19061906
msgstr ""
19071907

1908-
#: ../../howto/logging-cookbook.rst:3773
1908+
#: ../../howto/logging-cookbook.rst:3796
19091909
msgid ""
19101910
"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys."
19111911
"stderr`` by doing something like this:"
19121912
msgstr ""
19131913

1914-
#: ../../howto/logging-cookbook.rst:3783
1914+
#: ../../howto/logging-cookbook.rst:3806
19151915
msgid ""
19161916
"You should do this *after* configuring logging for your needs. In the above "
19171917
"example, the :func:`~logging.basicConfig` call does this (using the ``sys."
19181918
"stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). "
19191919
"Then, you'd get this kind of result:"
19201920
msgstr ""
19211921

1922-
#: ../../howto/logging-cookbook.rst:3796
1922+
#: ../../howto/logging-cookbook.rst:3819
19231923
msgid ""
19241924
"Of course, the examples above show output according to the format used by :"
19251925
"func:`~logging.basicConfig`, but you can use a different formatter when you "
19261926
"configure logging."
19271927
msgstr ""
19281928

1929-
#: ../../howto/logging-cookbook.rst:3800
1929+
#: ../../howto/logging-cookbook.rst:3823
19301930
msgid ""
19311931
"Note that with the above scheme, you are somewhat at the mercy of buffering "
19321932
"and the sequence of write calls which you are intercepting. For example, "
19331933
"with the definition of ``LoggerWriter`` above, if you have the snippet"
19341934
msgstr ""
19351935

1936-
#: ../../howto/logging-cookbook.rst:3809
1936+
#: ../../howto/logging-cookbook.rst:3832
19371937
msgid "then running the script results in"
19381938
msgstr ""
19391939

1940-
#: ../../howto/logging-cookbook.rst:3827
1940+
#: ../../howto/logging-cookbook.rst:3850
19411941
msgid ""
19421942
"As you can see, this output isn't ideal. That's because the underlying code "
19431943
"which writes to ``sys.stderr`` makes multiple writes, each of which results "
@@ -1947,62 +1947,62 @@ msgid ""
19471947
"``LoggerWriter``:"
19481948
msgstr ""
19491949

1950-
#: ../../howto/logging-cookbook.rst:3852
1950+
#: ../../howto/logging-cookbook.rst:3875
19511951
msgid ""
19521952
"This just buffers up stuff until a newline is seen, and then logs complete "
19531953
"lines. With this approach, you get better output:"
19541954
msgstr ""
19551955

1956-
#: ../../howto/logging-cookbook.rst:3868
1956+
#: ../../howto/logging-cookbook.rst:3891
19571957
msgid "Patterns to avoid"
19581958
msgstr ""
19591959

1960-
#: ../../howto/logging-cookbook.rst:3870
1960+
#: ../../howto/logging-cookbook.rst:3893
19611961
msgid ""
19621962
"Although the preceding sections have described ways of doing things you "
19631963
"might need to do or deal with, it is worth mentioning some usage patterns "
19641964
"which are *unhelpful*, and which should therefore be avoided in most cases. "
19651965
"The following sections are in no particular order."
19661966
msgstr ""
19671967

1968-
#: ../../howto/logging-cookbook.rst:3876
1968+
#: ../../howto/logging-cookbook.rst:3899
19691969
msgid "Opening the same log file multiple times"
19701970
msgstr ""
19711971

1972-
#: ../../howto/logging-cookbook.rst:3878
1972+
#: ../../howto/logging-cookbook.rst:3901
19731973
msgid ""
19741974
"On Windows, you will generally not be able to open the same file multiple "
19751975
"times as this will lead to a \"file is in use by another process\" error. "
19761976
"However, on POSIX platforms you'll not get any errors if you open the same "
19771977
"file multiple times. This could be done accidentally, for example by:"
19781978
msgstr ""
19791979

1980-
#: ../../howto/logging-cookbook.rst:3883
1980+
#: ../../howto/logging-cookbook.rst:3906
19811981
msgid ""
19821982
"Adding a file handler more than once which references the same file (e.g. by "
19831983
"a copy/paste/forget-to-change error)."
19841984
msgstr ""
19851985

1986-
#: ../../howto/logging-cookbook.rst:3886
1986+
#: ../../howto/logging-cookbook.rst:3909
19871987
msgid ""
19881988
"Opening two files that look different, as they have different names, but are "
19891989
"the same because one is a symbolic link to the other."
19901990
msgstr ""
19911991

1992-
#: ../../howto/logging-cookbook.rst:3889
1992+
#: ../../howto/logging-cookbook.rst:3912
19931993
msgid ""
19941994
"Forking a process, following which both parent and child have a reference to "
19951995
"the same file. This might be through use of the :mod:`multiprocessing` "
19961996
"module, for example."
19971997
msgstr ""
19981998

1999-
#: ../../howto/logging-cookbook.rst:3893
1999+
#: ../../howto/logging-cookbook.rst:3916
20002000
msgid ""
20012001
"Opening a file multiple times might *appear* to work most of the time, but "
20022002
"can lead to a number of problems in practice:"
20032003
msgstr ""
20042004

2005-
#: ../../howto/logging-cookbook.rst:3896
2005+
#: ../../howto/logging-cookbook.rst:3919
20062006
msgid ""
20072007
"Logging output can be garbled because multiple threads or processes try to "
20082008
"write to the same file. Although logging guards against concurrent use of "
@@ -2011,7 +2011,7 @@ msgid ""
20112011
"different handler instances which happen to point to the same file."
20122012
msgstr ""
20132013

2014-
#: ../../howto/logging-cookbook.rst:3902
2014+
#: ../../howto/logging-cookbook.rst:3925
20152015
msgid ""
20162016
"An attempt to delete a file (e.g. during file rotation) silently fails, "
20172017
"because there is another reference pointing to it. This can lead to "
@@ -2021,17 +2021,17 @@ msgid ""
20212021
"being supposedly in place."
20222022
msgstr ""
20232023

2024-
#: ../../howto/logging-cookbook.rst:3909
2024+
#: ../../howto/logging-cookbook.rst:3932
20252025
msgid ""
20262026
"Use the techniques outlined in :ref:`multiple-processes` to circumvent such "
20272027
"issues."
20282028
msgstr ""
20292029

2030-
#: ../../howto/logging-cookbook.rst:3913
2030+
#: ../../howto/logging-cookbook.rst:3936
20312031
msgid "Using loggers as attributes in a class or passing them as parameters"
20322032
msgstr ""
20332033

2034-
#: ../../howto/logging-cookbook.rst:3915
2034+
#: ../../howto/logging-cookbook.rst:3938
20352035
msgid ""
20362036
"While there might be unusual cases where you'll need to do this, in general "
20372037
"there is no point because loggers are singletons. Code can always access a "
@@ -2042,25 +2042,25 @@ msgid ""
20422042
"module (and not the class) is the unit of software decomposition."
20432043
msgstr ""
20442044

2045-
#: ../../howto/logging-cookbook.rst:3924
2045+
#: ../../howto/logging-cookbook.rst:3947
20462046
msgid ""
20472047
"Adding handlers other than :class:`~logging.NullHandler` to a logger in a "
20482048
"library"
20492049
msgstr ""
20502050

2051-
#: ../../howto/logging-cookbook.rst:3926
2051+
#: ../../howto/logging-cookbook.rst:3949
20522052
msgid ""
20532053
"Configuring logging by adding handlers, formatters and filters is the "
20542054
"responsibility of the application developer, not the library developer. If "
20552055
"you are maintaining a library, ensure that you don't add handlers to any of "
20562056
"your loggers other than a :class:`~logging.NullHandler` instance."
20572057
msgstr ""
20582058

2059-
#: ../../howto/logging-cookbook.rst:3932
2059+
#: ../../howto/logging-cookbook.rst:3955
20602060
msgid "Creating a lot of loggers"
20612061
msgstr ""
20622062

2063-
#: ../../howto/logging-cookbook.rst:3934
2063+
#: ../../howto/logging-cookbook.rst:3957
20642064
msgid ""
20652065
"Loggers are singletons that are never freed during a script execution, and "
20662066
"so creating lots of loggers will use up memory which can't then be freed. "
@@ -2071,14 +2071,14 @@ msgid ""
20712071
"occasionally slightly more fine-grained than that)."
20722072
msgstr ""
20732073

2074-
#: ../../howto/logging-cookbook.rst:3945
2074+
#: ../../howto/logging-cookbook.rst:3968
20752075
msgid "Other resources"
20762076
msgstr ""
20772077

2078-
#: ../../howto/logging-cookbook.rst:3958
2078+
#: ../../howto/logging-cookbook.rst:3981
20792079
msgid ":ref:`Basic Tutorial <logging-basic-tutorial>`"
20802080
msgstr ":ref:`基礎教學 <logging-basic-tutorial>`"
20812081

2082-
#: ../../howto/logging-cookbook.rst:3960
2082+
#: ../../howto/logging-cookbook.rst:3983
20832083
msgid ":ref:`Advanced Tutorial <logging-advanced-tutorial>`"
20842084
msgstr ":ref:`進階教學 <logging-advanced-tutorial>`"

0 commit comments

Comments
 (0)