Skip to content

Sync with CPython 3.13 #1091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c-api/bytearray.po
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ msgid ""
"Return a new bytearray object from any object, *o*, that implements the :ref:"
"`buffer protocol <bufferobjects>`."
msgstr ""
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協議 (buffer "
"由任意物件 *o* 回傳一個新的位元組陣列物件,並實作了\\ :ref:`緩衝協定 (buffer "
"protocol) <bufferobjects>`。"

#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52
Expand Down
2 changes: 1 addition & 1 deletion c-api/exceptions.po
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ msgstr ""
#: ../../c-api/exceptions.rst:253 ../../c-api/exceptions.rst:263
#: ../../c-api/exceptions.rst:271 ../../c-api/exceptions.rst:281
msgid "Availability"
msgstr ""
msgstr "可用性"

#: ../../c-api/exceptions.rst:239
msgid ""
Expand Down
2 changes: 1 addition & 1 deletion c-api/init.po
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ msgstr "更多詳情請見 :pep:`529`。"

#: ../../c-api/init.rst:238 ../../c-api/init.rst:256
msgid "Availability"
msgstr ""
msgstr "可用性"

#: ../../c-api/init.rst:244
msgid ""
Expand Down
4 changes: 2 additions & 2 deletions c-api/intro.po
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,8 @@ msgid ""
"general) function to set the exception state, and :c:func:`PyErr_Clear` "
"clears the exception state."
msgstr ""
"例外的狀態會在個別執行緒的存儲空間 (per-thread storage) 中維護(這相當於在非"
"執行緒應用程式中使用全域存儲空間)。執行緒可以處於兩種狀態之一:發生例外或未"
"例外的狀態會在個別執行緒的儲存空間 (per-thread storage) 中維護(這相當於在非"
"執行緒應用程式中使用全域儲存空間)。執行緒可以處於兩種狀態之一:發生例外或未"
"發生例外。函式 :c:func:`PyErr_Occurred` 可用於檢查這一點:當例外發生時,它回"
"傳對例外型別物件的借用參照,否則回傳 ``NULL``。設定例外狀態的函式有很多::c:"
"func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :"
Expand Down
4 changes: 2 additions & 2 deletions c-api/iter.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ msgstr ""

#: ../../c-api/iter.rst:6
msgid "Iterator Protocol"
msgstr "疊代器協議"
msgstr "疊代器協定"

#: ../../c-api/iter.rst:8
msgid "There are two functions specifically for working with iterators."
Expand All @@ -41,7 +41,7 @@ msgid ""
"Return non-zero if the object *o* provides the :class:`AsyncIterator` "
"protocol, and ``0`` otherwise. This function always succeeds."
msgstr ""
"如果物件 *o* 有提供 :class:`AsyncIterator` 協議,則回傳非零,否則回傳 0。這個"
"如果物件 *o* 有提供 :class:`AsyncIterator` 協定,則回傳非零,否則回傳 0。這個"
"函式一定會執行成功。"

#: ../../c-api/iter.rst:24
Expand Down
6 changes: 2 additions & 4 deletions faq/extending.po
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ msgid "module = PyImport_ImportModule(\"<modulename>\");"
msgstr "module = PyImport_ImportModule(\"<modulename>\");"

#: ../../faq/extending.rst:173
#, fuzzy
msgid ""
"If the module hasn't been imported yet (i.e. it is not yet present in :data:"
"`sys.modules`), this initializes the module; otherwise it simply returns the "
Expand All @@ -337,14 +336,13 @@ msgid ""
msgstr ""
"如果模組還沒有被引入(即它還沒有出現在 :data:`sys.modules` 中),這會初始化模"
"組;否則它只回傳 ``sys.modules[\"<modulename>\"]`` 的值。請注意,它不會將模組"
"輸入任何命名空間——它只會確保它已被初始化並存儲在 :data:`sys.modules` 中。"
"輸入任何命名空間——它只會確保它已被初始化並儲存在 :data:`sys.modules` 中。"

#: ../../faq/extending.rst:179
#, fuzzy
msgid ""
"You can then access the module's attributes (i.e. any name defined in the "
"module) as follows::"
msgstr "然後,你可以存取模組的屬性(即模組中定義的任何名稱),如下所示: ::"
msgstr "然後你可以存取模組的屬性(即模組中定義的任何名稱),如下所示: ::"

#: ../../faq/extending.rst:182
msgid "attr = PyObject_GetAttrString(module, \"<attrname>\");"
Expand Down
69 changes: 1 addition & 68 deletions faq/library.po
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ msgid ""
"multi-threaded Python program effectively only uses one CPU, due to the "
"insistence that (almost) all Python code can only run while the GIL is held."
msgstr ""
":term:`global interpreter lock` (GIL) 通常被視為 Python 在高端多處理器服務器"
":term:`global interpreter lock` (GIL) 通常被視為 Python 在高端多處理器伺服器"
"機器上部署的障礙,因為多執行緒 Python 程式實際上只使用一個 CPU,因為堅持(幾"
"乎)所有 Python 程式碼只能在持有 GIL 的情況下運行。"

Expand Down Expand Up @@ -1362,70 +1362,3 @@ msgid ""
"multiple random number generators."
msgstr ""
"還有一個 ``Random`` 類別,你可以將它實例化以建立多個獨立的隨機數生成器。"

#, fuzzy
#~ msgid ""
#~ "It has been suggested that the GIL should be a per-interpreter-state lock "
#~ "rather than truly global; interpreters then wouldn't be able to share "
#~ "objects. Unfortunately, this isn't likely to happen either. It would be "
#~ "a tremendous amount of work, because many object implementations "
#~ "currently have global state. For example, small integers and short "
#~ "strings are cached; these caches would have to be moved to the "
#~ "interpreter state. Other object types have their own free list; these "
#~ "free lists would have to be moved to the interpreter state. And so on."
#~ msgstr ""
#~ "有人建議 GIL 應該是每個直譯器狀態鎖,而不是真正的全域鎖;口譯員將無法共享"
#~ "物件。不幸的是,這也不太可能發生。這將是一項巨大的工作量,因為目前許多物件"
#~ "實作都具有全域狀態。例如,快取小整數和短字串;這些快取必須移至直譯器狀態。"
#~ "其他物件型別有自己的空閒列表;這些空閒列表必須移至直譯器狀態。等等。"

#, fuzzy
#~ msgid ""
#~ "And I doubt that it can even be done in finite time, because the same "
#~ "problem exists for 3rd party extensions. It is likely that 3rd party "
#~ "extensions are being written at a faster rate than you can convert them "
#~ "to store all their global state in the interpreter state."
#~ msgstr ""
#~ "而且我懷疑它甚至可以在有限的時間內完成,因為第 3 方擴充存在同樣的問題。 "
#~ "3rd 方擴充的編寫速度可能比你轉換它們以將其所有全域狀態存儲在直譯器狀態中的"
#~ "速度更快。"

#, fuzzy
#~ msgid ""
#~ "Cameron Laird maintains a useful set of pages about Python web "
#~ "technologies at https://web.archive.org/web/20210224183619/http://"
#~ "phaseit.net/claird/comp.lang.python/web_python."
#~ msgstr ""
#~ "Cameron Laird 在 https://web.archive.org/web/20210224183619/http://"
#~ "phaseit.net/claird/comp.lang.python/web_python 維護著一組有用的關於 "
#~ "Python 網路技術的頁面。"

#, fuzzy
#~ msgid ""
#~ "I would like to retrieve web pages that are the result of POSTing a form. "
#~ "Is there existing code that would let me do this easily?"
#~ msgstr ""
#~ "我想檢索作為發布表單結果的網頁。是否有現成的程式碼可以讓我輕鬆地做到這一"
#~ "點?"

#~ msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::"
#~ msgstr "是的,這是一個 :mod:`urllib.request` 的簡單範例: ::"

#, fuzzy
#~ msgid ""
#~ "Note that in general for percent-encoded POST operations, query strings "
#~ "must be quoted using :func:`urllib.parse.urlencode`. For example, to "
#~ "send ``name=Guy Steele, Jr.``::"
#~ msgstr ""
#~ "請注意,通常對於百分比編碼的 POST 操作,查詢字串必須使"
#~ "用 :func:`urllib.parse.urlencode` 引用。例如,發送 ``name=Guy Steele, "
#~ "Jr.``: ::"

#~ msgid ""
#~ ">>> import urllib.parse\n"
#~ ">>> urllib.parse.urlencode({'name': 'Guy Steele, Jr.'})\n"
#~ "'name=Guy+Steele%2C+Jr.'"
#~ msgstr ""
#~ ">>> import urllib.parse\n"
#~ ">>> urllib.parse.urlencode({'name': 'Guy Steele, Jr.'})\n"
#~ "'name=Guy+Steele%2C+Jr.'"
13 changes: 6 additions & 7 deletions faq/programming.po
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ msgstr ""
"\n"
" # Calculate the value\n"
" result = ... expensive computation ...\n"
" _cache[(arg1, arg2)] = result # 將結果存儲在快取中\n"
" _cache[(arg1, arg2)] = result # 將結果儲存在快取中\n"
" return result"

#: ../../faq/programming.rst:389
Expand Down Expand Up @@ -2057,7 +2057,6 @@ msgid ""
msgstr "以奇數個反斜線結尾的原始字串將轉義字串的引號: ::"

#: ../../faq/programming.rst:1036
#, fuzzy
msgid ""
">>> r'C:\\this\\will\\not\\work\\'\n"
" File \"<stdin>\", line 1\n"
Expand All @@ -2068,7 +2067,7 @@ msgstr ""
">>> r'C:\\this\\will\\not\\work\\'\n"
" File \"<stdin>\", line 1\n"
" r'C:\\this\\will\\not\\work\\'\n"
" ^\n"
" ^\n"
"SyntaxError: unterminated string literal (detected at line 1)"

#: ../../faq/programming.rst:1042
Expand Down Expand Up @@ -3777,7 +3776,7 @@ msgid ""
"change object identity. After the list assignment ``s[0] = x``, it is "
"guaranteed that ``s[0] is x``."
msgstr ""
"2) 將物件放入存儲物件參照的容器中不會改變物件識別性。在 list 賦值 ``s[0] = "
"2) 將物件放入儲存物件參照的容器中不會改變物件識別性。在 list 賦值 ``s[0] = "
"x`` 之後,保證 ``s[0] 是 x``。"

#: ../../faq/programming.rst:1877
Expand Down Expand Up @@ -3926,7 +3925,7 @@ msgstr ""
#: ../../faq/programming.rst:1945
msgid ""
"How can a subclass control what data is stored in an immutable instance?"
msgstr "子類別如何控制不可變實例中存儲的資料?"
msgstr "子類別如何控制不可變實例中儲存的資料?"

#: ../../faq/programming.rst:1947
#, fuzzy
Expand Down Expand Up @@ -4026,7 +4025,7 @@ msgid ""
"at the instance level and the latter at the class level."
msgstr ""
"快取方法的兩個主要工具是 func:`functools.cached_property` 和 :func:"
"`functools.lru_cache`。前者在實例級別存儲結果,後者在類別級別存儲結果。"
"`functools.lru_cache`。前者在實例級別儲存結果,後者在類別級別儲存結果。"

#: ../../faq/programming.rst:2002
#, fuzzy
Expand Down Expand Up @@ -4177,7 +4176,7 @@ msgid ""
msgstr ""
"無法建立 .pyc 檔案的原因之一是包含源檔案的目錄存在權限問題,這意味著無法建立 "
"__pycache__ 子目錄。例如,如果你以一個使用者的身份開發但以另一個使用者的身份"
"運行,例如你正在使用 Web 服務器進行測試,就會發生這種情況。"
"運行,例如你正在使用 Web 伺服器進行測試,就會發生這種情況。"

#: ../../faq/programming.rst:2093
#, fuzzy
Expand Down
6 changes: 3 additions & 3 deletions howto/sockets.po
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ msgid ""
"request, then reads a reply. That's it. The socket is discarded. This means "
"that a client can detect the end of the reply by receiving 0 bytes."
msgstr ""
"像 HTTP 這樣的協議只使用一個 socket 進行一次傳輸,用戶端發送一個請求,然後讀"
"像 HTTP 這樣的協定只使用一個 socket 進行一次傳輸,用戶端發送一個請求,然後讀"
"取一個回覆。就這樣,然後這個 socket 就會被銷毀。這表示者用戶端可以通過接收"
"「零位元組」來檢測回覆的結束。"

Expand Down Expand Up @@ -441,7 +441,7 @@ msgid ""
"of a following message. You'll need to put that aside and hold onto it, "
"until it's needed."
msgstr ""
"需要注意的一個複雜情況是,如果你的通訊協議允許連續發送多個訊息(沒有任何回"
"需要注意的一個複雜情況是,如果你的通訊協定允許連續發送多個訊息(沒有任何回"
"應),並且你傳遞給 ``recv`` 函式一個任意的區塊大小,最後有可能讀取到下一條訊"
"息的開頭。你需要將其放在一旁並保留下來,直到需要使用的時候。"

Expand Down Expand Up @@ -594,7 +594,7 @@ msgid ""
"the thread, your whole process is likely to be screwed up."
msgstr ""
"使用阻塞式 socket 最糟糕的地方可能是在另一端突然強制關閉(未執行 ``close``)"
"的情況下會發生什麼?你的 socket 很可能會處於阻塞狀態。TCP 是一種可靠的協議,"
"的情況下會發生什麼?你的 socket 很可能會處於阻塞狀態。TCP 是一種可靠的協定,"
"它在放棄連線之前會等待很長很長的時間。如果你正在使用執行緒,整個執行緒基本上"
"已經無法使用。在這方面,你無法做太多事情。只要你不做一些愚蠢的事情,比如在執"
"行阻塞式讀取時持有一個鎖,那麼執行緒並不會消耗太多資源。*不要*\\ 試圖終止執行"
Expand Down
4 changes: 2 additions & 2 deletions howto/urllib2.po
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ msgid ""
"These are provided by objects called handlers and openers."
msgstr ""
"**urllib.request** 是一個用來從 URLs (Uniform Resource Locators) 取得資料的"
"Python模組。它提供一個了非常簡單的介面能接受多種不同的協議,*urlopen* 函式。"
"Python模組。它提供一個了非常簡單的介面能接受多種不同的協定,*urlopen* 函式。"
"也提供了較複雜的介面用於處理一些常見的狀況,例如:基本的 authentication、"
"cookies、proxies 等等,這些都可以由 handler 或 opener 物件操作。"

Expand All @@ -88,7 +88,7 @@ msgid ""
"is supplementary to them."
msgstr ""
"一般情形下 *urlopen* 是非常容易使用的,但當你遇到錯誤或者較複雜的情況下,你可"
"能需要對超文本協議 HyperText Transfer Protocol 有一定的了解。最完整且具參考價"
"能需要對超文本協定 (HyperText Transfer Protocol) 有一定的了解。最完整且具參考價"
"值的是 :rfc:`2616`,不過它是一份技術文件並不容易閱讀,以下的教學會提供足夠的 "
"HTTP 知識來幫助你使用 *urllib*。這份教學並非要取代 :mod:`urllib.request` 這份"
"文件,你還是會需要它。"
Expand Down
2 changes: 1 addition & 1 deletion library/__future__.po
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ msgid ""
"compiler_flag` attribute on :class:`_Feature` instances."
msgstr ""
"*CompilerFlag* 是(位元欄位 (bitfield))旗標,應在第四個引數中傳遞給內建函"
"式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標存儲在 :class:"
"式 :func:`compile` 以在動態編譯的程式碼中啟用該功能。此旗標儲存在 :class:"
"`_Feature` 實例上的 :attr:`_Feature.compiler_flag` 屬性中。"

#: ../../library/__future__.rst:117
Expand Down
2 changes: 1 addition & 1 deletion library/_thread.po
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ msgstr ""

#: ../../library/_thread.rst:123 ../../library/_thread.rst:148
msgid "Availability"
msgstr ""
msgstr "可用性"

#: ../../library/_thread.rst:127
msgid "Added support for GNU/kFreeBSD."
Expand Down
2 changes: 1 addition & 1 deletion library/asyncio-api-index.po
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ msgstr "傳送網路資料的高階 async/await 物件。"

#: ../../library/asyncio-api-index.rst:170
msgid ":ref:`Example TCP client <asyncio_example_stream>`."
msgstr ":ref:`TCP 客戶端範例 <asyncio_example_stream>`。"
msgstr ":ref:`TCP 用戶端範例 <asyncio_example_stream>`。"

#: ../../library/asyncio-api-index.rst:172
msgid "See also the :ref:`streams APIs <asyncio-streams>` documentation."
Expand Down
24 changes: 12 additions & 12 deletions library/asyncio-eventloop.po
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ msgid ""
"The protocol instance is coupled with the transport by calling its :meth:"
"`~BaseProtocol.connection_made` method."
msgstr ""
"通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協議實例與傳輸連線在"
"通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協定實例與傳輸連線在"
"一起。"

#: ../../library/asyncio-eventloop.rst:454
Expand Down Expand Up @@ -781,7 +781,7 @@ msgid ""
"these should all be integers from the corresponding :mod:`socket` module "
"constants."
msgstr ""
"*family*、*proto*、*flags* 是可選的位址家族、協議和旗標,用於傳遞至 "
"*family*、*proto*、*flags* 是可選的位址家族、協定和旗標,用於傳遞至 "
"getaddrinfo() 進行 *host* 解析。若有給定這些應該都是相應 :mod:`socket` 模組常"
"數的整數。"

Expand Down Expand Up @@ -917,7 +917,7 @@ msgid ""
"visible delay and provides an algorithm."
msgstr ""
"Happy Eyeballs 演算法:雙協定堆疊主機 (Dual-Stack Hosts) 的成功。當伺服器的 "
"IPv4 路徑和協議運作正常,但伺服器的 IPv6 路徑和協議不運作時,雙棧用戶端應用程"
"IPv4 路徑和協定運作正常,但伺服器的 IPv6 路徑和協定不運作時,雙棧用戶端應用程"
"式會比僅具 IPv4 的用戶端體驗到顯著的連線延遲。這是不希望的,因為這會導致雙棧"
"用戶端的使用者體驗變差。本文件具體說明了減少此用戶可見延遲的演算法要求並提供"
"了一種演算法。"
Expand Down Expand Up @@ -1045,8 +1045,8 @@ msgid ""
"See :ref:`UDP echo client protocol <asyncio-udp-echo-client-protocol>` and :"
"ref:`UDP echo server protocol <asyncio-udp-echo-server-protocol>` examples."
msgstr ""
"請參閱 :ref:`UDP 回應用戶端協議 <asyncio-udp-echo-client-protocol>` 和 :ref:"
"`UDP 回應伺服器協議 <asyncio-udp-echo-server-protocol>` 範例。"
"請參閱 :ref:`UDP 回應用戶端協定 <asyncio-udp-echo-client-protocol>` 和 :ref:"
"`UDP 回應伺服器協定 <asyncio-udp-echo-server-protocol>` 範例。"

#: ../../library/asyncio-eventloop.rst:630
msgid ""
Expand Down Expand Up @@ -1130,7 +1130,7 @@ msgstr ""
#: ../../library/asyncio-eventloop.rst:1840
#: ../../library/asyncio-eventloop.rst:1847
msgid "Availability"
msgstr ""
msgstr "可用性"

#: ../../library/asyncio-eventloop.rst:681
msgid ""
Expand Down Expand Up @@ -1360,7 +1360,7 @@ msgstr "加入 *cleanup_socket* 參數。"

#: ../../library/asyncio-eventloop.rst:856
msgid "Wrap an already accepted connection into a transport/protocol pair."
msgstr "將已接受的連線包裝成傳輸層/協議對。"
msgstr "將已接受的連線包裝成傳輸層/協定對。"

#: ../../library/asyncio-eventloop.rst:858
msgid ""
Expand Down Expand Up @@ -1462,7 +1462,7 @@ msgid ""
"protocol and *protocol*-facing transport."
msgstr ""
"建立 TLS 編解碼器實例並在 *transport* 和 *protocol* 之間插入它。編解碼器既實"
"作了對於 *transport* 的協議,也實作了對於 *protocol* 的傳輸。"
"作了對於 *transport* 的協定,也實作了對於 *protocol* 的傳輸。"

#: ../../library/asyncio-eventloop.rst:945
msgid ""
Expand Down Expand Up @@ -1580,7 +1580,7 @@ msgid ""
"socket` objects directly is more convenient."
msgstr ""
"一般情況下,使用基於傳輸的 API(如 :meth:`loop.create_connection` 和 :meth:"
"`loop.create_server`\\ )的協議實作比直接使用 socket 的實作更快。然而在某些情"
"`loop.create_server`)的協定實作比直接使用 socket 的實作更快。然而在某些情"
"況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。"

#: ../../library/asyncio-eventloop.rst:1034
Expand Down Expand Up @@ -2568,7 +2568,7 @@ msgstr ""

#: ../../library/asyncio-eventloop.rst:1712
msgid "Close all existing incoming client connections."
msgstr "關閉所有現有的傳入客戶端連線。"
msgstr "關閉所有現有的傳入用戶端連線。"

#: ../../library/asyncio-eventloop.rst:1714
msgid ""
Expand All @@ -2585,7 +2585,7 @@ msgstr ""
msgid ""
"Close all existing incoming client connections immediately, without waiting "
"for pending operations to complete."
msgstr "立即關閉所有現有的傳入客戶端連線,而不等待待定操作完成。"
msgstr "立即關閉所有現有的傳入用戶端連線,而不等待待定操作完成。"

#: ../../library/asyncio-eventloop.rst:1727
msgid ""
Expand Down Expand Up @@ -2656,7 +2656,7 @@ msgid ""
msgstr ""
"async def client_connected(reader, writer):\n"
" # 透過讀取器/寫入器串流\n"
" # 與客戶端溝通。例如:\n"
" # 與用戶端溝通。例如:\n"
" await reader.readline()\n"
"\n"
"async def main(host, port):\n"
Expand Down
Loading