diff --git a/c-api/bytes.po b/c-api/bytes.po index dc329a20bf..e70159eeb0 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-12-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -272,17 +272,17 @@ msgstr "" #: ../../c-api/bytes.rst:156 msgid "" "Return the null-terminated contents of the object *obj* through the output " -"variables *buffer* and *length*." +"variables *buffer* and *length*. Returns ``0`` on success." msgstr "" -#: ../../c-api/bytes.rst:159 +#: ../../c-api/bytes.rst:160 msgid "" "If *length* is ``NULL``, the bytes object may not contain embedded null " "bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is " "raised." msgstr "" -#: ../../c-api/bytes.rst:163 +#: ../../c-api/bytes.rst:164 msgid "" "The buffer refers to an internal buffer of *obj*, which includes an " "additional null byte at the end (not counted in *length*). The data must " @@ -292,13 +292,13 @@ msgid "" "returns ``-1`` and raises :exc:`TypeError`." msgstr "" -#: ../../c-api/bytes.rst:170 +#: ../../c-api/bytes.rst:171 msgid "" "Previously, :exc:`TypeError` was raised when embedded null bytes were " "encountered in the bytes object." msgstr "" -#: ../../c-api/bytes.rst:177 +#: ../../c-api/bytes.rst:178 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*; the caller will own the new reference. The reference " @@ -307,14 +307,14 @@ msgid "" "of *\\*bytes* will be set to ``NULL``; the appropriate exception will be set." msgstr "" -#: ../../c-api/bytes.rst:186 +#: ../../c-api/bytes.rst:187 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*. This version releases the :term:`strong reference` to " "*newpart* (i.e. decrements its reference count)." msgstr "" -#: ../../c-api/bytes.rst:193 +#: ../../c-api/bytes.rst:194 msgid "" "A way to resize a bytes object even though it is \"immutable\". Only use " "this to build up a brand new bytes object; don't use this if the bytes may " diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index c1cb4116ae..c37d2a2192 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-17 00:03+0000\n" +"POT-Creation-Date: 2023-12-27 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -439,7 +439,7 @@ msgstr "" #: ../../howto/isolating-extensions.rst:339 msgid "" "Define a traverse function using ``Py_tp_traverse``, which visits the type " -"(e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`)." +"(e.g. using ``Py_VISIT(Py_TYPE(self))``)." msgstr "" #: ../../howto/isolating-extensions.rst:342 @@ -617,9 +617,9 @@ msgstr "" #: ../../howto/isolating-extensions.rst:485 msgid "" -"Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the " -"method is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer " -"to that subclass, which may be defined in different module than yours." +"Do not confuse the defining class with ``Py_TYPE(self)``. If the method is " +"called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " +"subclass, which may be defined in different module than yours." msgstr "" #: ../../howto/isolating-extensions.rst:490 diff --git a/library/bisect.po b/library/bisect.po index 178cf2efd2..c2a7f61e0f 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-12-27 00:03+0000\n" "PO-Revision-Date: 2023-08-01 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -47,15 +47,15 @@ msgid "" "The module is called :mod:`bisect` because it uses a basic bisection " "algorithm to do its work. Unlike other bisection tools that search for a " "specific value, the functions in this module are designed to locate an " -"insertion point. Accordingly, the functions never call an :meth:`__eq__` " -"method to determine whether a value has been found. Instead, the functions " -"only call the :meth:`__lt__` method and will return an insertion point " -"between values in an array." +"insertion point. Accordingly, the functions never call an :meth:`~object." +"__eq__` method to determine whether a value has been found. Instead, the " +"functions only call the :meth:`~object.__lt__` method and will return an " +"insertion point between values in an array." msgstr "" "這個模組被稱為 :mod:`bisect` 是因為它使用基本二分演算法來完成其工作。不像其它" "搜尋特定值的二分法工具,本模組中的函式旨在定位插入點。因此,這些函式永遠不會" -"呼叫 :meth:`__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼叫 :meth:" -"`__lt__` 方法,並在陣列中的值回傳一個插入點。" +"呼叫 :meth:`~object.__eq__` 方法來確認是否找到一個值。相反地,這些函式只呼" +"叫 :meth:`~object.__lt__` 方法,並在陣列中的值回傳一個插入點。" #: ../../library/bisect.rst:29 msgid "The following functions are provided:" @@ -133,11 +133,11 @@ msgstr "將元素 *x* 插入 list *a*,並維持順序。" #: ../../library/bisect.rst:75 msgid "" "This function first runs :py:func:`~bisect.bisect_left` to locate an " -"insertion point. Next, it runs the :meth:`insert` method on *a* to insert " +"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " "*x* at the appropriate position to maintain sort order." msgstr "" -"此函式先使用 :py:func:`~bisect.bisect_left` 搜索插入位置,接著用 :meth:" -"`insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" +"此函式先使用 :py:func:`~bisect.bisect_left` 搜索插入位置,接著用 :meth:`!" +"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" #: ../../library/bisect.rst:79 ../../library/bisect.rst:99 msgid "" @@ -163,11 +163,11 @@ msgstr "" #: ../../library/bisect.rst:95 msgid "" "This function first runs :py:func:`~bisect.bisect_right` to locate an " -"insertion point. Next, it runs the :meth:`insert` method on *a* to insert " +"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " "*x* at the appropriate position to maintain sort order." msgstr "" -"此函式先使用 :py:func:`~bisect.bisect_right` 搜索插入位置,接著用 :meth:" -"`insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" +"此函式先使用 :py:func:`~bisect.bisect_right` 搜索插入位置,接著用 :meth:`!" +"insert` 於 *a* 以將 *x* 插入,並維持添加元素後的順序。" #: ../../library/bisect.rst:110 msgid "Performance Notes" @@ -247,9 +247,7 @@ msgid "" "sorted lists::" msgstr "" "上面的 `bisect functions`_ 在找到數值插入點上很有用,但一般的數值搜尋任務上就" -"不是那麼的方便。以下的五個函式展示了如何將其轉換成標準的有序列表查找函式:\n" -"\n" -"::" +"不是那麼的方便。以下的五個函式展示了如何將其轉換成標準的有序列表查找函式: ::" #: ../../library/bisect.rst:187 msgid "Examples" @@ -264,9 +262,7 @@ msgid "" msgstr "" ":py:func:`~bisect.bisect` 函式可用於數值表中的查找 (numeric table lookup),這" "個範例使用 :py:func:`~bisect.bisect` 以基於一組有序的數值分界點來為一個考試成" -"績找到相對應的字母等級:90 以上是 'A'、80 到 89 為 'B',依此類推:\n" -"\n" -"::" +"績找到相對應的字母等級:90 以上是 'A'、80 到 89 為 'B',依此類推: ::" #: ../../library/bisect.rst:203 msgid "" @@ -276,9 +272,7 @@ msgid "" msgstr "" ":py:func:`~bisect.bisect` 與 :py:func:`~bisect.insort` 函式也適用於內容為 " "tuples(元組)的 lists,*key* 引數可被用以取出在數值表中作為排序依據的欄" -"位:\n" -"\n" -"::" +"位: ::" #: ../../library/bisect.rst:237 msgid "" @@ -286,6 +280,4 @@ msgid "" "calls by searching a list of precomputed keys to find the index of a record::" msgstr "" "如果鍵函式會消耗較多運算資源,那可以在預先計算好的鍵列表中搜索該紀錄的索引" -"值,以減少重複的函式呼叫:\n" -"\n" -"::" +"值,以減少重複的函式呼叫: ::" diff --git a/library/calendar.po b/library/calendar.po index fc1ca1cc53..b7913a2475 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-12-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -274,30 +274,38 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:199 +#: ../../library/calendar.rst:201 +msgid "" +"Return a month name as an HTML table row. If *withyear* is true the year " +"will be included in the row, otherwise just the month name will be used." +msgstr "" +"以 HTML 表列的形式回傳一個月份的名稱。如果 *withyear* 是 true 則該列會包含年" +"份,否則只會有月份名稱。" + +#: ../../library/calendar.rst:206 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:204 +#: ../../library/calendar.rst:211 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:208 +#: ../../library/calendar.rst:215 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:212 +#: ../../library/calendar.rst:219 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:217 +#: ../../library/calendar.rst:224 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:231 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -305,7 +313,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:232 +#: ../../library/calendar.rst:239 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -313,7 +321,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:240 +#: ../../library/calendar.rst:247 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -321,14 +329,14 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:248 +#: ../../library/calendar.rst:255 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:256 +#: ../../library/calendar.rst:263 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." @@ -336,7 +344,7 @@ msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:262 +#: ../../library/calendar.rst:269 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -346,11 +354,11 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:268 +#: ../../library/calendar.rst:275 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:280 +#: ../../library/calendar.rst:287 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -358,7 +366,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:286 +#: ../../library/calendar.rst:293 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -366,22 +374,22 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:292 +#: ../../library/calendar.rst:299 msgid "" -"The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods " +"The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " "*locale*. Because the current locale is a process-wide setting, they are not " "thread-safe." msgstr "" -"這兩個類別的建構函式、:meth:`formatweekday` 及 :meth:`formatmonthname` 方法會" -"把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " +"這兩個類別的建構函式、:meth:`!formatweekday` 及 :meth:`!formatmonthname` 方法" +"會把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:298 +#: ../../library/calendar.rst:305 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:302 +#: ../../library/calendar.rst:309 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -392,27 +400,27 @@ msgstr "" "`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" "`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:313 +#: ../../library/calendar.rst:320 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:318 +#: ../../library/calendar.rst:325 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:323 +#: ../../library/calendar.rst:330 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." msgstr "" "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:326 +#: ../../library/calendar.rst:333 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:331 +#: ../../library/calendar.rst:338 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -420,19 +428,19 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:337 +#: ../../library/calendar.rst:344 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:343 +#: ../../library/calendar.rst:350 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:349 +#: ../../library/calendar.rst:356 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " @@ -441,32 +449,32 @@ msgstr "" "回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" "一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:356 +#: ../../library/calendar.rst:363 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:361 +#: ../../library/calendar.rst:368 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" -"`formatmonth` of the :class:`TextCalendar` class." +"`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." msgstr "" "以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" -"`formatmonth`。" +"`~TextCalendar.formatmonth`。" -#: ../../library/calendar.rst:367 +#: ../../library/calendar.rst:374 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:372 +#: ../../library/calendar.rst:379 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " -"the :meth:`formatyear` of the :class:`TextCalendar` class." +"the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." msgstr "" "以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" -"`formatyear`。" +"`~TextCalendar.formatyear`。" -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:385 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -478,34 +486,36 @@ msgstr "" "gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" "碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" -#: ../../library/calendar.rst:385 +#: ../../library/calendar.rst:392 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:389 +#: ../../library/calendar.rst:396 msgid "An array that represents the days of the week in the current locale." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:394 +#: ../../library/calendar.rst:401 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:405 +#: ../../library/calendar.rst:412 msgid "" "Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " "is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:413 +#: ../../library/calendar.rst:420 msgid "" "Enumeration defining days of the week as integer constants. The members of " "this enumeration are exported to the module scope as :data:`MONDAY` through :" "data:`SUNDAY`." msgstr "" +"將一週中的幾天定義為整數常數的列舉。此列舉的成員將作為 :data:`MONDAY` 到 :" +"data:`SUNDAY` 匯出到模組作用域。" -#: ../../library/calendar.rst:422 +#: ../../library/calendar.rst:429 msgid "" "An array that represents the months of the year in the current locale. This " "follows normal convention of January being month number 1, so it has a " @@ -514,7 +524,7 @@ msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:429 +#: ../../library/calendar.rst:436 msgid "" "An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " @@ -523,153 +533,156 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:447 +#: ../../library/calendar.rst:454 msgid "" "Aliases for the months of the year, where ``JANUARY`` is ``1`` and " "``DECEMBER`` is ``12``." msgstr "" "一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:455 +#: ../../library/calendar.rst:462 msgid "" "Enumeration defining months of the year as integer constants. The members of " "this enumeration are exported to the module scope as :data:`JANUARY` " "through :data:`DECEMBER`." msgstr "" +"將一年中的月份定義為整數常數的列舉。此列舉的成員將作為 :data:`JANUARY` 到 :" +"data:`DECEMBER` 匯出到模組作用域。" -#: ../../library/calendar.rst:462 +#: ../../library/calendar.rst:469 msgid "The :mod:`calendar` module defines the following exceptions:" -msgstr "" +msgstr ":mod:`calendar` 模組定義了以下例外:" -#: ../../library/calendar.rst:466 +#: ../../library/calendar.rst:473 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" +":exc:`ValueError` 的子類別,當給定的月份數字超出 1-12 範圍(含)時引發。" -#: ../../library/calendar.rst:471 +#: ../../library/calendar.rst:478 msgid "The invalid month number." -msgstr "" +msgstr "無效的月份號。" -#: ../../library/calendar.rst:476 +#: ../../library/calendar.rst:483 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" +":exc:`ValueError` 的子類別,當給定的週幾的數字超出 0-6(含)範圍時引發。" -#: ../../library/calendar.rst:481 +#: ../../library/calendar.rst:488 msgid "The invalid weekday number." -msgstr "" +msgstr "無效的週幾編號。" -#: ../../library/calendar.rst:488 +#: ../../library/calendar.rst:495 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:487 +#: ../../library/calendar.rst:494 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:490 +#: ../../library/calendar.rst:497 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:491 +#: ../../library/calendar.rst:498 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" -#: ../../library/calendar.rst:497 +#: ../../library/calendar.rst:504 msgid "Command-Line Usage" -msgstr "" +msgstr "命令列用法" -#: ../../library/calendar.rst:501 +#: ../../library/calendar.rst:508 msgid "" "The :mod:`calendar` module can be executed as a script from the command line " "to interactively print a calendar." -msgstr "" +msgstr ":mod:`calendar` 模組可以作為腳本從命令列執行,並以互動方式列印日曆。" -#: ../../library/calendar.rst:511 +#: ../../library/calendar.rst:518 msgid "For example, to print a calendar for the year 2000:" -msgstr "" +msgstr "例如,要列印 2000 年的日曆:" -#: ../../library/calendar.rst:554 +#: ../../library/calendar.rst:561 msgid "The following options are accepted:" -msgstr "" +msgstr "接受以下選項:" -#: ../../library/calendar.rst:561 +#: ../../library/calendar.rst:568 msgid "Show the help message and exit." -msgstr "" +msgstr "顯示幫助訊息並退出。" -#: ../../library/calendar.rst:566 +#: ../../library/calendar.rst:573 msgid "The locale to use for month and weekday names. Defaults to English." -msgstr "" +msgstr "用於月份和週幾名稱的語系。預設為英語。" -#: ../../library/calendar.rst:572 +#: ../../library/calendar.rst:579 msgid "" "The encoding to use for output. :option:`--encoding` is required if :option:" "`--locale` is set." msgstr "" +"用於輸出的編碼。如有設定 :option:`--locale` 則必須給定 :option:`--encoding`。" -#: ../../library/calendar.rst:578 +#: ../../library/calendar.rst:585 msgid "Print the calendar to the terminal as text, or as an HTML document." -msgstr "" +msgstr "將日曆以文字或 HTML 文件的形式印出到終端機。" -#: ../../library/calendar.rst:584 +#: ../../library/calendar.rst:591 msgid "" "The year to print the calendar for. Must be a number between 1 and 9999. " "Defaults to the current year." -msgstr "" +msgstr "印出日曆的年份。必須是 1 到 9999 之間的數字。預設為當前年份。" -#: ../../library/calendar.rst:591 +#: ../../library/calendar.rst:598 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12, and may only be used in text mode. Defaults to " "printing a calendar for the full year." msgstr "" +"要列印日曆的指定 :option:`year` 的月份。必須是 1 到 12 之間的數字,並且只能在" +"文字模式下使用。預設列印全年日曆。" -#: ../../library/calendar.rst:597 +#: ../../library/calendar.rst:604 msgid "*Text-mode options:*" -msgstr "" +msgstr "*文字模式選項:*" -#: ../../library/calendar.rst:601 +#: ../../library/calendar.rst:608 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." msgstr "" +"終端機行中日期行的寬度。日期印出在行的中央。任何小於 2 的值都會被忽略。預設" +"為 2。" -#: ../../library/calendar.rst:609 +#: ../../library/calendar.rst:616 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." msgstr "" +"終端機列中每週的列數。日期印出時頂部會對齊。任何小於 1 的值都會被忽略。預設" +"為 1。" -#: ../../library/calendar.rst:617 +#: ../../library/calendar.rst:624 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." -msgstr "" +msgstr "行中月份之間的間距。任何小於 2 的值都會被忽略。預設為 6。" -#: ../../library/calendar.rst:624 +#: ../../library/calendar.rst:631 msgid "The number of months printed per row. Defaults to 3." -msgstr "" +msgstr "每列印出的月份數量。預設為 3。" -#: ../../library/calendar.rst:628 +#: ../../library/calendar.rst:635 msgid "*HTML-mode options:*" -msgstr "" +msgstr "*HTML 模式選項:*" -#: ../../library/calendar.rst:632 +#: ../../library/calendar.rst:639 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." msgstr "" - -#~ msgid "" -#~ "Enumeration defining the days of the week as integer constants, from 0 to " -#~ "6." -#~ msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" - -#~ msgid "" -#~ "Enumeration defining months of the year as integer constants, from 1 to " -#~ "12." -#~ msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" +"用於日曆的 CSS 樣式表路徑。這必須是相對於產生之 HTML 的,或者為絕對的 HTTP " +"或 ``file:///`` URL。" diff --git a/library/cmd.po b/library/cmd.po index dee9706b46..1d886c286f 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2023-12-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,10 +103,10 @@ msgstr "" #: ../../library/cmd.rst:68 msgid "" "An interpreter instance will recognize a command name ``foo`` if and only if " -"it has a method :meth:`do_foo`. As a special case, a line beginning with " +"it has a method :meth:`!do_foo`. As a special case, a line beginning with " "the character ``'?'`` is dispatched to the method :meth:`do_help`. As " "another special case, a line beginning with the character ``'!'`` is " -"dispatched to the method :meth:`do_shell` (if such a method is defined)." +"dispatched to the method :meth:`!do_shell` (if such a method is defined)." msgstr "" #: ../../library/cmd.rst:74 @@ -119,8 +119,8 @@ msgstr "" #: ../../library/cmd.rst:78 msgid "" "If completion is enabled, completing commands will be done automatically, " -"and completing of commands args is done by calling :meth:`complete_foo` with " -"arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string " +"and completing of commands args is done by calling :meth:`!complete_foo` " +"with arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string " "prefix we are attempting to match: all returned matches must begin with it. " "*line* is the current input line with leading whitespace removed, *begidx* " "and *endidx* are the beginning and ending indexes of the prefix text, which " @@ -128,18 +128,18 @@ msgid "" "the argument is in." msgstr "" -#: ../../library/cmd.rst:86 +#: ../../library/cmd.rst:89 msgid "" -"All subclasses of :class:`Cmd` inherit a predefined :meth:`do_help`. This " +"All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " "method, called with an argument ``'bar'``, invokes the corresponding method :" -"meth:`help_bar`, and if that is not present, prints the docstring of :meth:" -"`do_bar`, if available. With no argument, :meth:`do_help` lists all " +"meth:`!help_bar`, and if that is not present, prints the docstring of :meth:" +"`!do_bar`, if available. With no argument, :meth:`!do_help` lists all " "available help topics (that is, all commands with corresponding :meth:`!" "help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" -#: ../../library/cmd.rst:97 +#: ../../library/cmd.rst:100 msgid "" "Interpret the argument as though it had been typed in response to the " "prompt. This may be overridden, but should not normally need to be; see the :" @@ -150,32 +150,32 @@ msgid "" "return value from the :meth:`default` method is returned." msgstr "" -#: ../../library/cmd.rst:108 +#: ../../library/cmd.rst:111 msgid "" "Method called when an empty line is entered in response to the prompt. If " "this method is not overridden, it repeats the last nonempty command entered." msgstr "" -#: ../../library/cmd.rst:114 +#: ../../library/cmd.rst:117 msgid "" "Method called on an input line when the command prefix is not recognized. If " "this method is not overridden, it prints an error message and returns." msgstr "" -#: ../../library/cmd.rst:120 +#: ../../library/cmd.rst:123 msgid "" "Method called to complete an input line when no command-specific :meth:`!" "complete_\\*` method is available. By default, it returns an empty list." msgstr "" -#: ../../library/cmd.rst:126 +#: ../../library/cmd.rst:129 msgid "" "Method called to display a list of strings as a compact set of columns. Each " "column is only as wide as necessary. Columns are separated by two spaces for " "readability." msgstr "" -#: ../../library/cmd.rst:133 +#: ../../library/cmd.rst:136 msgid "" "Hook method executed just before the command line *line* is interpreted, but " "after the input prompt is generated and issued. This method is a stub in :" @@ -185,7 +185,7 @@ msgid "" "*line* unchanged." msgstr "" -#: ../../library/cmd.rst:143 +#: ../../library/cmd.rst:146 msgid "" "Hook method executed just after a command dispatch is finished. This method " "is a stub in :class:`Cmd`; it exists to be overridden by subclasses. *line* " @@ -196,117 +196,117 @@ msgid "" "corresponds to *stop*; returning false will cause interpretation to continue." msgstr "" -#: ../../library/cmd.rst:154 +#: ../../library/cmd.rst:157 msgid "" "Hook method executed once when :meth:`cmdloop` is called. This method is a " "stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" -#: ../../library/cmd.rst:160 +#: ../../library/cmd.rst:163 msgid "" "Hook method executed once when :meth:`cmdloop` is about to return. This " "method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" -#: ../../library/cmd.rst:164 +#: ../../library/cmd.rst:167 msgid "" "Instances of :class:`Cmd` subclasses have some public instance variables:" msgstr "" -#: ../../library/cmd.rst:168 +#: ../../library/cmd.rst:171 msgid "The prompt issued to solicit input." msgstr "" -#: ../../library/cmd.rst:173 +#: ../../library/cmd.rst:176 msgid "The string of characters accepted for the command prefix." msgstr "" -#: ../../library/cmd.rst:178 +#: ../../library/cmd.rst:181 msgid "The last nonempty command prefix seen." msgstr "" -#: ../../library/cmd.rst:183 +#: ../../library/cmd.rst:186 msgid "" "A list of queued input lines. The cmdqueue list is checked in :meth:" "`cmdloop` when new input is needed; if it is nonempty, its elements will be " "processed in order, as if entered at the prompt." msgstr "" -#: ../../library/cmd.rst:190 +#: ../../library/cmd.rst:193 msgid "" "A string to issue as an intro or banner. May be overridden by giving the :" "meth:`cmdloop` method an argument." msgstr "" -#: ../../library/cmd.rst:196 +#: ../../library/cmd.rst:199 msgid "" "The header to issue if the help output has a section for documented commands." msgstr "" -#: ../../library/cmd.rst:201 +#: ../../library/cmd.rst:204 msgid "" "The header to issue if the help output has a section for miscellaneous help " "topics (that is, there are :meth:`!help_\\*` methods without corresponding :" "meth:`!do_\\*` methods)." msgstr "" -#: ../../library/cmd.rst:208 +#: ../../library/cmd.rst:211 msgid "" "The header to issue if the help output has a section for undocumented " "commands (that is, there are :meth:`!do_\\*` methods without corresponding :" "meth:`!help_\\*` methods)." msgstr "" -#: ../../library/cmd.rst:215 +#: ../../library/cmd.rst:218 msgid "" "The character used to draw separator lines under the help-message headers. " "If empty, no ruler line is drawn. It defaults to ``'='``." msgstr "" -#: ../../library/cmd.rst:221 +#: ../../library/cmd.rst:224 msgid "" "A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to " -"display a prompt and read the next command; if false, :meth:`sys.stdout." -"write` and :meth:`sys.stdin.readline` are used. (This means that by " -"importing :mod:`readline`, on systems that support it, the interpreter will " -"automatically support :program:`Emacs`\\ -like line editing and command-" -"history keystrokes.)" +"display a prompt and read the next command; if false, :data:`sys.stdout." +"write() ` and :data:`sys.stdin.readline() ` are used. " +"(This means that by importing :mod:`readline`, on systems that support it, " +"the interpreter will automatically support :program:`Emacs`\\ -like line " +"editing and command-history keystrokes.)" msgstr "" -#: ../../library/cmd.rst:231 +#: ../../library/cmd.rst:234 msgid "Cmd Example" msgstr "" -#: ../../library/cmd.rst:235 +#: ../../library/cmd.rst:238 msgid "" "The :mod:`cmd` module is mainly useful for building custom shells that let a " "user work with a program interactively." msgstr "" -#: ../../library/cmd.rst:238 +#: ../../library/cmd.rst:241 msgid "" "This section presents a simple example of how to build a shell around a few " "of the commands in the :mod:`turtle` module." msgstr "" -#: ../../library/cmd.rst:241 +#: ../../library/cmd.rst:244 msgid "" "Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:" -"`Cmd` subclass with method named :meth:`do_forward`. The argument is " +"`Cmd` subclass with method named :meth:`!do_forward`. The argument is " "converted to a number and dispatched to the turtle module. The docstring is " "used in the help utility provided by the shell." msgstr "" -#: ../../library/cmd.rst:246 +#: ../../library/cmd.rst:249 msgid "" "The example also includes a basic record and playback facility implemented " "with the :meth:`~Cmd.precmd` method which is responsible for converting the " -"input to lowercase and writing the commands to a file. The :meth:" -"`do_playback` method reads the file and adds the recorded commands to the :" -"attr:`cmdqueue` for immediate playback::" +"input to lowercase and writing the commands to a file. The :meth:`!" +"do_playback` method reads the file and adds the recorded commands to the :" +"attr:`~Cmd.cmdqueue` for immediate playback::" msgstr "" -#: ../../library/cmd.rst:327 +#: ../../library/cmd.rst:330 msgid "" "Here is a sample session with the turtle shell showing the help functions, " "using blank lines to repeat commands, and the simple record and playback " diff --git a/library/datetime.po b/library/datetime.po index 40493c2523..5388a1b332 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-16 00:03+0000\n" +"POT-Creation-Date: 2023-12-23 16:09+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -376,7 +376,7 @@ msgstr "" #: ../../library/datetime.rst:265 ../../library/datetime.rst:561 #: ../../library/datetime.rst:1074 ../../library/datetime.rst:1693 -#: ../../library/datetime.rst:2296 +#: ../../library/datetime.rst:2298 msgid "Class attributes:" msgstr "類別屬性:" @@ -595,7 +595,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:364 ../../library/datetime.rst:613 -#: ../../library/datetime.rst:2527 +#: ../../library/datetime.rst:2529 msgid "Notes:" msgstr "註解:" @@ -669,7 +669,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:431 ../../library/datetime.rst:642 -#: ../../library/datetime.rst:1221 ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1221 ../../library/datetime.rst:1823 msgid "Instance methods:" msgstr "實例方法:" @@ -906,7 +906,7 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:649 ../../library/datetime.rst:1864 +#: ../../library/datetime.rst:649 ../../library/datetime.rst:1866 msgid "Example::" msgstr "" "範例:\n" @@ -1113,7 +1113,7 @@ msgid "``fold in [0, 1]``." msgstr "" #: ../../library/datetime.rst:859 ../../library/datetime.rst:1255 -#: ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1833 msgid "Added the ``fold`` argument." msgstr "新增 ``fold`` 引數。" @@ -1420,10 +1420,10 @@ msgstr "" msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1152 ../../library/datetime.rst:2354 -#: ../../library/datetime.rst:2359 ../../library/datetime.rst:2371 -#: ../../library/datetime.rst:2376 ../../library/datetime.rst:2436 -#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:1152 ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2361 ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2438 +#: ../../library/datetime.rst:2443 ../../library/datetime.rst:2447 msgid "\\(1)" msgstr "\\(1)" @@ -1431,7 +1431,7 @@ msgstr "\\(1)" msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1154 ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:1154 ../../library/datetime.rst:2389 msgid "\\(2)" msgstr "\\(2)" @@ -1623,9 +1623,9 @@ msgid "" "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1311 ../../library/datetime.rst:1904 -#: ../../library/datetime.rst:2011 ../../library/datetime.rst:2256 -#: ../../library/datetime.rst:2268 ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:1311 ../../library/datetime.rst:1906 +#: ../../library/datetime.rst:2013 ../../library/datetime.rst:2258 +#: ../../library/datetime.rst:2270 ../../library/datetime.rst:2582 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" @@ -1636,8 +1636,8 @@ msgid "" "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1321 ../../library/datetime.rst:1914 -#: ../../library/datetime.rst:2065 +#: ../../library/datetime.rst:1321 ../../library/datetime.rst:1916 +#: ../../library/datetime.rst:2067 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" @@ -1788,45 +1788,45 @@ msgid "" "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1471 ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1471 ../../library/datetime.rst:1846 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1475 ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1475 ../../library/datetime.rst:1850 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 +#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1852 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1853 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1479 ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1479 ../../library/datetime.rst:1854 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1481 ../../library/datetime.rst:1854 +#: ../../library/datetime.rst:1481 ../../library/datetime.rst:1856 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1483 ../../library/datetime.rst:1856 +#: ../../library/datetime.rst:1483 ../../library/datetime.rst:1858 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1487 ../../library/datetime.rst:1860 +#: ../../library/datetime.rst:1487 ../../library/datetime.rst:1862 msgid "Excluded time components are truncated, not rounded." msgstr "" @@ -1834,7 +1834,7 @@ msgstr "" msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1499 ../../library/datetime.rst:1875 +#: ../../library/datetime.rst:1499 ../../library/datetime.rst:1877 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" @@ -2003,13 +2003,13 @@ msgid "" "truncated)." msgstr "" -#: ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:1818 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1826 +#: ../../library/datetime.rst:1828 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2017,46 +2017,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1839 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1841 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1840 +#: ../../library/datetime.rst:1842 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1841 +#: ../../library/datetime.rst:1843 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1842 +#: ../../library/datetime.rst:1844 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1862 +#: ../../library/datetime.rst:1864 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:1883 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1886 +#: ../../library/datetime.rst:1888 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1892 +#: ../../library/datetime.rst:1894 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2148 +#: ../../library/datetime.rst:2150 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2326,7 +2326,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2162 +#: ../../library/datetime.rst:2164 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2335,7 +2335,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2181 +#: ../../library/datetime.rst:2183 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2350,13 +2350,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2203 +#: ../../library/datetime.rst:2205 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2206 +#: ../../library/datetime.rst:2208 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2366,28 +2366,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2222 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2217 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2219 +#: ../../library/datetime.rst:2221 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2226 +#: ../../library/datetime.rst:2228 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2223 +#: ../../library/datetime.rst:2225 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2396,24 +2396,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2235 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2235 +#: ../../library/datetime.rst:2237 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2239 +#: ../../library/datetime.rst:2241 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2246 +#: ../../library/datetime.rst:2248 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2421,25 +2421,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2251 +#: ../../library/datetime.rst:2253 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2273 +#: ../../library/datetime.rst:2264 ../../library/datetime.rst:2275 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2265 +#: ../../library/datetime.rst:2267 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2276 +#: ../../library/datetime.rst:2278 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2448,144 +2448,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2282 +#: ../../library/datetime.rst:2284 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2289 +#: ../../library/datetime.rst:2291 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2295 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2302 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2311 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2311 +#: ../../library/datetime.rst:2313 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2317 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2321 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2325 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2325 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2327 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2329 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2329 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2327 +#: ../../library/datetime.rst:2329 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2331 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2331 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2331 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2331 +#: ../../library/datetime.rst:2333 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2331 +#: ../../library/datetime.rst:2333 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2331 +#: ../../library/datetime.rst:2333 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2338 +#: ../../library/datetime.rst:2340 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2340 +#: ../../library/datetime.rst:2342 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2350 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2352 ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2352 ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2352 ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2352 ../../library/datetime.rst:2455 +#: ../../library/datetime.rst:2354 ../../library/datetime.rst:2457 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2354 +#: ../../library/datetime.rst:2356 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2354 +#: ../../library/datetime.rst:2356 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2597,11 +2597,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2361 msgid "Weekday as locale's full name." msgstr "" @@ -2613,42 +2613,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2366 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2366 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2366 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2368 +#: ../../library/datetime.rst:2370 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2381 -#: ../../library/datetime.rst:2384 ../../library/datetime.rst:2390 -#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2399 -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2370 ../../library/datetime.rst:2383 +#: ../../library/datetime.rst:2386 ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2401 +#: ../../library/datetime.rst:2419 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2373 msgid "Month as locale's abbreviated name." msgstr "" @@ -2660,11 +2660,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2378 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2376 +#: ../../library/datetime.rst:2378 msgid "Month as locale's full name." msgstr "" @@ -2676,67 +2676,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2383 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2383 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2383 ../../library/datetime.rst:2395 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2386 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2386 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2386 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2389 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2389 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2389 ../../library/datetime.rst:2459 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2392 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2395 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2395 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2398 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2398 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2748,128 +2748,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2398 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2401 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2399 ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2401 ../../library/datetime.rst:2404 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2404 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2407 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2409 ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2411 ../../library/datetime.rst:2580 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2411 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2411 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2409 ../../library/datetime.rst:2414 -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2411 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2473 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2606 +#: ../../library/datetime.rst:2416 ../../library/datetime.rst:2608 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2416 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2416 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2419 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2419 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2419 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2422 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2422 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2420 ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2422 ../../library/datetime.rst:2430 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2420 ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2422 ../../library/datetime.rst:2430 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2430 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2430 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2438 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2438 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2881,11 +2881,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2443 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2441 +#: ../../library/datetime.rst:2443 msgid "Locale's appropriate date representation." msgstr "" @@ -2901,11 +2901,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2447 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2447 msgid "Locale's appropriate time representation." msgstr "" @@ -2917,83 +2917,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2450 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2450 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2448 +#: ../../library/datetime.rst:2450 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2453 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2459 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2459 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2459 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2464 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2464 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2464 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2467 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2467 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2467 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2467 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2471 ../../library/datetime.rst:2592 +#: ../../library/datetime.rst:2473 ../../library/datetime.rst:2594 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2473 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2473 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2477 +#: ../../library/datetime.rst:2479 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -3002,7 +3002,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2484 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -3012,44 +3012,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2488 +#: ../../library/datetime.rst:2490 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2493 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2497 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2499 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2503 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2507 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2511 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2513 +#: ../../library/datetime.rst:2515 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`time` objects have no such values. If they're used " @@ -3060,7 +3060,7 @@ msgstr "" "物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代替、月及日會以 " "``1`` 代替。" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2519 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3069,7 +3069,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:2523 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3078,7 +3078,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2532 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3086,37 +3086,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2536 +#: ../../library/datetime.rst:2538 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2539 +#: ../../library/datetime.rst:2541 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2543 +#: ../../library/datetime.rst:2545 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2548 +#: ../../library/datetime.rst:2550 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2552 +#: ../../library/datetime.rst:2554 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2556 +#: ../../library/datetime.rst:2558 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3124,17 +3124,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2563 +#: ../../library/datetime.rst:2565 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2568 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2569 +#: ../../library/datetime.rst:2571 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3148,7 +3148,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2583 +#: ../../library/datetime.rst:2585 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3156,53 +3156,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2593 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2595 +#: ../../library/datetime.rst:2597 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2601 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2603 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2604 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2604 +#: ../../library/datetime.rst:2606 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2608 +#: ../../library/datetime.rst:2610 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2614 +#: ../../library/datetime.rst:2616 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2621 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3210,22 +3210,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2627 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2630 +#: ../../library/datetime.rst:2632 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2631 +#: ../../library/datetime.rst:2633 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2633 +#: ../../library/datetime.rst:2635 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3234,23 +3234,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2639 +#: ../../library/datetime.rst:2641 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2643 +#: ../../library/datetime.rst:2645 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2303 +#: ../../library/datetime.rst:2305 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2303 +#: ../../library/datetime.rst:2305 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dbm.po b/library/dbm.po index 2903f03dd3..63f1f9cda2 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-12-23 16:09+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,8 +58,8 @@ msgid "" "name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``." msgstr "" -#: ../../library/dbm.rst:36 ../../library/dbm.rst:210 ../../library/dbm.rst:309 -#: ../../library/dbm.rst:393 +#: ../../library/dbm.rst:36 ../../library/dbm.rst:210 ../../library/dbm.rst:316 +#: ../../library/dbm.rst:400 msgid "Accepts :term:`path-like object` for filename." msgstr "" @@ -74,61 +74,61 @@ msgid "" "the first module listed above that can be imported is used." msgstr "" -#: ../../library/dbm.rst:47 ../../library/dbm.rst:166 ../../library/dbm.rst:357 +#: ../../library/dbm.rst:47 ../../library/dbm.rst:166 ../../library/dbm.rst:364 msgid "The optional *flag* argument can be:" msgstr "" #: ../../library/dbm.rst:50 ../../library/dbm.rst:169 ../../library/dbm.rst:188 -#: ../../library/dbm.rst:287 ../../library/dbm.rst:360 +#: ../../library/dbm.rst:294 ../../library/dbm.rst:367 msgid "Value" msgstr "" #: ../../library/dbm.rst:50 ../../library/dbm.rst:169 ../../library/dbm.rst:188 -#: ../../library/dbm.rst:287 ../../library/dbm.rst:360 +#: ../../library/dbm.rst:294 ../../library/dbm.rst:367 msgid "Meaning" msgstr "" -#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:289 -#: ../../library/dbm.rst:362 +#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:296 +#: ../../library/dbm.rst:369 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:289 -#: ../../library/dbm.rst:362 +#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:296 +#: ../../library/dbm.rst:369 msgid "Open existing database for reading only (default)" msgstr "" -#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:292 -#: ../../library/dbm.rst:365 +#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:299 +#: ../../library/dbm.rst:372 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:292 -#: ../../library/dbm.rst:365 +#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:299 +#: ../../library/dbm.rst:372 msgid "Open existing database for reading and writing" msgstr "" -#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:295 -#: ../../library/dbm.rst:368 +#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:302 +#: ../../library/dbm.rst:375 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:295 -#: ../../library/dbm.rst:368 +#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:302 +#: ../../library/dbm.rst:375 msgid "Open database for reading and writing, creating it if it doesn't exist" msgstr "" -#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:298 -#: ../../library/dbm.rst:371 +#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:305 +#: ../../library/dbm.rst:378 msgid "``'n'``" msgstr "``'n'``" -#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:298 -#: ../../library/dbm.rst:371 +#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:305 +#: ../../library/dbm.rst:378 msgid "Always create a new, empty database, open for reading and writing" msgstr "" -#: ../../library/dbm.rst:65 ../../library/dbm.rst:302 ../../library/dbm.rst:375 +#: ../../library/dbm.rst:65 ../../library/dbm.rst:309 ../../library/dbm.rst:382 msgid "" "The optional *mode* argument is the Unix mode of the file, used only when " "the database has to be created. It defaults to octal ``0o666`` (and will be " @@ -347,45 +347,53 @@ msgstr "" #: ../../library/dbm.rst:270 msgid "" +"The ndbm library shipped as part of macOS has an undocumented limitation on " +"the size of values, which can result in corrupted database files when " +"storing values larger than this limit. Reading such corrupted files can " +"result in a hard crash (segmentation fault)." +msgstr "" + +#: ../../library/dbm.rst:277 +msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:276 +#: ../../library/dbm.rst:283 msgid "Name of the ``ndbm`` implementation library used." msgstr "" -#: ../../library/dbm.rst:281 +#: ../../library/dbm.rst:288 msgid "" "Open a dbm database and return a ``ndbm`` object. The *filename* argument " "is the name of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" -#: ../../library/dbm.rst:284 +#: ../../library/dbm.rst:291 msgid "The optional *flag* argument must be one of these values:" msgstr "" -#: ../../library/dbm.rst:306 +#: ../../library/dbm.rst:313 msgid "" "In addition to the dictionary-like methods, ``ndbm`` objects provide the " "following method:" msgstr "" -#: ../../library/dbm.rst:314 +#: ../../library/dbm.rst:321 msgid "Close the ``ndbm`` database." msgstr "" -#: ../../library/dbm.rst:318 +#: ../../library/dbm.rst:325 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr "" -#: ../../library/dbm.rst:323 +#: ../../library/dbm.rst:330 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:329 +#: ../../library/dbm.rst:336 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -393,7 +401,7 @@ msgid "" "the other database modules." msgstr "" -#: ../../library/dbm.rst:336 +#: ../../library/dbm.rst:343 msgid "" "The :mod:`dbm.dumb` module provides a persistent dictionary-like interface " "which is written entirely in Python. Unlike other modules such as :mod:`dbm." @@ -401,18 +409,18 @@ msgid "" "the keys and values are always stored as bytes." msgstr "" -#: ../../library/dbm.rst:341 +#: ../../library/dbm.rst:348 msgid "The module defines the following:" msgstr "" -#: ../../library/dbm.rst:346 +#: ../../library/dbm.rst:353 msgid "" "Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:352 +#: ../../library/dbm.rst:359 msgid "" "Open a ``dumbdbm`` database and return a dumbdbm object. The *filename* " "argument is the basename of the database file (without any specific " @@ -420,42 +428,42 @@ msgid "" "and :file:`.dir` extensions are created." msgstr "" -#: ../../library/dbm.rst:380 +#: ../../library/dbm.rst:387 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: ../../library/dbm.rst:384 +#: ../../library/dbm.rst:391 msgid "" ":func:`.open` always creates a new database when the flag has the value " "``'n'``." msgstr "" -#: ../../library/dbm.rst:388 +#: ../../library/dbm.rst:395 msgid "" "A database opened with flags ``'r'`` is now read-only. Opening with flags " "``'r'`` and ``'w'`` no longer creates a database if it does not exist." msgstr "" -#: ../../library/dbm.rst:396 +#: ../../library/dbm.rst:403 msgid "" "In addition to the methods provided by the :class:`collections.abc." "MutableMapping` class, :class:`dumbdbm` objects provide the following " "methods:" msgstr "" -#: ../../library/dbm.rst:402 +#: ../../library/dbm.rst:409 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`Shelve.sync` method." msgstr "" -#: ../../library/dbm.rst:407 +#: ../../library/dbm.rst:414 msgid "Close the ``dumbdbm`` database." msgstr "" -#: ../../library/dbm.rst:325 +#: ../../library/dbm.rst:332 msgid "databases" msgstr "databases(資料庫)" diff --git a/library/itertools.po b/library/itertools.po index 48f729ecbf..04d9c6ad12 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-16 00:03+0000\n" +"POT-Creation-Date: 2023-12-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -886,6 +886,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1025 +#: ../../library/itertools.rst:1027 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/random.po b/library/random.po index 4e09c9e99c..6771218a29 100644 --- a/library/random.po +++ b/library/random.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2023-12-29 00:03+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -85,19 +85,13 @@ msgstr "" #: ../../library/random.rst:36 msgid "" "Class :class:`Random` can also be subclassed if you want to use a different " -"basic generator of your own devising: in that case, override the :meth:" -"`~Random.random`, :meth:`~Random.seed`, :meth:`~Random.getstate`, and :meth:" -"`~Random.setstate` methods. Optionally, a new generator can supply a :meth:" -"`~Random.getrandbits` method --- this allows :meth:`randrange` to produce " -"selections over an arbitrarily large range." +"basic generator of your own devising: see the documentation on that class " +"for more details." msgstr "" -"如果你想使用你自己設計的基本產生器,\\ :class:`Random` 也可以進行子類別化 " -"(subclass):在這種情況下,要覆蓋 :meth:`~Random.random`、\\ :meth:`~Random." -"seed`、\\ :meth:`~Random.getstate` 和 :meth:`~Random.setstate` 的方式。你也可" -"以為新的產生器提供 :meth:`~Random.getrandbits` 方法 --- 這允許 :meth:" -"`randrange` 在任意大的範圍內產生選擇。" +"如果你想使用你自己設計的基本產生器,:class:`Random` 也可以進行子類別化 " +"(subclass)。有關詳細資訊,請參考該類別的文件。" -#: ../../library/random.rst:42 +#: ../../library/random.rst:40 msgid "" "The :mod:`random` module also provides the :class:`SystemRandom` class which " "uses the system function :func:`os.urandom` to generate random numbers from " @@ -106,7 +100,7 @@ msgstr "" ":mod:`random` module 也提供了 :class:`SystemRandom` class,使用系統函式 :" "func:`os.urandom` 從作業系統提供的來源產生隨機數。" -#: ../../library/random.rst:48 +#: ../../library/random.rst:46 msgid "" "The pseudo-random generators of this module should not be used for security " "purposes. For security or cryptographic uses, see the :mod:`secrets` module." @@ -114,7 +108,7 @@ msgstr "" "本章所提及的虛擬隨機數產生器不應該使用於安全目的。有關安全性或加密用途,請參" "考 :mod:`secrets` module。" -#: ../../library/random.rst:54 +#: ../../library/random.rst:52 msgid "" "M. Matsumoto and T. Nishimura, \"Mersenne Twister: A 623-dimensionally " "equidistributed uniform pseudorandom number generator\", ACM Transactions on " @@ -124,7 +118,7 @@ msgstr "" "equidistributed uniform pseudorandom number generator\", ACM Transactions on " "Modeling and Computer Simulation Vol. 8, No. 1, January pp.3--30 1998." -#: ../../library/random.rst:59 +#: ../../library/random.rst:57 msgid "" "`Complementary-Multiply-with-Carry recipe `_ for a compatible alternative random number generator with " @@ -134,15 +128,15 @@ msgstr "" "activestate.com/recipes/576707/>`_\\ ,可作為隨機數產生器的一個可相容替代方" "案,具有較長的週期和相對簡單的更新操作。" -#: ../../library/random.rst:66 +#: ../../library/random.rst:64 msgid "Bookkeeping functions" msgstr "簿記函式 (bookkeeping functions)" -#: ../../library/random.rst:70 +#: ../../library/random.rst:68 msgid "Initialize the random number generator." msgstr "初始化隨機數產生器。" -#: ../../library/random.rst:72 +#: ../../library/random.rst:70 msgid "" "If *a* is omitted or ``None``, the current system time is used. If " "randomness sources are provided by the operating system, they are used " @@ -153,11 +147,11 @@ msgstr "" "供,則使用它們而不是系統時間(有關可用性的詳細資訊,請參考 :func:`os." "urandom` 函式)。" -#: ../../library/random.rst:77 +#: ../../library/random.rst:75 msgid "If *a* is an int, it is used directly." msgstr "如果 *a* 為 int(整數),則直接使用它。" -#: ../../library/random.rst:79 +#: ../../library/random.rst:77 msgid "" "With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:" "`bytearray` object gets converted to an :class:`int` and all of its bits are " @@ -166,7 +160,7 @@ msgstr "" "如使用版本 2(預設值),:class:`str`、:class:`bytes` 或 :class:`bytearray` 物" "件將轉換為 :class:`int`,並使用其所有位元。" -#: ../../library/random.rst:82 +#: ../../library/random.rst:80 msgid "" "With version 1 (provided for reproducing random sequences from older " "versions of Python), the algorithm for :class:`str` and :class:`bytes` " @@ -175,20 +169,20 @@ msgstr "" "若使用版本 1(為復現於舊版本 Python 中產生隨機序列而提供),:class:`str` 和 :" "class:`bytes` 的演算法會生成範圍更窄的種子 (seed)。" -#: ../../library/random.rst:86 +#: ../../library/random.rst:84 msgid "" "Moved to the version 2 scheme which uses all of the bits in a string seed." msgstr "移至版本 2 方案,該方案使用字串種子中的所有位元。" -#: ../../library/random.rst:89 +#: ../../library/random.rst:87 msgid "" -"The *seed* must be one of the following types: *NoneType*, :class:`int`, :" +"The *seed* must be one of the following types: ``None``, :class:`int`, :" "class:`float`, :class:`str`, :class:`bytes`, or :class:`bytearray`." msgstr "" -"*seed* 必須是以下型別之一:\\ *NoneType*、\\ :class:`int`、\\ :class:" -"`float`、\\ :class:`str`、\\ :class:`bytes`、\\ :class:`bytearray`。" +"*seed* 必須是以下型別之一:``None``、:class:`int`、:class:`float`、:class:" +"`str`、:class:`bytes`、:class:`bytearray`。" -#: ../../library/random.rst:96 +#: ../../library/random.rst:94 msgid "" "Return an object capturing the current internal state of the generator. " "This object can be passed to :func:`setstate` to restore the state." @@ -196,7 +190,7 @@ msgstr "" "回傳一個物件,捕獲產生器的當前內部狀態。此物件可以傳遞給 :func:`setstate` 以" "恢復狀態。" -#: ../../library/random.rst:102 +#: ../../library/random.rst:100 msgid "" "*state* should have been obtained from a previous call to :func:`getstate`, " "and :func:`setstate` restores the internal state of the generator to what it " @@ -205,47 +199,51 @@ msgstr "" "*state* 應該要從之前對 :func:`getstate` 的呼叫中獲得,並且以 :func:" "`setstate` 將產生器的內部狀態恢復到呼叫 :func:`getstate` 時的狀態。" -#: ../../library/random.rst:108 +#: ../../library/random.rst:106 msgid "Functions for bytes" msgstr "回傳位元組的函式" -#: ../../library/random.rst:112 +#: ../../library/random.rst:110 msgid "Generate *n* random bytes." msgstr "產生 *n* 個隨機位元組。" -#: ../../library/random.rst:114 +#: ../../library/random.rst:112 msgid "" "This method should not be used for generating security tokens. Use :func:" "`secrets.token_bytes` instead." msgstr "" "此方法不應使用於產生安全性權杖 (Token)。請改用 :func:`secrets.token_bytes`。" -#: ../../library/random.rst:121 +#: ../../library/random.rst:119 msgid "Functions for integers" msgstr "回傳整數的函式" -#: ../../library/random.rst:126 +#: ../../library/random.rst:124 msgid "Return a randomly selected element from ``range(start, stop, step)``." -msgstr "" +msgstr "傳回從 ``range(start, stop, step)`` 中隨機選擇的元素。" -#: ../../library/random.rst:128 +#: ../../library/random.rst:126 msgid "" "This is roughly equivalent to ``choice(range(start, stop, step))`` but " "supports arbitrarily large ranges and is optimized for common cases." msgstr "" +"這大致相當於 ``choice(range(start, stop, step))``,但支援任意大的範圍,並針對" +"常見情況進行了最佳化。" -#: ../../library/random.rst:131 +#: ../../library/random.rst:129 msgid "The positional argument pattern matches the :func:`range` function." -msgstr "" +msgstr "位置引數模式與 :func:`range` 函式相符。" -#: ../../library/random.rst:133 +#: ../../library/random.rst:131 msgid "" "Keyword arguments should not be used because they can be interpreted in " "unexpected ways. For example ``randrange(start=100)`` is interpreted as " "``randrange(0, 100, 1)``." msgstr "" +"不應使用關鍵字引數,因為它們可能會以意想不到的方式被直譯。例如 " +"``randrange(start=100)`` 會被直譯為 ``randrange(0, 100, 1)``。" -#: ../../library/random.rst:137 +#: ../../library/random.rst:135 msgid "" ":meth:`randrange` is more sophisticated about producing equally distributed " "values. Formerly it used a style like ``int(random()*n)`` which could " @@ -254,7 +252,7 @@ msgstr "" ":meth:`randrange` 在產生均勻分佈的值方面更為複雜。以前,它使用像 " "``int(random()*n)`` 這樣的樣式,這可能會產生稍微不均勻的分佈。" -#: ../../library/random.rst:142 +#: ../../library/random.rst:140 msgid "" "Automatic conversion of non-integer types is no longer supported. Calls such " "as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` now raise a :exc:" @@ -263,14 +261,14 @@ msgstr "" "已經不再支援非整數類型到等效整數的自動轉換。像是 ``randrange(10.0)`` 和 " "``randrange(Fraction(10, 1))`` 的呼叫將會引發 :exc:`TypeError`。" -#: ../../library/random.rst:149 +#: ../../library/random.rst:147 msgid "" "Return a random integer *N* such that ``a <= N <= b``. Alias for " "``randrange(a, b+1)``." msgstr "" "回傳一個隨機整數 *N*,使得 ``a <= N <= b``。為 ``randrange(a, b+1)`` 的別名。" -#: ../../library/random.rst:154 +#: ../../library/random.rst:152 msgid "" "Returns a non-negative Python integer with *k* random bits. This method is " "supplied with the Mersenne Twister generator and some other generators may " @@ -278,18 +276,18 @@ msgid "" "`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." msgstr "" "回傳一個具有 *k* 個隨機位元的非負 Python 整數。此方法會隨 Mersenne Twister 產" -"生器一起提供,一些其他的產生器也可能將其作為 API 的可選部分。如果可用,\\ :" -"meth:`getrandbits` 使 :meth:`randrange` 能夠處理任意大的範圍。" +"生器一起提供,一些其他的產生器也可能將其作為 API 的可選部分。如果可用,:meth:" +"`getrandbits` 使 :meth:`randrange` 能夠處理任意大的範圍。" -#: ../../library/random.rst:160 +#: ../../library/random.rst:158 msgid "This method now accepts zero for *k*." msgstr "此方法現在接受 *k* 為零。" -#: ../../library/random.rst:165 +#: ../../library/random.rst:163 msgid "Functions for sequences" msgstr "回傳序列的函式" -#: ../../library/random.rst:169 +#: ../../library/random.rst:167 msgid "" "Return a random element from the non-empty sequence *seq*. If *seq* is " "empty, raises :exc:`IndexError`." @@ -297,7 +295,7 @@ msgstr "" "從非空序列 *seq* 回傳一個隨機元素。如果 *seq* 為空,則引發 :exc:" "`IndexError`。" -#: ../../library/random.rst:174 +#: ../../library/random.rst:172 msgid "" "Return a *k* sized list of elements chosen from the *population* with " "replacement. If the *population* is empty, raises :exc:`IndexError`." @@ -305,7 +303,7 @@ msgstr "" "回傳從 *population* 中重置取樣出的一個大小為 *k* 的元素 list。如果 " "*population* 為空,則引發 :exc:`IndexError`。" -#: ../../library/random.rst:177 +#: ../../library/random.rst:175 msgid "" "If a *weights* sequence is specified, selections are made according to the " "relative weights. Alternatively, if a *cum_weights* sequence is given, the " @@ -321,7 +319,7 @@ msgstr "" "15, 45, 50]``。在內部,相對權重在進行選擇之前會轉換為累積權重,因此提供累積權" "重可以節省工作。" -#: ../../library/random.rst:186 +#: ../../library/random.rst:184 msgid "" "If neither *weights* nor *cum_weights* are specified, selections are made " "with equal probability. If a weights sequence is supplied, it must be the " @@ -332,7 +330,7 @@ msgstr "" "供了加權序列,則該序列的長度必須與 *population* 序列的長度相同。它是一個 :" "exc:`TypeError` 來指定 *weights* 和 *cum_weights*。" -#: ../../library/random.rst:191 +#: ../../library/random.rst:189 msgid "" "The *weights* or *cum_weights* can use any numeric type that interoperates " "with the :class:`float` values returned by :func:`random` (that includes " @@ -345,7 +343,7 @@ msgstr "" "數值類型。權重假定為非負數和有限的。如果所有權重均為零,則引發 :exc:" "`ValueError`。" -#: ../../library/random.rst:197 +#: ../../library/random.rst:195 msgid "" "For a given seed, the :func:`choices` function with equal weighting " "typically produces a different sequence than repeated calls to :func:" @@ -359,15 +357,15 @@ msgstr "" "和速度。:func:`choice` 使用的演算法預設為整數運算和重複選擇,以避免捨入誤差產" "生的小偏差。" -#: ../../library/random.rst:206 +#: ../../library/random.rst:204 msgid "Raises a :exc:`ValueError` if all weights are zero." msgstr "如果所有權重均為零,則引發 :exc:`ValueError`。" -#: ../../library/random.rst:212 +#: ../../library/random.rst:210 msgid "Shuffle the sequence *x* in place." msgstr "將序列 *x* 原地 (in place) 隨機打亂位置。" -#: ../../library/random.rst:214 +#: ../../library/random.rst:212 msgid "" "To shuffle an immutable sequence and return a new shuffled list, use " "``sample(x, k=len(x))`` instead." @@ -375,7 +373,7 @@ msgstr "" "要打亂一個不可變的序列並回傳一個新的被打亂的 list(串列),請使用 " "``sample(x, k=len(x))``。" -#: ../../library/random.rst:217 +#: ../../library/random.rst:215 msgid "" "Note that even for small ``len(x)``, the total number of permutations of *x* " "can quickly grow larger than the period of most random number generators. " @@ -387,11 +385,11 @@ msgstr "" "數產生器的週期。這意味著長序列的大多數置換永遠無法產生。例如,長度為 2080 的" "序列是 Mersenne Twister 隨機數產生器週期內可以容納的最大序列。" -#: ../../library/random.rst:223 +#: ../../library/random.rst:221 msgid "Removed the optional parameter *random*." msgstr "移除可選參數 *random*。" -#: ../../library/random.rst:229 +#: ../../library/random.rst:227 msgid "" "Return a *k* length list of unique elements chosen from the population " "sequence. Used for random sampling without replacement." @@ -399,7 +397,7 @@ msgstr "" "回傳從母體序列中選擇出的一個包含獨特元素、長度為 *k* 的 list。用於不重置的隨" "機取樣。" -#: ../../library/random.rst:232 +#: ../../library/random.rst:230 msgid "" "Returns a new list containing elements from the population while leaving the " "original population unchanged. The resulting list is in selection order so " @@ -411,7 +409,7 @@ msgstr "" "此所有子切片也會是有效的隨機樣本。這允許抽獎獲獎者(樣本)分為大獎和第二名獲" "獎者(子切片)。" -#: ../../library/random.rst:238 +#: ../../library/random.rst:236 msgid "" "Members of the population need not be :term:`hashable` or unique. If the " "population contains repeats, then each occurrence is a possible selection in " @@ -420,7 +418,7 @@ msgstr "" "母體成員不必是 :term:`hashable` 或唯一的。如果母體包含重複項,則每次出現都是" "樣本中可能出現的一個選擇。" -#: ../../library/random.rst:241 +#: ../../library/random.rst:239 msgid "" "Repeated elements can be specified one at a time or with the optional " "keyword-only *counts* parameter. For example, ``sample(['red', 'blue'], " @@ -431,62 +429,67 @@ msgstr "" "素。例如 ``sample(['red', 'blue'], counts=[4, 2], k=5)`` 等同於 " "``sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5)``。" -#: ../../library/random.rst:246 +#: ../../library/random.rst:244 msgid "" "To choose a sample from a range of integers, use a :func:`range` object as " "an argument. This is especially fast and space efficient for sampling from " "a large population: ``sample(range(10000000), k=60)``." msgstr "" "若要從整數範圍中選擇範例,請使用 :func:`range` 物件作為引數。這對於從大型母體" -"中取樣特別快速且節省空間:\\ ``sample(range(10000000), k=60)``。" +"中取樣特別快速且節省空間:``sample(range(10000000), k=60)``。" -#: ../../library/random.rst:250 +#: ../../library/random.rst:248 msgid "" "If the sample size is larger than the population size, a :exc:`ValueError` " "is raised." msgstr "如果樣本大小大於母體大小,:exc:`ValueError` 會被引發。" -#: ../../library/random.rst:253 +#: ../../library/random.rst:251 msgid "Added the *counts* parameter." msgstr "新增 *counts* 參數。" -#: ../../library/random.rst:258 +#: ../../library/random.rst:256 msgid "" "The *population* must be a sequence. Automatic conversion of sets to lists " "is no longer supported." -msgstr "" +msgstr "*population* 必須是一個序列。不再支援將 set 自動轉換為 list。" -#: ../../library/random.rst:262 +#: ../../library/random.rst:260 msgid "Discrete distributions" msgstr "離散分布" -#: ../../library/random.rst:264 +#: ../../library/random.rst:262 msgid "The following function generates a discrete distribution." -msgstr "" +msgstr "以下函式產生離散分佈。" -#: ../../library/random.rst:268 +#: ../../library/random.rst:266 msgid "" "`Binomial distribution `_. Return the number of successes for *n* independent trials with the " "probability of success in each trial being *p*:" msgstr "" +"`二項分佈 (Binomial distribution) `_。回傳 *n* 個獨立試驗的成功次數,每個試驗的成功機" +"率為 *p*:" -#: ../../library/random.rst:273 +#: ../../library/random.rst:271 msgid "Mathematically equivalent to::" -msgstr "" +msgstr "數學上等價於: ::" -#: ../../library/random.rst:277 +#: ../../library/random.rst:275 msgid "" "The number of trials *n* should be a non-negative integer. The probability " "of success *p* should be between ``0.0 <= p <= 1.0``. The result is an " "integer in the range ``0 <= X <= n``." msgstr "" +"試驗次數 *n* 應為非負整數。成功的機率 *p* 應在 ``0.0 <= p <= 1.0`` 之間。結果" +"是 ``0 <= X <= n`` 範圍內的整數。" -#: ../../library/random.rst:287 +#: ../../library/random.rst:285 msgid "Real-valued distributions" msgstr "實數分布" -#: ../../library/random.rst:289 +#: ../../library/random.rst:287 msgid "" "The following functions generate specific real-valued distributions. " "Function parameters are named after the corresponding variables in the " @@ -496,12 +499,12 @@ msgstr "" "以下函式產生特定的實數分佈。函式參數以分佈方程中的對應變數命名,如常見的數學" "實踐所示;這些方程式中的大多數都可以在任意統計文本中找到。" -#: ../../library/random.rst:297 +#: ../../library/random.rst:295 msgid "" "Return the next random floating point number in the range ``0.0 <= X < 1.0``" msgstr "回傳範圍 ``0.0 <= X < 1.0`` 中的下一個隨機浮點數" -#: ../../library/random.rst:302 +#: ../../library/random.rst:300 msgid "" "Return a random floating point number *N* such that ``a <= N <= b`` for ``a " "<= b`` and ``b <= N <= a`` for ``b < a``." @@ -509,7 +512,7 @@ msgstr "" "回傳一個隨機浮點數 *N*,當 ``a <= b`` 時確保 N 為 ``a <= N <= b`` 、``b < " "a`` 時確保 N 為 ``b <= N <= a``。" -#: ../../library/random.rst:305 +#: ../../library/random.rst:303 msgid "" "The end-point value ``b`` may or may not be included in the range depending " "on floating-point rounding in the equation ``a + (b-a) * random()``." @@ -517,7 +520,7 @@ msgstr "" "終點值 ``b`` 可能包含在範圍內,也可能不包含在範圍內,取決於方程式 ``a + (b-" "a) * random()`` 中的浮點捨入。" -#: ../../library/random.rst:311 +#: ../../library/random.rst:309 msgid "" "Return a random floating point number *N* such that ``low <= N <= high`` and " "with the specified *mode* between those bounds. The *low* and *high* bounds " @@ -528,7 +531,7 @@ msgstr "" "的 *mode*。*low* 和 *high* 邊界預設為零和一。*mode* 引數預設為邊界之間的中" "點,從而給出對稱分佈。" -#: ../../library/random.rst:319 +#: ../../library/random.rst:317 msgid "" "Beta distribution. Conditions on the parameters are ``alpha > 0`` and " "``beta > 0``. Returned values range between 0 and 1." @@ -536,7 +539,7 @@ msgstr "" "Beta(貝它)分布。參數的條件為 ``alpha > 0`` 和 ``beta > 0``。回傳值的範圍介" "於 0 和 1 之間。" -#: ../../library/random.rst:325 +#: ../../library/random.rst:323 msgid "" "Exponential distribution. *lambd* is 1.0 divided by the desired mean. It " "should be nonzero. (The parameter would be called \"lambda\", but that is a " @@ -548,11 +551,11 @@ msgstr "" "\"lambda\",但這是 Python 中的保留字)如果 *lambd* 為正,則回傳值的範圍從 0 " "到正無窮大;如果 *lambd* 為負,則回傳值的範圍從負無窮大到 0。" -#: ../../library/random.rst:331 +#: ../../library/random.rst:329 msgid "Added the default value for ``lambd``." msgstr "新增 ``lambd`` 的預設值。" -#: ../../library/random.rst:337 +#: ../../library/random.rst:335 msgid "" "Gamma distribution. (*Not* the gamma function!) The shape and scale " "parameters, *alpha* and *beta*, must have positive values. (Calling " @@ -562,14 +565,11 @@ msgstr "" "*alpha* 和 *beta* 必須具有正值。(根據呼叫習慣不同,部分來源會將 'beta' 定義" "為比例的倒數)。" -#: ../../library/random.rst:342 +#: ../../library/random.rst:340 msgid "The probability distribution function is::" -msgstr "" -"Probability distribution function(機率密度函式)是:\n" -"\n" -"::" +msgstr "Probability distribution function(機率密度函式)是: ::" -#: ../../library/random.rst:351 +#: ../../library/random.rst:349 msgid "" "Normal distribution, also called the Gaussian distribution. *mu* is the " "mean, and *sigma* is the standard deviation. This is slightly faster than " @@ -578,7 +578,7 @@ msgstr "" "常態分佈,也稱為高斯分佈。*mu* 是平均數,*sigma* 是標準差。這比下面定義的 :" "func:`normalvariate` 函式快一點。" -#: ../../library/random.rst:356 +#: ../../library/random.rst:354 msgid "" "Multithreading note: When two threads call this function simultaneously, it " "is possible that they will receive the same return value. This can be " @@ -590,11 +590,11 @@ msgstr "" "可以透過三種方式避免。1)讓每個執行緒使用隨機數產生器的不同實例。2)在所有呼" "叫周圍加鎖。3)使用較慢但執行緒安全的 :func:`normalvariate` 函式代替。" -#: ../../library/random.rst:363 ../../library/random.rst:379 +#: ../../library/random.rst:361 ../../library/random.rst:377 msgid "*mu* and *sigma* now have default arguments." -msgstr "" +msgstr "*mu* 和 *sigma* 現在有預設引數。" -#: ../../library/random.rst:369 +#: ../../library/random.rst:367 msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " @@ -604,13 +604,13 @@ msgstr "" "對數常態分佈。如果你取此分佈的自然對數,你將獲得一個具有平均數 *mu* 和標準差 " "*sigma* 的常態分佈。*mu* 可以為任何值,並且 *sigma* 必須大於零。" -#: ../../library/random.rst:377 +#: ../../library/random.rst:375 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "常態分佈。*mu* 是平均數,*sigma* 是標準差。" -#: ../../library/random.rst:385 +#: ../../library/random.rst:383 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -621,28 +621,28 @@ msgstr "" "大於或等於零。如果 *kappa* 等於零,則此分佈在 0 到 2\\*\\ *pi* 的範圍內將減小" "為均勻的隨機角度。" -#: ../../library/random.rst:393 +#: ../../library/random.rst:391 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "Pareto distribution(柏拉圖分佈)。*alpha* 是形狀參數。" -#: ../../library/random.rst:398 +#: ../../library/random.rst:396 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" "Weibull distribution(韋伯分佈)。*alpha* 是比例參數,*beta* 是形狀參數。" -#: ../../library/random.rst:403 +#: ../../library/random.rst:401 msgid "Alternative Generator" msgstr "替代產生器" -#: ../../library/random.rst:407 +#: ../../library/random.rst:405 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "實現 :mod:`random` 模組使用的預設偽隨機數產生器的 class。" -#: ../../library/random.rst:410 +#: ../../library/random.rst:408 msgid "" "Formerly the *seed* could be any hashable object. Now it is limited to: " "``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" @@ -651,7 +651,59 @@ msgstr "" "過去 *seed* 可以是任何可雜湊物件,但現在必須是以下類型之一:``None``、:class:" "`int`、:class:`float`、:class:`str`、:class:`bytes`、:class:`bytearray`。" -#: ../../library/random.rst:417 +#: ../../library/random.rst:413 +msgid "" +"Subclasses of :class:`!Random` should override the following methods if they " +"wish to make use of a different basic generator:" +msgstr "" +"如果 :class:`!Random` 的子類別希望使用不同的基礎產生器,則應該覆寫以下方法:" + +#: ../../library/random.rst:418 +msgid "" +"Override this method in subclasses to customise the :meth:`~random.seed` " +"behaviour of :class:`!Random` instances." +msgstr "" +"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.seed` 行" +"為。" + +#: ../../library/random.rst:423 +msgid "" +"Override this method in subclasses to customise the :meth:`~random.getstate` " +"behaviour of :class:`!Random` instances." +msgstr "" +"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.getstate` " +"行為。" + +#: ../../library/random.rst:428 +msgid "" +"Override this method in subclasses to customise the :meth:`~random.setstate` " +"behaviour of :class:`!Random` instances." +msgstr "" +"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.setstate` " +"行為。" + +#: ../../library/random.rst:433 +msgid "" +"Override this method in subclasses to customise the :meth:`~random.random` " +"behaviour of :class:`!Random` instances." +msgstr "" +"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random.random` 行" +"為。" + +#: ../../library/random.rst:436 +msgid "" +"Optionally, a custom generator subclass can also supply the following method:" +msgstr "或者,自訂產生器子類別還可以提供以下方法:" + +#: ../../library/random.rst:440 +msgid "" +"Override this method in subclasses to customise the :meth:`~random." +"getrandbits` behaviour of :class:`!Random` instances." +msgstr "" +"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random." +"getrandbits` 行為。" + +#: ../../library/random.rst:446 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -665,11 +717,11 @@ msgstr "" "有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :" "exc:`NotImplementedError`。" -#: ../../library/random.rst:426 +#: ../../library/random.rst:455 msgid "Notes on Reproducibility" msgstr "關於 Reproducibility(復現性)的注意事項" -#: ../../library/random.rst:428 +#: ../../library/random.rst:457 msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By reusing a seed value, the same sequence " @@ -679,7 +731,7 @@ msgstr "" "有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使" "用種子值,同一序列就應該可以被復現。" -#: ../../library/random.rst:432 +#: ../../library/random.rst:461 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" @@ -687,13 +739,13 @@ msgstr "" "大多數隨機 module 的演算法和 seed 設定函式在 Python 版本中可能會發生變化,但" "可以保證兩個方面不會改變:" -#: ../../library/random.rst:435 +#: ../../library/random.rst:464 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "如果增加了新的 seed 設定函式,則將提供向後相容的播種器 (seeder)。" -#: ../../library/random.rst:438 +#: ../../library/random.rst:467 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." @@ -701,25 +753,19 @@ msgstr "" "當相容的播種器被賦予相同的種子時,產生器的 :meth:`~Random.random` 方法將持續" "產生相同的序列。" -#: ../../library/random.rst:444 +#: ../../library/random.rst:473 msgid "Examples" msgstr "範例" -#: ../../library/random.rst:446 +#: ../../library/random.rst:475 msgid "Basic examples::" -msgstr "" -"基礎範例:\n" -"\n" -"::" +msgstr "基礎範例: ::" -#: ../../library/random.rst:474 +#: ../../library/random.rst:503 msgid "Simulations::" -msgstr "" -"模擬:\n" -"\n" -"::" +msgstr "模擬: ::" -#: ../../library/random.rst:499 +#: ../../library/random.rst:528 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " @@ -727,11 +773,9 @@ msgid "" msgstr "" "`統計 bootstrapping(自助法) `_\\ 的範例,使用有重置的重新取樣來估計樣本平均數" -"的信賴區間:\n" -"\n" -"::" +"的信賴區間: ::" -#: ../../library/random.rst:512 +#: ../../library/random.rst:541 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -741,19 +785,14 @@ msgstr "" "`重新取樣排列測試 `_\\ 的範例,來確定觀察到的藥物與安" "慰劑之間差異的統計學意義或 `p 值 `_\\ " -":\n" -"\n" -"::" +": ::" -#: ../../library/random.rst:539 +#: ../../library/random.rst:568 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" -msgstr "" -"模擬多伺服器佇列 (queue) 的到達時間與服務交付:\n" -"\n" -"::" +msgstr "模擬多伺服器佇列 (queue) 的到達時間與服務交付: ::" -#: ../../library/random.rst:568 +#: ../../library/random.rst:597 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ 製作的教" "學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。" -#: ../../library/random.rst:574 +#: ../../library/random.rst:603 msgid "" -"`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ that shows effective use of many of the tools and " -"distributions provided by this module (gauss, uniform, sample, betavariate, " -"choice, triangular, and randrange)." +"`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ that shows effective use of many of the tools and distributions " +"provided by this module (gauss, uniform, sample, betavariate, choice, " +"triangular, and randrange)." msgstr "" -"`Economics Simulation `_\\ 是由 `Peter Norvig `_ 對市" -"場進行的模擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變" -"數、選擇,三角形、隨機數)的有效使用。" +"`Economics Simulation `_\\ 是由 `Peter Norvig `_ 對市場進行的模" +"擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變數、選擇,三" +"角形、隨機數)的有效使用。" -#: ../../library/random.rst:581 +#: ../../library/random.rst:610 msgid "" -"`A Concrete Introduction to Probability (using Python) `_ a tutorial by `Peter " -"Norvig `_ covering the basics of probability " -"theory, how to write simulations, and how to perform data analysis using " -"Python." +"`A Concrete Introduction to Probability (using Python) `_ a tutorial by `Peter Norvig " +"`_ covering the basics of probability theory, " +"how to write simulations, and how to perform data analysis using Python." msgstr "" -"`機率的具體介紹(使用Python) `_\\ 為 `Peter Norvig `_ 的教學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數" -"據分析。" +"`機率的具體介紹(使用Python) `_\\ 為 `Peter Norvig `_ 的教" +"學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數據分析。" -#: ../../library/random.rst:589 +#: ../../library/random.rst:618 msgid "Recipes" msgstr "使用方案" -#: ../../library/random.rst:591 +#: ../../library/random.rst:620 msgid "" "These recipes show how to efficiently make random selections from the " "combinatoric iterators in the :mod:`itertools` module:" msgstr "" +"這些使用方案展示了如何有效地從 :mod:`itertools` 模組的組合疊代器 " +"(combinatoric iterators) 中進行隨機選擇:" -#: ../../library/random.rst:623 +#: ../../library/random.rst:652 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -812,7 +851,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:629 +#: ../../library/random.rst:658 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -824,17 +863,15 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:651 +#: ../../library/random.rst:680 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" msgstr "" "Class 中的所有\\ :ref:`實數分佈 `\\ 都將使用新方" -"法:\n" -"\n" -"::" +"法: ::" -#: ../../library/random.rst:660 +#: ../../library/random.rst:689 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -847,7 +884,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:669 +#: ../../library/random.rst:698 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " @@ -857,27 +894,3 @@ msgstr "" "`產生偽隨機浮點值 `_ Allen B. Downey 的一篇論文描述了產生比通常由 :func:`.random` 產生的 " "float 更 fine-grained(細粒的)的方法。" - -#~ msgid "" -#~ "Return a randomly selected element from ``range(start, stop, step)``. " -#~ "This is equivalent to ``choice(range(start, stop, step))``, but doesn't " -#~ "actually build a range object." -#~ msgstr "" -#~ "從 ``range(start, stop, step)`` 中回傳一個隨機選擇的元素。這等效於 " -#~ "``choice(range(start, stop, step))``,但實際上並沒有構建範圍物件。" - -#~ msgid "" -#~ "The positional argument pattern matches that of :func:`range`. Keyword " -#~ "arguments should not be used because the function may use them in " -#~ "unexpected ways." -#~ msgstr "" -#~ "位置引數模式與 :func:`range` 的位置引數模式匹配。不應使用關鍵字引數,因為" -#~ "函式可能會以不預期的方式使用它們。" - -#~ msgid "" -#~ "The exception raised for non-integral values such as ``randrange(10.5)`` " -#~ "or ``randrange('10')`` will be changed from :exc:`ValueError` to :exc:" -#~ "`TypeError`." -#~ msgstr "" -#~ "對於非整數值,例如 ``randrange(10.5)`` 或 ``randrange('10')``,引發的例外" -#~ "將從 :exc:`ValueError` 改為 :exc:`TypeError`。" diff --git a/library/shelve.po b/library/shelve.po index b88a4036c5..deecb39af5 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 16:59+0000\n" +"POT-Creation-Date: 2023-12-23 16:09+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,7 +68,7 @@ msgid "" "mutated)." msgstr "" -#: ../../library/shelve.rst:44 ../../library/shelve.rst:145 +#: ../../library/shelve.rst:44 ../../library/shelve.rst:148 msgid "" ":const:`pickle.DEFAULT_PROTOCOL` is now used as the default pickle protocol." msgstr "" @@ -149,13 +149,19 @@ msgid "" "implementation used." msgstr "" -#: ../../library/shelve.rst:119 +#: ../../library/shelve.rst:116 +msgid "" +"On macOS :mod:`dbm.ndbm` can silently corrupt the database file on updates, " +"which can cause hard crashes when trying to read from the database." +msgstr "" + +#: ../../library/shelve.rst:122 msgid "" "A subclass of :class:`collections.abc.MutableMapping` which stores pickled " "values in the *dict* object." msgstr "" -#: ../../library/shelve.rst:122 +#: ../../library/shelve.rst:125 msgid "" "By default, pickles created with :const:`pickle.DEFAULT_PROTOCOL` are used " "to serialize values. The version of the pickle protocol can be specified " @@ -163,7 +169,7 @@ msgid "" "discussion of the pickle protocols." msgstr "" -#: ../../library/shelve.rst:127 +#: ../../library/shelve.rst:130 msgid "" "If the *writeback* parameter is ``True``, the object will hold a cache of " "all entries accessed and write them back to the *dict* at sync and close " @@ -171,29 +177,29 @@ msgid "" "much more memory and make sync and close take a long time." msgstr "" -#: ../../library/shelve.rst:132 +#: ../../library/shelve.rst:135 msgid "" "The *keyencoding* parameter is the encoding used to encode keys before they " "are used with the underlying dict." msgstr "" -#: ../../library/shelve.rst:135 +#: ../../library/shelve.rst:138 msgid "" "A :class:`Shelf` object can also be used as a context manager, in which case " "it will be automatically closed when the :keyword:`with` block ends." msgstr "" -#: ../../library/shelve.rst:138 +#: ../../library/shelve.rst:141 msgid "" "Added the *keyencoding* parameter; previously, keys were always encoded in " "UTF-8." msgstr "" -#: ../../library/shelve.rst:142 +#: ../../library/shelve.rst:145 msgid "Added context manager support." msgstr "新增情境管理器的支援。" -#: ../../library/shelve.rst:152 +#: ../../library/shelve.rst:155 msgid "" "A subclass of :class:`Shelf` which exposes :meth:`!first`, :meth:`!next`, :" "meth:`!previous`, :meth:`!last` and :meth:`!set_location` methods. These are " @@ -206,7 +212,7 @@ msgid "" "for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:166 +#: ../../library/shelve.rst:169 msgid "" "A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-" "like object. The underlying file will be opened using :func:`dbm.open`. By " @@ -216,29 +222,29 @@ msgid "" "same interpretation as for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:177 +#: ../../library/shelve.rst:180 msgid "Example" msgstr "範例" -#: ../../library/shelve.rst:179 +#: ../../library/shelve.rst:182 msgid "" "To summarize the interface (``key`` is a string, ``data`` is an arbitrary " "object)::" msgstr "" -#: ../../library/shelve.rst:216 +#: ../../library/shelve.rst:219 msgid "Module :mod:`dbm`" msgstr ":mod:`dbm` 模組" -#: ../../library/shelve.rst:216 +#: ../../library/shelve.rst:219 msgid "Generic interface to ``dbm``-style databases." msgstr "" -#: ../../library/shelve.rst:218 +#: ../../library/shelve.rst:221 msgid "Module :mod:`pickle`" msgstr ":mod:`pickle` 模組" -#: ../../library/shelve.rst:219 +#: ../../library/shelve.rst:222 msgid "Object serialization used by :mod:`shelve`." msgstr "" diff --git a/library/subprocess.po b/library/subprocess.po index abe2ae5d16..1dcabdc919 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-12-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -157,8 +157,8 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:119 ../../library/subprocess.rst:503 -#: ../../library/subprocess.rst:1185 ../../library/subprocess.rst:1225 -#: ../../library/subprocess.rst:1288 +#: ../../library/subprocess.rst:1186 ../../library/subprocess.rst:1226 +#: ../../library/subprocess.rst:1289 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -182,7 +182,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:138 ../../library/subprocess.rst:932 +#: ../../library/subprocess.rst:138 ../../library/subprocess.rst:933 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -799,7 +799,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:662 ../../library/subprocess.rst:1283 +#: ../../library/subprocess.rst:662 ../../library/subprocess.rst:1284 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -1015,18 +1015,19 @@ msgstr "" #: ../../library/subprocess.rst:794 msgid "" -"The function is implemented using a busy loop (non-blocking call and short " -"sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see :class:" -"`asyncio.create_subprocess_exec`." +"When the ``timeout`` parameter is not ``None``, then (on POSIX) the function " +"is implemented using a busy loop (non-blocking call and short sleeps). Use " +"the :mod:`asyncio` module for an asynchronous wait: see :class:`asyncio." +"create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:798 ../../library/subprocess.rst:839 -#: ../../library/subprocess.rst:1180 ../../library/subprocess.rst:1220 -#: ../../library/subprocess.rst:1274 +#: ../../library/subprocess.rst:799 ../../library/subprocess.rst:840 +#: ../../library/subprocess.rst:1181 ../../library/subprocess.rst:1221 +#: ../../library/subprocess.rst:1275 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" -#: ../../library/subprocess.rst:803 +#: ../../library/subprocess.rst:804 msgid "" "Interact with process: Send data to stdin. Read data from stdout and " "stderr, until end-of-file is reached. Wait for process to terminate and set " @@ -1036,13 +1037,13 @@ msgid "" "must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:810 +#: ../../library/subprocess.rst:811 msgid "" ":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data " "will be strings if streams were opened in text mode; otherwise, bytes." msgstr "" -#: ../../library/subprocess.rst:814 +#: ../../library/subprocess.rst:815 msgid "" "Note that if you want to send data to the process's stdin, you need to " "create the Popen object with ``stdin=PIPE``. Similarly, to get anything " @@ -1050,67 +1051,67 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:819 +#: ../../library/subprocess.rst:820 msgid "" "If the process does not terminate after *timeout* seconds, a :exc:" "`TimeoutExpired` exception will be raised. Catching this exception and " "retrying communication will not lose any output." msgstr "" -#: ../../library/subprocess.rst:823 +#: ../../library/subprocess.rst:824 msgid "" "The child process is not killed if the timeout expires, so in order to " "cleanup properly a well-behaved application should kill the child process " "and finish communication::" msgstr "" -#: ../../library/subprocess.rst:836 +#: ../../library/subprocess.rst:837 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:845 +#: ../../library/subprocess.rst:846 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:847 +#: ../../library/subprocess.rst:848 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:851 +#: ../../library/subprocess.rst:852 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/subprocess.rst:858 +#: ../../library/subprocess.rst:859 msgid "" "Stop the child. On POSIX OSs the method sends SIGTERM to the child. On " "Windows the Win32 API function :c:func:`TerminateProcess` is called to stop " "the child." msgstr "" -#: ../../library/subprocess.rst:865 +#: ../../library/subprocess.rst:866 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:869 +#: ../../library/subprocess.rst:870 msgid "" "The following attributes are also set by the class for you to access. " "Reassigning them to new values is unsupported:" msgstr "" -#: ../../library/subprocess.rst:874 +#: ../../library/subprocess.rst:875 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:881 +#: ../../library/subprocess.rst:882 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " @@ -1119,7 +1120,7 @@ msgid "" "*stdin* argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:890 +#: ../../library/subprocess.rst:891 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1129,7 +1130,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:900 +#: ../../library/subprocess.rst:901 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1139,7 +1140,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:909 +#: ../../library/subprocess.rst:910 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1188,38 +1189,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:950 +#: ../../library/subprocess.rst:951 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:955 +#: ../../library/subprocess.rst:956 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:963 +#: ../../library/subprocess.rst:964 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:970 +#: ../../library/subprocess.rst:971 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:977 +#: ../../library/subprocess.rst:978 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:983 +#: ../../library/subprocess.rst:984 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1228,34 +1229,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:990 +#: ../../library/subprocess.rst:991 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:995 +#: ../../library/subprocess.rst:996 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:999 +#: ../../library/subprocess.rst:1000 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:1017 +#: ../../library/subprocess.rst:1018 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:1002 +#: ../../library/subprocess.rst:1003 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:1005 +#: ../../library/subprocess.rst:1006 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1263,7 +1264,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:1012 +#: ../../library/subprocess.rst:1013 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1272,97 +1273,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:1022 +#: ../../library/subprocess.rst:1023 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:1024 +#: ../../library/subprocess.rst:1025 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:1028 +#: ../../library/subprocess.rst:1029 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:1033 +#: ../../library/subprocess.rst:1034 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1038 +#: ../../library/subprocess.rst:1039 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1043 +#: ../../library/subprocess.rst:1044 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1047 +#: ../../library/subprocess.rst:1048 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1053 +#: ../../library/subprocess.rst:1054 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1058 +#: ../../library/subprocess.rst:1059 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1063 +#: ../../library/subprocess.rst:1064 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1067 +#: ../../library/subprocess.rst:1068 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1071 +#: ../../library/subprocess.rst:1072 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1078 +#: ../../library/subprocess.rst:1079 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1085 +#: ../../library/subprocess.rst:1086 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1092 +#: ../../library/subprocess.rst:1093 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1099 +#: ../../library/subprocess.rst:1100 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1106 +#: ../../library/subprocess.rst:1107 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1372,20 +1373,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1117 +#: ../../library/subprocess.rst:1118 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1124 +#: ../../library/subprocess.rst:1125 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1132 +#: ../../library/subprocess.rst:1133 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1393,39 +1394,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1142 +#: ../../library/subprocess.rst:1143 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1150 +#: ../../library/subprocess.rst:1151 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1152 +#: ../../library/subprocess.rst:1153 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1159 +#: ../../library/subprocess.rst:1160 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1162 ../../library/subprocess.rst:1202 +#: ../../library/subprocess.rst:1163 ../../library/subprocess.rst:1203 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1166 ../../library/subprocess.rst:1206 +#: ../../library/subprocess.rst:1167 ../../library/subprocess.rst:1207 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1168 ../../library/subprocess.rst:1208 +#: ../../library/subprocess.rst:1169 ../../library/subprocess.rst:1209 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1433,14 +1434,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1175 ../../library/subprocess.rst:1215 +#: ../../library/subprocess.rst:1176 ../../library/subprocess.rst:1216 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1195 +#: ../../library/subprocess.rst:1196 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1449,11 +1450,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1237 +#: ../../library/subprocess.rst:1238 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1239 +#: ../../library/subprocess.rst:1240 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1461,11 +1462,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1244 +#: ../../library/subprocess.rst:1245 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1248 +#: ../../library/subprocess.rst:1249 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1475,52 +1476,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1255 +#: ../../library/subprocess.rst:1256 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1259 +#: ../../library/subprocess.rst:1260 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1263 +#: ../../library/subprocess.rst:1264 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1277 +#: ../../library/subprocess.rst:1278 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1280 +#: ../../library/subprocess.rst:1281 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1298 +#: ../../library/subprocess.rst:1299 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1300 +#: ../../library/subprocess.rst:1301 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1304 +#: ../../library/subprocess.rst:1305 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1308 +#: ../../library/subprocess.rst:1309 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1528,143 +1529,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1313 +#: ../../library/subprocess.rst:1314 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1318 +#: ../../library/subprocess.rst:1319 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1324 ../../library/subprocess.rst:1335 -#: ../../library/subprocess.rst:1352 +#: ../../library/subprocess.rst:1325 ../../library/subprocess.rst:1336 +#: ../../library/subprocess.rst:1353 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1329 +#: ../../library/subprocess.rst:1330 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1342 +#: ../../library/subprocess.rst:1343 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1345 +#: ../../library/subprocess.rst:1346 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1358 +#: ../../library/subprocess.rst:1359 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1366 +#: ../../library/subprocess.rst:1367 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1368 +#: ../../library/subprocess.rst:1369 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1369 +#: ../../library/subprocess.rst:1370 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1372 +#: ../../library/subprocess.rst:1373 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1376 +#: ../../library/subprocess.rst:1377 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1389 +#: ../../library/subprocess.rst:1390 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1391 +#: ../../library/subprocess.rst:1392 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1397 +#: ../../library/subprocess.rst:1398 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1403 +#: ../../library/subprocess.rst:1404 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1409 +#: ../../library/subprocess.rst:1410 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1418 +#: ../../library/subprocess.rst:1419 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1448 +#: ../../library/subprocess.rst:1449 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1464 +#: ../../library/subprocess.rst:1465 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1468 +#: ../../library/subprocess.rst:1469 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: ../../library/subprocess.rst:1487 +#: ../../library/subprocess.rst:1488 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1490 +#: ../../library/subprocess.rst:1491 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1492 +#: ../../library/subprocess.rst:1493 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1494 +#: ../../library/subprocess.rst:1495 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1496 +#: ../../library/subprocess.rst:1497 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: ../../library/subprocess.rst:1502 +#: ../../library/subprocess.rst:1503 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1504 +#: ../../library/subprocess.rst:1505 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1672,11 +1673,11 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1511 +#: ../../library/subprocess.rst:1512 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1513 +#: ../../library/subprocess.rst:1514 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " @@ -1684,85 +1685,85 @@ msgid "" "details." msgstr "" -#: ../../library/subprocess.rst:1518 +#: ../../library/subprocess.rst:1519 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1531 ../../library/subprocess.rst:1553 +#: ../../library/subprocess.rst:1532 ../../library/subprocess.rst:1554 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix 和 Windows。" -#: ../../library/subprocess.rst:1533 +#: ../../library/subprocess.rst:1534 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1536 +#: ../../library/subprocess.rst:1537 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1540 ../../library/subprocess.rst:1558 +#: ../../library/subprocess.rst:1541 ../../library/subprocess.rst:1559 msgid "Added *encoding* and *errors* arguments." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/subprocess.rst:1545 +#: ../../library/subprocess.rst:1546 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1547 +#: ../../library/subprocess.rst:1548 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1555 +#: ../../library/subprocess.rst:1556 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1563 +#: ../../library/subprocess.rst:1564 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1568 +#: ../../library/subprocess.rst:1569 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1570 +#: ../../library/subprocess.rst:1571 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1574 +#: ../../library/subprocess.rst:1575 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1577 +#: ../../library/subprocess.rst:1578 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1582 +#: ../../library/subprocess.rst:1583 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1585 +#: ../../library/subprocess.rst:1586 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1588 +#: ../../library/subprocess.rst:1589 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1770,33 +1771,33 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1597 +#: ../../library/subprocess.rst:1598 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1598 +#: ../../library/subprocess.rst:1599 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: ../../library/subprocess.rst:1605 +#: ../../library/subprocess.rst:1606 msgid "Disabling use of ``vfork()`` or ``posix_spawn()``" msgstr "" -#: ../../library/subprocess.rst:1607 +#: ../../library/subprocess.rst:1608 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" -#: ../../library/subprocess.rst:1611 +#: ../../library/subprocess.rst:1612 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " "prevent ``vfork()`` from being used by Python, you can set the :const:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" -#: ../../library/subprocess.rst:1619 +#: ../../library/subprocess.rst:1620 msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" @@ -1804,7 +1805,7 @@ msgid "" "that." msgstr "" -#: ../../library/subprocess.rst:1628 +#: ../../library/subprocess.rst:1629 msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " @@ -1812,18 +1813,18 @@ msgid "" "the corresponding function will be used, only that it may be." msgstr "" -#: ../../library/subprocess.rst:1633 +#: ../../library/subprocess.rst:1634 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " "your code." msgstr "" -#: ../../library/subprocess.rst:1637 +#: ../../library/subprocess.rst:1638 msgid "``_USE_POSIX_SPAWN``" msgstr "``_USE_POSIX_SPAWN``" -#: ../../library/subprocess.rst:1638 +#: ../../library/subprocess.rst:1639 msgid "``_USE_VFORK``" msgstr "``_USE_VFORK``" diff --git a/library/tarfile.po b/library/tarfile.po index 42aab7ea4c..e0119be62d 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-18 09:05+0000\n" +"POT-Creation-Date: 2023-12-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -255,311 +255,311 @@ msgid "" "[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` " "object that processes its data as a stream of blocks. No random seeking " "will be done on the file. If given, *fileobj* may be any object that has a :" -"meth:`~io.TextIOBase.read` or :meth:`~io.TextIOBase.write` method (depending " -"on the *mode*). *bufsize* specifies the blocksize and defaults to ``20 * " -"512`` bytes. Use this variant in combination with e.g. ``sys.stdin``, a " -"socket :term:`file object` or a tape device. However, such a :class:" -"`TarFile` object is limited in that it does not allow random access, see :" -"ref:`tar-examples`. The currently possible modes:" +"meth:`~io.RawIOBase.read` or :meth:`~io.RawIOBase.write` method (depending " +"on the *mode*) that works with bytes. *bufsize* specifies the blocksize and " +"defaults to ``20 * 512`` bytes. Use this variant in combination with e.g. " +"``sys.stdin.buffer``, a socket :term:`file object` or a tape device. " +"However, such a :class:`TarFile` object is limited in that it does not allow " +"random access, see :ref:`tar-examples`. The currently possible modes:" msgstr "" -#: ../../library/tarfile.rst:127 +#: ../../library/tarfile.rst:129 msgid "Mode" msgstr "" -#: ../../library/tarfile.rst:127 +#: ../../library/tarfile.rst:129 msgid "Action" msgstr "" -#: ../../library/tarfile.rst:129 +#: ../../library/tarfile.rst:131 msgid "``'r|*'``" msgstr "``'r|*'``" -#: ../../library/tarfile.rst:129 +#: ../../library/tarfile.rst:131 msgid "Open a *stream* of tar blocks for reading with transparent compression." msgstr "" -#: ../../library/tarfile.rst:132 +#: ../../library/tarfile.rst:134 msgid "``'r|'``" msgstr "``'r|'``" -#: ../../library/tarfile.rst:132 +#: ../../library/tarfile.rst:134 msgid "Open a *stream* of uncompressed tar blocks for reading." msgstr "" -#: ../../library/tarfile.rst:135 +#: ../../library/tarfile.rst:137 msgid "``'r|gz'``" msgstr "``'r|gz'``" -#: ../../library/tarfile.rst:135 +#: ../../library/tarfile.rst:137 msgid "Open a gzip compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:138 +#: ../../library/tarfile.rst:140 msgid "``'r|bz2'``" msgstr "``'r|bz2'``" -#: ../../library/tarfile.rst:138 +#: ../../library/tarfile.rst:140 msgid "Open a bzip2 compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:141 +#: ../../library/tarfile.rst:143 msgid "``'r|xz'``" msgstr "``'r|xz'``" -#: ../../library/tarfile.rst:141 +#: ../../library/tarfile.rst:143 msgid "Open an lzma compressed *stream* for reading." msgstr "" -#: ../../library/tarfile.rst:144 +#: ../../library/tarfile.rst:146 msgid "``'w|'``" msgstr "``'w|'``" -#: ../../library/tarfile.rst:144 +#: ../../library/tarfile.rst:146 msgid "Open an uncompressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:146 +#: ../../library/tarfile.rst:148 msgid "``'w|gz'``" msgstr "``'w|gz'``" -#: ../../library/tarfile.rst:146 +#: ../../library/tarfile.rst:148 msgid "Open a gzip compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:149 +#: ../../library/tarfile.rst:151 msgid "``'w|bz2'``" msgstr "``'w|bz2'``" -#: ../../library/tarfile.rst:149 +#: ../../library/tarfile.rst:151 msgid "Open a bzip2 compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:152 +#: ../../library/tarfile.rst:154 msgid "``'w|xz'``" msgstr "``'w|xz'``" -#: ../../library/tarfile.rst:152 +#: ../../library/tarfile.rst:154 msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: ../../library/tarfile.rst:156 ../../library/tarfile.rst:420 +#: ../../library/tarfile.rst:158 ../../library/tarfile.rst:422 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/tarfile.rst:159 ../../library/tarfile.rst:423 -#: ../../library/tarfile.rst:658 +#: ../../library/tarfile.rst:161 ../../library/tarfile.rst:425 +#: ../../library/tarfile.rst:660 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:162 +#: ../../library/tarfile.rst:164 msgid "The *compresslevel* keyword argument also works for streams." msgstr "" -#: ../../library/tarfile.rst:169 +#: ../../library/tarfile.rst:171 msgid "" "Class for reading and writing tar archives. Do not use this class directly: " "use :func:`tarfile.open` instead. See :ref:`tarfile-objects`." msgstr "" -#: ../../library/tarfile.rst:175 +#: ../../library/tarfile.rst:177 msgid "" "Return :const:`True` if *name* is a tar archive file, that the :mod:" "`tarfile` module can read. *name* may be a :class:`str`, file, or file-like " "object." msgstr "" -#: ../../library/tarfile.rst:178 +#: ../../library/tarfile.rst:180 msgid "Support for file and file-like objects." msgstr "" -#: ../../library/tarfile.rst:182 +#: ../../library/tarfile.rst:184 msgid "The :mod:`tarfile` module defines the following exceptions:" msgstr "" -#: ../../library/tarfile.rst:187 +#: ../../library/tarfile.rst:189 msgid "Base class for all :mod:`tarfile` exceptions." msgstr "" -#: ../../library/tarfile.rst:192 +#: ../../library/tarfile.rst:194 msgid "" "Is raised when a tar archive is opened, that either cannot be handled by " "the :mod:`tarfile` module or is somehow invalid." msgstr "" -#: ../../library/tarfile.rst:198 +#: ../../library/tarfile.rst:200 msgid "" "Is raised when a compression method is not supported or when the data cannot " "be decoded properly." msgstr "" -#: ../../library/tarfile.rst:204 +#: ../../library/tarfile.rst:206 msgid "" "Is raised for the limitations that are typical for stream-like :class:" "`TarFile` objects." msgstr "" -#: ../../library/tarfile.rst:210 +#: ../../library/tarfile.rst:212 msgid "" "Is raised for *non-fatal* errors when using :meth:`TarFile.extract`, but " "only if :attr:`TarFile.errorlevel`\\ ``== 2``." msgstr "" -#: ../../library/tarfile.rst:216 +#: ../../library/tarfile.rst:218 msgid "Is raised by :meth:`TarInfo.frombuf` if the buffer it gets is invalid." msgstr "" -#: ../../library/tarfile.rst:221 +#: ../../library/tarfile.rst:223 msgid "" "Base class for members :ref:`refused ` by filters." msgstr "" -#: ../../library/tarfile.rst:226 +#: ../../library/tarfile.rst:228 msgid "" "Information about the member that the filter refused to extract, as :ref:" "`TarInfo `." msgstr "" -#: ../../library/tarfile.rst:231 +#: ../../library/tarfile.rst:233 msgid "Raised to refuse extracting a member with an absolute path." msgstr "" -#: ../../library/tarfile.rst:235 +#: ../../library/tarfile.rst:237 msgid "Raised to refuse extracting a member outside the destination directory." msgstr "" -#: ../../library/tarfile.rst:239 +#: ../../library/tarfile.rst:241 msgid "Raised to refuse extracting a special file (e.g. a device or pipe)." msgstr "" -#: ../../library/tarfile.rst:243 +#: ../../library/tarfile.rst:245 msgid "Raised to refuse extracting a symbolic link with an absolute path." msgstr "" -#: ../../library/tarfile.rst:247 +#: ../../library/tarfile.rst:249 msgid "" "Raised to refuse extracting a symbolic link pointing outside the destination " "directory." msgstr "" -#: ../../library/tarfile.rst:251 +#: ../../library/tarfile.rst:253 msgid "The following constants are available at the module level:" msgstr "" -#: ../../library/tarfile.rst:255 +#: ../../library/tarfile.rst:257 msgid "" "The default character encoding: ``'utf-8'`` on Windows, the value returned " "by :func:`sys.getfilesystemencoding` otherwise." msgstr "" -#: ../../library/tarfile.rst:261 +#: ../../library/tarfile.rst:263 msgid "A regular file :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:265 +#: ../../library/tarfile.rst:267 msgid "A link (inside tarfile) :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:269 +#: ../../library/tarfile.rst:271 msgid "A symbolic link :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:273 +#: ../../library/tarfile.rst:275 msgid "A character special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:277 +#: ../../library/tarfile.rst:279 msgid "A block special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:281 +#: ../../library/tarfile.rst:283 msgid "A directory :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:285 +#: ../../library/tarfile.rst:287 msgid "A FIFO special device :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:289 +#: ../../library/tarfile.rst:291 msgid "A contiguous file :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:293 +#: ../../library/tarfile.rst:295 msgid "A GNU tar longname :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:297 +#: ../../library/tarfile.rst:299 msgid "A GNU tar longlink :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:301 +#: ../../library/tarfile.rst:303 msgid "A GNU tar sparse file :attr:`~TarInfo.type`." msgstr "" -#: ../../library/tarfile.rst:304 +#: ../../library/tarfile.rst:306 msgid "" "Each of the following constants defines a tar archive format that the :mod:" "`tarfile` module is able to create. See section :ref:`tar-formats` for " "details." msgstr "" -#: ../../library/tarfile.rst:311 +#: ../../library/tarfile.rst:313 msgid "POSIX.1-1988 (ustar) format." msgstr "" -#: ../../library/tarfile.rst:316 +#: ../../library/tarfile.rst:318 msgid "GNU tar format." msgstr "" -#: ../../library/tarfile.rst:321 +#: ../../library/tarfile.rst:323 msgid "POSIX.1-2001 (pax) format." msgstr "" -#: ../../library/tarfile.rst:326 +#: ../../library/tarfile.rst:328 msgid "" "The default format for creating archives. This is currently :const:" "`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:328 +#: ../../library/tarfile.rst:330 msgid "" "The default format for new archives was changed to :const:`PAX_FORMAT` from :" "const:`GNU_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:336 +#: ../../library/tarfile.rst:338 msgid "Module :mod:`zipfile`" msgstr ":mod:`zipfile` 模組" -#: ../../library/tarfile.rst:336 +#: ../../library/tarfile.rst:338 msgid "Documentation of the :mod:`zipfile` standard module." msgstr "" -#: ../../library/tarfile.rst:340 +#: ../../library/tarfile.rst:342 msgid ":ref:`archiving-operations`" msgstr ":ref:`archiving-operations`" -#: ../../library/tarfile.rst:339 +#: ../../library/tarfile.rst:341 msgid "" "Documentation of the higher-level archiving facilities provided by the " "standard :mod:`shutil` module." msgstr "" -#: ../../library/tarfile.rst:342 +#: ../../library/tarfile.rst:344 msgid "" "`GNU tar manual, Basic Tar Format `_" msgstr "" -#: ../../library/tarfile.rst:343 +#: ../../library/tarfile.rst:345 msgid "Documentation for tar archive files, including GNU tar extensions." msgstr "" -#: ../../library/tarfile.rst:349 +#: ../../library/tarfile.rst:351 msgid "TarFile Objects" msgstr "TarFile 物件" -#: ../../library/tarfile.rst:351 +#: ../../library/tarfile.rst:353 msgid "" "The :class:`TarFile` object provides an interface to a tar archive. A tar " "archive is a sequence of blocks. An archive member (a stored file) is made " @@ -568,7 +568,7 @@ msgid "" "class:`TarInfo` object, see :ref:`tarinfo-objects` for details." msgstr "" -#: ../../library/tarfile.rst:357 +#: ../../library/tarfile.rst:359 msgid "" "A :class:`TarFile` object can be used as a context manager in a :keyword:" "`with` statement. It will automatically be closed when the block is " @@ -577,24 +577,24 @@ msgid "" "be closed. See the :ref:`tar-examples` section for a use case." msgstr "" -#: ../../library/tarfile.rst:363 +#: ../../library/tarfile.rst:365 msgid "Added support for the context management protocol." msgstr "" -#: ../../library/tarfile.rst:368 +#: ../../library/tarfile.rst:370 msgid "" "All following arguments are optional and can be accessed as instance " "attributes as well." msgstr "" -#: ../../library/tarfile.rst:371 +#: ../../library/tarfile.rst:373 msgid "" "*name* is the pathname of the archive. *name* may be a :term:`path-like " "object`. It can be omitted if *fileobj* is given. In this case, the file " "object's :attr:`!name` attribute is used if it exists." msgstr "" -#: ../../library/tarfile.rst:375 +#: ../../library/tarfile.rst:377 msgid "" "*mode* is either ``'r'`` to read from an existing archive, ``'a'`` to append " "data to an existing file, ``'w'`` to create a new file overwriting an " @@ -602,18 +602,18 @@ msgid "" "exist." msgstr "" -#: ../../library/tarfile.rst:379 +#: ../../library/tarfile.rst:381 msgid "" "If *fileobj* is given, it is used for reading or writing data. If it can be " "determined, *mode* is overridden by *fileobj*'s mode. *fileobj* will be used " "from position 0." msgstr "" -#: ../../library/tarfile.rst:385 +#: ../../library/tarfile.rst:387 msgid "*fileobj* is not closed, when :class:`TarFile` is closed." msgstr "" -#: ../../library/tarfile.rst:387 +#: ../../library/tarfile.rst:389 msgid "" "*format* controls the archive format for writing. It must be one of the " "constants :const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` " @@ -621,20 +621,20 @@ msgid "" "detected, even if different formats are present in a single archive." msgstr "" -#: ../../library/tarfile.rst:392 +#: ../../library/tarfile.rst:394 msgid "" "The *tarinfo* argument can be used to replace the default :class:`TarInfo` " "class with a different one." msgstr "" -#: ../../library/tarfile.rst:395 +#: ../../library/tarfile.rst:397 msgid "" "If *dereference* is :const:`False`, add symbolic and hard links to the " "archive. If it is :const:`True`, add the content of the target files to the " "archive. This has no effect on systems that do not support symbolic links." msgstr "" -#: ../../library/tarfile.rst:399 +#: ../../library/tarfile.rst:401 msgid "" "If *ignore_zeros* is :const:`False`, treat an empty block as the end of the " "archive. If it is :const:`True`, skip empty (and invalid) blocks and try to " @@ -642,19 +642,19 @@ msgid "" "concatenated or damaged archives." msgstr "" -#: ../../library/tarfile.rst:403 +#: ../../library/tarfile.rst:405 msgid "" "*debug* can be set from ``0`` (no debug messages) up to ``3`` (all debug " "messages). The messages are written to ``sys.stderr``." msgstr "" -#: ../../library/tarfile.rst:406 +#: ../../library/tarfile.rst:408 msgid "" "*errorlevel* controls how extraction errors are handled, see :attr:`the " "corresponding attribute `." msgstr "" -#: ../../library/tarfile.rst:409 +#: ../../library/tarfile.rst:411 msgid "" "The *encoding* and *errors* arguments define the character encoding to be " "used for reading or writing the archive and how conversion errors are going " @@ -662,47 +662,47 @@ msgid "" "ref:`tar-unicode` for in-depth information." msgstr "" -#: ../../library/tarfile.rst:414 +#: ../../library/tarfile.rst:416 msgid "" "The *pax_headers* argument is an optional dictionary of strings which will " "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: ../../library/tarfile.rst:417 ../../library/tarfile.rst:726 +#: ../../library/tarfile.rst:419 ../../library/tarfile.rst:728 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" -#: ../../library/tarfile.rst:429 +#: ../../library/tarfile.rst:431 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: ../../library/tarfile.rst:435 +#: ../../library/tarfile.rst:437 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:440 +#: ../../library/tarfile.rst:442 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: ../../library/tarfile.rst:446 +#: ../../library/tarfile.rst:448 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: ../../library/tarfile.rst:452 +#: ../../library/tarfile.rst:454 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:458 +#: ../../library/tarfile.rst:460 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -710,18 +710,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: ../../library/tarfile.rst:463 +#: ../../library/tarfile.rst:465 msgid "Added the *members* parameter." msgstr "新增 *members* 參數。" -#: ../../library/tarfile.rst:469 +#: ../../library/tarfile.rst:471 msgid "" "Return the next member of the archive as a :class:`TarInfo` object, when :" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -#: ../../library/tarfile.rst:476 +#: ../../library/tarfile.rst:478 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -733,14 +733,14 @@ msgid "" "fail." msgstr "" -#: ../../library/tarfile.rst:484 +#: ../../library/tarfile.rst:486 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: ../../library/tarfile.rst:488 +#: ../../library/tarfile.rst:490 msgid "" "The *filter* argument specifies how ``members`` are modified or rejected " "before extraction. See :ref:`tarfile-extraction-filter` for details. It is " @@ -748,7 +748,7 @@ msgid "" "need to support." msgstr "" -#: ../../library/tarfile.rst:496 +#: ../../library/tarfile.rst:498 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -756,26 +756,26 @@ msgid "" "\"``." msgstr "" -#: ../../library/tarfile.rst:501 ../../library/tarfile.rst:534 +#: ../../library/tarfile.rst:503 ../../library/tarfile.rst:536 msgid "" "Set ``filter='data'`` to prevent the most dangerous security issues, and " "read the :ref:`tarfile-extraction-filter` section for details." msgstr "" -#: ../../library/tarfile.rst:504 ../../library/tarfile.rst:540 +#: ../../library/tarfile.rst:506 ../../library/tarfile.rst:542 msgid "Added the *numeric_owner* parameter." msgstr "新增 *numeric_owner* 參數。" -#: ../../library/tarfile.rst:507 ../../library/tarfile.rst:543 +#: ../../library/tarfile.rst:509 ../../library/tarfile.rst:545 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/tarfile.rst:510 ../../library/tarfile.rst:546 -#: ../../library/tarfile.rst:624 +#: ../../library/tarfile.rst:512 ../../library/tarfile.rst:548 +#: ../../library/tarfile.rst:626 msgid "Added the *filter* parameter." msgstr "新增 *filter* 參數。" -#: ../../library/tarfile.rst:516 +#: ../../library/tarfile.rst:518 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -784,27 +784,27 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: ../../library/tarfile.rst:522 +#: ../../library/tarfile.rst:524 msgid "" "The *numeric_owner* and *filter* arguments are the same as for :meth:" "`extractall`." msgstr "" -#: ../../library/tarfile.rst:527 +#: ../../library/tarfile.rst:529 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: ../../library/tarfile.rst:532 +#: ../../library/tarfile.rst:534 msgid "See the warning for :meth:`extractall`." msgstr "參閱 :meth:`extractall` 的警告。" -#: ../../library/tarfile.rst:537 +#: ../../library/tarfile.rst:539 msgid "Added the *set_attrs* parameter." msgstr "增加 *set_attrs* 參數。" -#: ../../library/tarfile.rst:552 +#: ../../library/tarfile.rst:554 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " @@ -813,11 +813,11 @@ msgid "" "the archive, :exc:`KeyError` is raised." msgstr "" -#: ../../library/tarfile.rst:558 +#: ../../library/tarfile.rst:560 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: ../../library/tarfile.rst:564 +#: ../../library/tarfile.rst:566 msgid "" "If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile." "extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error " @@ -827,39 +827,39 @@ msgid "" "exc:`TarError` exceptions as well." msgstr "" -#: ../../library/tarfile.rst:572 +#: ../../library/tarfile.rst:574 msgid "" "Some exceptions, e.g. ones caused by wrong argument types or data " "corruption, are always raised." msgstr "" -#: ../../library/tarfile.rst:575 +#: ../../library/tarfile.rst:577 msgid "" "Custom :ref:`extraction filters ` should raise :" "exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " "ones." msgstr "" -#: ../../library/tarfile.rst:579 +#: ../../library/tarfile.rst:581 msgid "" "Note that when an exception is raised, the archive may be partially " "extracted. It is the user’s responsibility to clean up." msgstr "" -#: ../../library/tarfile.rst:586 +#: ../../library/tarfile.rst:588 msgid "" "The :ref:`extraction filter ` used as a default " "for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`." msgstr "" -#: ../../library/tarfile.rst:590 +#: ../../library/tarfile.rst:592 msgid "" "The attribute may be ``None`` or a callable. String names are not allowed " "for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." msgstr "" -#: ../../library/tarfile.rst:594 +#: ../../library/tarfile.rst:596 msgid "" "If ``extraction_filter`` is ``None`` (the default), calling an extraction " "method without a *filter* argument will raise a ``DeprecationWarning``, and " @@ -867,13 +867,13 @@ msgid "" "dangerous behavior matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:600 +#: ../../library/tarfile.rst:602 msgid "" "In Python 3.14+, leaving ``extraction_filter=None`` will cause extraction " "methods to use the :func:`data ` filter by default." msgstr "" -#: ../../library/tarfile.rst:603 +#: ../../library/tarfile.rst:605 msgid "" "The attribute may be set on instances or overridden in subclasses. It also " "is possible to set it on the ``TarFile`` class itself to set a global " @@ -884,7 +884,7 @@ msgid "" "argument." msgstr "" -#: ../../library/tarfile.rst:613 +#: ../../library/tarfile.rst:615 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " @@ -897,11 +897,11 @@ msgid "" "ref:`tar-examples` for an example." msgstr "" -#: ../../library/tarfile.rst:627 +#: ../../library/tarfile.rst:629 msgid "Recursion adds entries in sorted order." msgstr "" -#: ../../library/tarfile.rst:633 +#: ../../library/tarfile.rst:635 msgid "" "Add the :class:`TarInfo` object *tarinfo* to the archive. If *fileobj* is " "given, it should be a :term:`binary file`, and ``tarinfo.size`` bytes are " @@ -909,7 +909,7 @@ msgid "" "objects directly, or by using :meth:`gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:641 +#: ../../library/tarfile.rst:643 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -920,7 +920,7 @@ msgid "" "The name should be a text string." msgstr "" -#: ../../library/tarfile.rst:650 +#: ../../library/tarfile.rst:652 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " @@ -930,21 +930,21 @@ msgid "" "case *arcname* could be a dummy string." msgstr "" -#: ../../library/tarfile.rst:664 +#: ../../library/tarfile.rst:666 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: ../../library/tarfile.rst:670 +#: ../../library/tarfile.rst:672 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: ../../library/tarfile.rst:677 +#: ../../library/tarfile.rst:679 msgid "TarInfo Objects" msgstr "TarInfo 物件" -#: ../../library/tarfile.rst:679 +#: ../../library/tarfile.rst:681 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -952,14 +952,14 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: ../../library/tarfile.rst:684 +#: ../../library/tarfile.rst:686 msgid "" ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" "`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." "gettarinfo`." msgstr "" -#: ../../library/tarfile.rst:688 +#: ../../library/tarfile.rst:690 msgid "" "Modifying the objects returned by :meth:`~TarFile.getmember` or :meth:" "`~TarFile.getmembers` will affect all subsequent operations on the archive. " @@ -968,82 +968,82 @@ msgid "" "step." msgstr "" -#: ../../library/tarfile.rst:694 +#: ../../library/tarfile.rst:696 msgid "" "Several attributes can be set to ``None`` to indicate that a piece of " "metadata is unused or unknown. Different :class:`TarInfo` methods handle " "``None`` differently:" msgstr "" -#: ../../library/tarfile.rst:698 +#: ../../library/tarfile.rst:700 msgid "" "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " "ignore the corresponding metadata, leaving it set to a default." msgstr "" -#: ../../library/tarfile.rst:700 +#: ../../library/tarfile.rst:702 msgid ":meth:`~TarFile.addfile` will fail." msgstr "" -#: ../../library/tarfile.rst:701 +#: ../../library/tarfile.rst:703 msgid ":meth:`~TarFile.list` will print a placeholder string." msgstr "" -#: ../../library/tarfile.rst:705 +#: ../../library/tarfile.rst:707 msgid "Create a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:710 +#: ../../library/tarfile.rst:712 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: ../../library/tarfile.rst:712 +#: ../../library/tarfile.rst:714 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: ../../library/tarfile.rst:717 +#: ../../library/tarfile.rst:719 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: ../../library/tarfile.rst:723 +#: ../../library/tarfile.rst:725 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:730 +#: ../../library/tarfile.rst:732 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "" -#: ../../library/tarfile.rst:736 +#: ../../library/tarfile.rst:738 msgid "Name of the archive member." msgstr "" -#: ../../library/tarfile.rst:742 +#: ../../library/tarfile.rst:744 msgid "Size in bytes." msgstr "" -#: ../../library/tarfile.rst:748 +#: ../../library/tarfile.rst:750 msgid "" "Time of last modification in seconds since the :ref:`epoch `, as in :" "attr:`os.stat_result.st_mtime`." msgstr "" -#: ../../library/tarfile.rst:753 ../../library/tarfile.rst:764 -#: ../../library/tarfile.rst:796 ../../library/tarfile.rst:807 -#: ../../library/tarfile.rst:818 ../../library/tarfile.rst:829 +#: ../../library/tarfile.rst:755 ../../library/tarfile.rst:766 +#: ../../library/tarfile.rst:798 ../../library/tarfile.rst:809 +#: ../../library/tarfile.rst:820 ../../library/tarfile.rst:831 msgid "" "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`, causing extraction to skip applying this attribute." msgstr "" -#: ../../library/tarfile.rst:760 +#: ../../library/tarfile.rst:762 msgid "Permission bits, as for :func:`os.chmod`." msgstr "" -#: ../../library/tarfile.rst:770 +#: ../../library/tarfile.rst:772 msgid "" "File type. *type* is usually one of these constants: :const:`REGTYPE`, :" "const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" @@ -1052,100 +1052,100 @@ msgid "" "more conveniently, use the ``is*()`` methods below." msgstr "" -#: ../../library/tarfile.rst:780 +#: ../../library/tarfile.rst:782 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:783 +#: ../../library/tarfile.rst:785 msgid "" "For symbolic links (``SYMTYPE``), the *linkname* is relative to the " "directory that contains the link. For hard links (``LNKTYPE``), the " "*linkname* is relative to the root of the archive." msgstr "" -#: ../../library/tarfile.rst:792 +#: ../../library/tarfile.rst:794 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:803 +#: ../../library/tarfile.rst:805 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:814 +#: ../../library/tarfile.rst:816 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:825 +#: ../../library/tarfile.rst:827 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:836 +#: ../../library/tarfile.rst:838 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:844 +#: ../../library/tarfile.rst:846 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:850 +#: ../../library/tarfile.rst:852 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:854 +#: ../../library/tarfile.rst:856 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:859 +#: ../../library/tarfile.rst:861 msgid "Return :const:`True` if the :class:`TarInfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:864 +#: ../../library/tarfile.rst:866 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:869 +#: ../../library/tarfile.rst:871 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:874 +#: ../../library/tarfile.rst:876 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:879 +#: ../../library/tarfile.rst:881 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:884 +#: ../../library/tarfile.rst:886 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:889 +#: ../../library/tarfile.rst:891 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:894 +#: ../../library/tarfile.rst:896 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:899 +#: ../../library/tarfile.rst:901 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:905 +#: ../../library/tarfile.rst:907 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:909 +#: ../../library/tarfile.rst:911 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1155,66 +1155,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:917 +#: ../../library/tarfile.rst:919 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:923 +#: ../../library/tarfile.rst:925 msgid ":pep:`706`" msgstr "" -#: ../../library/tarfile.rst:924 +#: ../../library/tarfile.rst:926 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:926 +#: ../../library/tarfile.rst:928 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:929 +#: ../../library/tarfile.rst:931 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:934 +#: ../../library/tarfile.rst:936 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:938 +#: ../../library/tarfile.rst:940 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:942 +#: ../../library/tarfile.rst:944 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:944 +#: ../../library/tarfile.rst:946 msgid "" "If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " "fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " "matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:948 +#: ../../library/tarfile.rst:950 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:951 +#: ../../library/tarfile.rst:953 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1222,23 +1222,23 @@ msgid "" "members)::" msgstr "" -#: ../../library/tarfile.rst:958 +#: ../../library/tarfile.rst:960 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:962 +#: ../../library/tarfile.rst:964 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:964 +#: ../../library/tarfile.rst:966 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:965 +#: ../../library/tarfile.rst:967 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1246,118 +1246,118 @@ msgid "" "attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:971 +#: ../../library/tarfile.rst:973 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:973 +#: ../../library/tarfile.rst:975 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:978 +#: ../../library/tarfile.rst:980 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:980 +#: ../../library/tarfile.rst:982 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:984 +#: ../../library/tarfile.rst:986 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:988 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:987 +#: ../../library/tarfile.rst:989 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:991 +#: ../../library/tarfile.rst:993 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:994 +#: ../../library/tarfile.rst:996 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:997 ../../library/tarfile.rst:1030 +#: ../../library/tarfile.rst:999 ../../library/tarfile.rst:1032 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:1001 +#: ../../library/tarfile.rst:1003 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:1004 +#: ../../library/tarfile.rst:1006 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:1007 +#: ../../library/tarfile.rst:1009 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:1010 +#: ../../library/tarfile.rst:1012 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:1013 +#: ../../library/tarfile.rst:1015 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:1017 +#: ../../library/tarfile.rst:1019 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:1019 +#: ../../library/tarfile.rst:1021 msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:" "`~stat.S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:1021 +#: ../../library/tarfile.rst:1023 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP` | :" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:1025 +#: ../../library/tarfile.rst:1027 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:1027 +#: ../../library/tarfile.rst:1029 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:1036 +#: ../../library/tarfile.rst:1038 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:1038 +#: ../../library/tarfile.rst:1040 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1366,11 +1366,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:1046 +#: ../../library/tarfile.rst:1048 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:1048 +#: ../../library/tarfile.rst:1050 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1378,69 +1378,69 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1053 +#: ../../library/tarfile.rst:1055 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1055 +#: ../../library/tarfile.rst:1057 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: ../../library/tarfile.rst:1058 +#: ../../library/tarfile.rst:1060 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1060 +#: ../../library/tarfile.rst:1062 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: ../../library/tarfile.rst:1063 +#: ../../library/tarfile.rst:1065 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1065 +#: ../../library/tarfile.rst:1067 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1067 +#: ../../library/tarfile.rst:1069 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1069 +#: ../../library/tarfile.rst:1071 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1071 +#: ../../library/tarfile.rst:1073 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1075 +#: ../../library/tarfile.rst:1077 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1081 +#: ../../library/tarfile.rst:1083 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1083 +#: ../../library/tarfile.rst:1085 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1448,163 +1448,163 @@ msgid "" "version." msgstr "" -#: ../../library/tarfile.rst:1088 +#: ../../library/tarfile.rst:1090 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1092 +#: ../../library/tarfile.rst:1094 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1097 +#: ../../library/tarfile.rst:1099 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1104 +#: ../../library/tarfile.rst:1106 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1108 +#: ../../library/tarfile.rst:1110 msgid "or::" msgstr "" -#: ../../library/tarfile.rst:1113 +#: ../../library/tarfile.rst:1115 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1124 +#: ../../library/tarfile.rst:1126 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1126 +#: ../../library/tarfile.rst:1128 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1133 +#: ../../library/tarfile.rst:1135 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1155 +#: ../../library/tarfile.rst:1157 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:1159 +#: ../../library/tarfile.rst:1161 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1162 +#: ../../library/tarfile.rst:1164 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1169 +#: ../../library/tarfile.rst:1171 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1175 +#: ../../library/tarfile.rst:1177 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1182 +#: ../../library/tarfile.rst:1184 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1189 +#: ../../library/tarfile.rst:1191 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1197 +#: ../../library/tarfile.rst:1199 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:1202 +#: ../../library/tarfile.rst:1204 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1207 +#: ../../library/tarfile.rst:1209 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1212 +#: ../../library/tarfile.rst:1214 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1217 +#: ../../library/tarfile.rst:1219 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1221 +#: ../../library/tarfile.rst:1223 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1225 +#: ../../library/tarfile.rst:1227 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: ../../library/tarfile.rst:1233 +#: ../../library/tarfile.rst:1235 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:1235 +#: ../../library/tarfile.rst:1237 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:1242 +#: ../../library/tarfile.rst:1244 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:1257 +#: ../../library/tarfile.rst:1259 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:1265 +#: ../../library/tarfile.rst:1267 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:1272 +#: ../../library/tarfile.rst:1274 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:1286 +#: ../../library/tarfile.rst:1288 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1302 +#: ../../library/tarfile.rst:1304 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:1304 +#: ../../library/tarfile.rst:1306 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:1306 +#: ../../library/tarfile.rst:1308 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1612,7 +1612,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:1311 +#: ../../library/tarfile.rst:1313 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1620,7 +1620,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:1316 +#: ../../library/tarfile.rst:1318 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1631,7 +1631,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:1324 +#: ../../library/tarfile.rst:1326 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1640,13 +1640,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:1330 +#: ../../library/tarfile.rst:1332 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:1333 +#: ../../library/tarfile.rst:1335 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1655,17 +1655,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:1338 +#: ../../library/tarfile.rst:1340 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:1344 +#: ../../library/tarfile.rst:1346 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:1346 +#: ../../library/tarfile.rst:1348 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1680,13 +1680,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:1358 +#: ../../library/tarfile.rst:1360 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:1361 +#: ../../library/tarfile.rst:1363 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1695,7 +1695,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:1367 +#: ../../library/tarfile.rst:1369 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1703,7 +1703,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:1372 +#: ../../library/tarfile.rst:1374 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/reference/datamodel.po b/reference/datamodel.po index dbb0254140..acb7624569 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-21 00:03+0000\n" +"POT-Creation-Date: 2023-12-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3160,9 +3160,8 @@ msgstr "" #: ../../reference/datamodel.rst:2805 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " -"the accepted keys should be integers and slice objects. Note that the " -"special interpretation of negative indexes (if the class wishes to emulate " -"a :term:`sequence` type) is up to the :meth:`__getitem__` method. If *key* " +"the accepted keys should be integers. Optionally, they may support :class:" +"`slice` objects as well. Negative index support is also optional. If *key* " "is of an inappropriate type, :exc:`TypeError` may be raised; if *key* is a " "value outside the set of indexes for the sequence (after any special " "interpretation of negative values), :exc:`IndexError` should be raised. For :"