1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2023, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
3
#
5
4
# Translators:
6
5
# Ching-Lung Chuang, 2015
7
6
# Liang-Bo Wang <me@liang2.tw>, 2015
7
+ # Matt Wang <mattwang44@gmail.com>, 2022
8
8
msgid ""
9
9
msgstr ""
10
10
"Project-Id-Version : Python 3.11\n "
11
11
"Report-Msgid-Bugs-To : \n "
12
- "POT-Creation-Date : 2023-04-24 00:16 +0000\n "
13
- "PO-Revision-Date : 2017-09-22 18:26+0000 \n "
14
- "Last-Translator : Liang-Bo Wang <me@liang2.tw >\n "
12
+ "POT-Creation-Date : 2022-10-31 08:13 +0000\n "
13
+ "PO-Revision-Date : 2023-04-24 20:38+0800 \n "
14
+ "Last-Translator : Matt Wang <mattwang44@gmail.com >\n "
15
15
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
16
16
"tw)\n "
17
17
"Language : zh_TW\n "
18
18
"MIME-Version : 1.0\n "
19
19
"Content-Type : text/plain; charset=UTF-8\n "
20
20
"Content-Transfer-Encoding : 8bit\n "
21
21
"Plural-Forms : nplurals=1; plural=0;\n "
22
+ "X-Generator : Poedit 3.2.2\n "
22
23
23
24
#: ../../c-api/file.rst:6
24
25
msgid "File Objects"
25
- msgstr "檔案( File)物件 "
26
+ msgstr "檔案物件 ( File Objects) "
26
27
27
28
#: ../../c-api/file.rst:10
28
29
msgid ""
@@ -35,8 +36,14 @@ msgid ""
35
36
"reporting in the interpreter; third-party code is advised to access the :mod:"
36
37
"`io` APIs instead."
37
38
msgstr ""
39
+ "這些 API 是用於內建檔案物件的 Python 2 C API 的最小模擬 (minimal emulation),"
40
+ "它過去依賴於 C 標準函式庫對於緩衝 I/O (:c:expr:`FILE*`) 的支援。在 Python 3 "
41
+ "中,檔案和串流使用新的 :mod:`io` 模組,它在操作系統的低階無緩衝 I/O 上定義了"
42
+ "多個層級。下面描述的函式是這些新 API 的便捷 C 包裝器,主要用於直譯器中的內部"
43
+ "錯誤報告;建議第三方程式碼改為存取 :mod:`io` API。"
38
44
39
45
#: ../../c-api/file.rst:22
46
+ #, fuzzy
40
47
msgid ""
41
48
"Create a Python file object from the file descriptor of an already opened "
42
49
"file *fd*. The arguments *name*, *encoding*, *errors* and *newline* can be "
@@ -45,13 +52,19 @@ msgid ""
45
52
"failure. For a more comprehensive description of the arguments, please refer "
46
53
"to the :func:`io.open` function documentation."
47
54
msgstr ""
55
+ "從已打開檔案 *fd* 的檔案描述器建立一個 Python 檔案物件。引數 *name*、"
56
+ "*encoding*、*errors* 和 *newline* 可以為 ``NULL`` 以使用預設值; *buffering* "
57
+ "可以是 *-1* 以使用預設值。 *name* 被忽略並保留以實作向後相容性。失敗時回傳 "
58
+ "``NULL``。有關引數的更全面描述,請參閱 :func:`io.open` 函式文檔。"
48
59
49
60
#: ../../c-api/file.rst:31
50
61
msgid ""
51
62
"Since Python streams have their own buffering layer, mixing them with OS-"
52
63
"level file descriptors can produce various issues (such as unexpected "
53
64
"ordering of data)."
54
65
msgstr ""
66
+ "由於 Python 串流有自己的緩衝層,將它們與操作系統層級檔案描述器混合使用會產生"
67
+ "各種問題(例如資料的排序不符合預期)。"
55
68
56
69
#: ../../c-api/file.rst:35
57
70
msgid "Ignore *name* attribute."
@@ -65,8 +78,12 @@ msgid ""
65
78
"integer, which is returned as the file descriptor value. Sets an exception "
66
79
"and returns ``-1`` on failure."
67
80
msgstr ""
81
+ "回傳與 *p* 關聯的檔案描述器作為 :c:expr:`int`。如果物件是整數,則回傳其值。如"
82
+ "果不是整數,則呼叫物件的 :meth:`~io.IOBase.fileno` 方法(如果存在);該方法必"
83
+ "須回傳一個整數,它作為檔案描述器值回傳。設定例外並在失敗時回傳 ``-1``。"
68
84
69
85
#: ../../c-api/file.rst:52
86
+ #, fuzzy
70
87
msgid ""
71
88
"Equivalent to ``p.readline([n])``, this function reads one line from the "
72
89
"object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase."
@@ -78,49 +95,69 @@ msgid ""
78
95
"regardless of length, but :exc:`EOFError` is raised if the end of the file "
79
96
"is reached immediately."
80
97
msgstr ""
98
+ "相當於 ``p.readline([n])``,這個函式從物件 *p* 中讀取一行。 *p* 可以是檔案對"
99
+ "像或任何具有 :meth:`~io.IOBase.readline` 方法的物件。如果 *n* 為 ``0``,則只"
100
+ "讀取一行,而不管該行的長度。如果 *n* 大於 ``0``,則不會從檔案中讀取超過 *n* "
101
+ "個位元組;可以回傳部分行。在這兩種情況下,如果立即到達檔案末尾,則回傳一個空"
102
+ "字串。但是,如果 *n* 小於 ``0``,無論長度如何,都會讀取一行,但如果立即到達檔"
103
+ "案末尾,則會引發 :exc:`EOFError`。"
81
104
82
105
#: ../../c-api/file.rst:65
83
106
msgid ""
84
107
"Overrides the normal behavior of :func:`io.open_code` to pass its parameter "
85
108
"through the provided handler."
86
109
msgstr ""
110
+ "覆蓋 :func:`io.open_code` 的正常行為以透過提供的處理程式 (handler) 傳遞其參"
111
+ "數。"
87
112
88
113
#: ../../c-api/file.rst:68
89
114
msgid ""
90
115
"The handler is a function of type :c:expr:`PyObject *(\\ *)(PyObject *path, "
91
116
"void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`."
92
117
msgstr ""
118
+ "處理程式是 :c:expr:`PyObject *(\\ *)(PyObject *path, void *userData)` 型別的函"
119
+ "式,其中 *path* 保證為 :c:type:`PyUnicodeObject`。"
93
120
94
121
#: ../../c-api/file.rst:71
95
122
msgid ""
96
123
"The *userData* pointer is passed into the hook function. Since hook "
97
124
"functions may be called from different runtimes, this pointer should not "
98
125
"refer directly to Python state."
99
126
msgstr ""
127
+ "*userData* 指標被傳遞到掛鉤函式 (hook function) 中。由於可能會從不同的運行時"
128
+ "間 (runtime) 呼叫掛鉤函式,因此該指標不應直接指向 Python 狀態。"
100
129
101
130
#: ../../c-api/file.rst:75
102
131
msgid ""
103
132
"As this hook is intentionally used during import, avoid importing new "
104
133
"modules during its execution unless they are known to be frozen or available "
105
134
"in ``sys.modules``."
106
135
msgstr ""
136
+ "由於此掛鉤函式是在導入期間有意使用的,因此請避免在其執行期間導入新模組,除非"
137
+ "它們已知有被凍結或在 ``sys.modules`` 中可用。"
107
138
108
139
#: ../../c-api/file.rst:79
140
+ #, fuzzy
109
141
msgid ""
110
142
"Once a hook has been set, it cannot be removed or replaced, and later calls "
111
143
"to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function "
112
144
"returns -1 and sets an exception if the interpreter has been initialized."
113
145
msgstr ""
146
+ "一旦設定了一個掛鉤函式,它就不能被刪除或替換,以後呼叫 :c:func:"
147
+ "`PyFile_SetOpenCodeHook` 將失敗。失敗時,函式回傳 -1 並在直譯器已初始化時設定"
148
+ "例外。"
114
149
115
150
#: ../../c-api/file.rst:83
116
151
msgid "This function is safe to call before :c:func:`Py_Initialize`."
117
- msgstr ""
152
+ msgstr "在 :c:func:`Py_Initialize` 之前呼叫此函式是安全的。 "
118
153
119
154
#: ../../c-api/file.rst:85
120
155
msgid ""
121
156
"Raises an :ref:`auditing event <auditing>` ``setopencodehook`` with no "
122
157
"arguments."
123
158
msgstr ""
159
+ "不帶引數地引發一個\\ :ref:`稽核事件 (auditing event ) <auditing>` "
160
+ "``setopencodehook``\\ 。"
124
161
125
162
#: ../../c-api/file.rst:95
126
163
msgid ""
@@ -129,6 +166,9 @@ msgid ""
129
166
"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; "
130
167
"the appropriate exception will be set."
131
168
msgstr ""
169
+ "將物件 *obj* 寫入檔案物件 *p*。 *flags* 唯一支援的旗標是 :const:"
170
+ "`Py_PRINT_RAW`;如果有給定,則寫入物件的 :func:`str` 而不是 :func:`repr`。在"
171
+ "成功回傳 ``0`` 或在失敗回傳 ``-1``;將設定適當的例外。"
132
172
133
173
#: ../../c-api/file.rst:103
134
174
msgid ""
0 commit comments