@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.13\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-05-23 14:55 +0000\n "
14
+ "POT-Creation-Date : 2025-06-06 14:57 +0000\n "
15
15
"PO-Revision-Date : 2025-05-08 05:09+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
17
17
"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -25,7 +25,7 @@ msgstr ""
25
25
26
26
#: ../../library/io.rst:2
27
27
msgid ":mod:`!io` --- Core tools for working with streams"
28
- msgstr ""
28
+ msgstr ":mod:`!io` --- Ferramentas essenciais para trabalhar com fluxos "
29
29
30
30
#: ../../library/io.rst:15
31
31
msgid "**Source code:** :source:`Lib/io.py`"
@@ -44,6 +44,13 @@ msgid ""
44
44
"any of these categories is called a :term:`file object`. Other common terms "
45
45
"are *stream* and *file-like object*."
46
46
msgstr ""
47
+ "O módulo :mod:`io` fornece os principais recursos do Python para lidar com "
48
+ "vários tipos de E/S. Existem três tipos principais de E/S: *E/S de texto*, "
49
+ "*E/S binária* e *E/S bruta*. Essas são categorias genéricas, e vários "
50
+ "repositórios de apoio podem ser usados para cada uma delas. Um objeto "
51
+ "concreto pertencente a qualquer uma dessas categorias é chamado de :term:"
52
+ "`objeto arquivo`. Outros termos comuns são *fluxo* e *objeto arquivo ou "
53
+ "similar*."
47
54
48
55
#: ../../library/io.rst:34
49
56
msgid ""
@@ -53,6 +60,11 @@ msgid ""
53
60
"location), or only sequential access (for example in the case of a socket or "
54
61
"pipe)."
55
62
msgstr ""
63
+ "Independentemente de sua categoria, cada objeto de fluxo concreto também "
64
+ "terá vários recursos: pode ser somente leitura, somente escrita ou leitura e "
65
+ "escrita. Também pode permitir acesso aleatório arbitrário (buscando para "
66
+ "frente ou para trás em qualquer local) ou apenas acesso sequencial (por "
67
+ "exemplo, no caso de um soquete ou encadeamento)."
56
68
57
69
#: ../../library/io.rst:40
58
70
msgid ""
@@ -61,16 +73,22 @@ msgid ""
61
73
"binary stream will raise a :exc:`TypeError`. So will giving a :class:"
62
74
"`bytes` object to the :meth:`!write` method of a text stream."
63
75
msgstr ""
76
+ "Todos os fluxos são cuidadosos com o tipo de dados que você fornece a eles. "
77
+ "Por exemplo, atribuir um objeto :class:`str` ao método :meth:`!write` de um "
78
+ "fluxo binário levantará uma :exc:`TypeError`. O mesmo ocorrerá com um "
79
+ "objeto :class:`bytes` ao método :meth:`!write` de um fluxo de texto."
64
80
65
81
#: ../../library/io.rst:45
66
82
msgid ""
67
83
"Operations that used to raise :exc:`IOError` now raise :exc:`OSError`, "
68
84
"since :exc:`IOError` is now an alias of :exc:`OSError`."
69
85
msgstr ""
86
+ "Operações que costumavam levantar :exc:`IOError` agora levantam :exc:"
87
+ "`OSError`, já que :exc:`IOError` agora é um apelido de :exc:`OSError`."
70
88
71
89
#: ../../library/io.rst:51 ../../library/io.rst:862 ../../library/io.rst:1158
72
90
msgid "Text I/O"
73
- msgstr ""
91
+ msgstr "E/S de texto "
74
92
75
93
#: ../../library/io.rst:53
76
94
msgid ""
@@ -79,35 +97,46 @@ msgid ""
79
97
"a file), encoding and decoding of data is made transparently as well as "
80
98
"optional translation of platform-specific newline characters."
81
99
msgstr ""
100
+ "A E/S de texto espera e produz objetos :class:`str`. Isso significa que "
101
+ "sempre que o armazenamento de apoio for composto nativamente por bytes (como "
102
+ "no caso de um arquivo), a codificação e a decodificação dos dados são feitas "
103
+ "de forma transparente, bem como a tradução opcional de caracteres de quebra "
104
+ "de linha específicos da plataforma."
82
105
83
106
#: ../../library/io.rst:58
84
107
msgid ""
85
108
"The easiest way to create a text stream is with :meth:`open`, optionally "
86
109
"specifying an encoding::"
87
110
msgstr ""
111
+ "A maneira mais fácil de criar um fluxo de texto é com :meth:`open`, "
112
+ "especificando opcionalmente uma codificação::"
88
113
89
114
#: ../../library/io.rst:61
90
115
msgid "f = open(\" myfile.txt\" , \" r\" , encoding=\" utf-8\" )"
91
- msgstr ""
116
+ msgstr "f = open( \" myfile.txt \" , \" r \" , encoding= \" utf-8 \" ) "
92
117
93
118
#: ../../library/io.rst:63
94
119
msgid ""
95
120
"In-memory text streams are also available as :class:`StringIO` objects::"
96
121
msgstr ""
122
+ "Os fluxos de texto na memória também estão disponíveis como objetos :class:"
123
+ "`StringIO`::"
97
124
98
125
#: ../../library/io.rst:65
99
126
msgid "f = io.StringIO(\" some initial text data\" )"
100
- msgstr ""
127
+ msgstr "f = io.StringIO( \" alguns dados em texto iniciais \" ) "
101
128
102
129
#: ../../library/io.rst:67
103
130
msgid ""
104
131
"The text stream API is described in detail in the documentation of :class:"
105
132
"`TextIOBase`."
106
133
msgstr ""
134
+ "A API de fluxo de texto é descrita em detalhes na documentação de :class:"
135
+ "`TextIOBase`."
107
136
108
137
#: ../../library/io.rst:72 ../../library/io.rst:1146
109
138
msgid "Binary I/O"
110
- msgstr ""
139
+ msgstr "E/S binária "
111
140
112
141
#: ../../library/io.rst:74
113
142
msgid ""
@@ -117,41 +146,56 @@ msgid ""
117
146
"be used for all kinds of non-text data, and also when manual control over "
118
147
"the handling of text data is desired."
119
148
msgstr ""
149
+ "E/S binária (também chamada de *E/S com buffer*) espera :term:`objeto bytes "
150
+ "ou similar <bytes-like object>` e produz objetos :class:`bytes`. Nenhuma "
151
+ "codificação, decodificação ou tradução de quebra de linha é realizada. Esta "
152
+ "categoria de fluxos pode ser usada para todos os tipos de dados não textuais "
153
+ "e também quando se deseja controle manual sobre o tratamento de dados "
154
+ "textuais."
120
155
121
156
#: ../../library/io.rst:80
122
157
msgid ""
123
158
"The easiest way to create a binary stream is with :meth:`open` with ``'b'`` "
124
159
"in the mode string::"
125
160
msgstr ""
161
+ "A maneira mais fácil de criar um fluxo binário é com :meth:`open` com "
162
+ "``'b'`` na string de modo::"
126
163
127
164
#: ../../library/io.rst:83
128
165
msgid "f = open(\" myfile.jpg\" , \" rb\" )"
129
- msgstr ""
166
+ msgstr "f = open( \" meuarquivo.jpg \" , \" rb \" ) "
130
167
131
168
#: ../../library/io.rst:85
132
169
msgid ""
133
170
"In-memory binary streams are also available as :class:`BytesIO` objects::"
134
171
msgstr ""
172
+ "Os fluxos binários na memória também estão disponíveis como objetos :class:"
173
+ "`BytesIO`::"
135
174
136
175
#: ../../library/io.rst:87
137
176
msgid "f = io.BytesIO(b\" some initial binary data: \\ x00\\ x01\" )"
138
- msgstr ""
177
+ msgstr "f = io.BytesIO(b \" alguns dados bin \\ xe1rios iniciais: \\ x00 \\ x01 \" ) "
139
178
140
179
#: ../../library/io.rst:89
141
180
msgid ""
142
181
"The binary stream API is described in detail in the docs of :class:"
143
182
"`BufferedIOBase`."
144
183
msgstr ""
184
+ "A API de fluxo binário é descrita em detalhes na documentação de :class:"
185
+ "`BufferedIOBase`."
145
186
146
187
#: ../../library/io.rst:92
147
188
msgid ""
148
189
"Other library modules may provide additional ways to create text or binary "
149
190
"streams. See :meth:`socket.socket.makefile` for example."
150
191
msgstr ""
192
+ "Outros módulos de biblioteca podem fornecer maneiras adicionais de criar "
193
+ "fluxos de texto ou binários. Veja :meth:`socket.socket.makefile` como "
194
+ "exemplo."
151
195
152
196
#: ../../library/io.rst:97
153
197
msgid "Raw I/O"
154
- msgstr ""
198
+ msgstr "E/S bruta "
155
199
156
200
#: ../../library/io.rst:99
157
201
msgid ""
@@ -160,25 +204,34 @@ msgid ""
160
204
"manipulate a raw stream from user code. Nevertheless, you can create a raw "
161
205
"stream by opening a file in binary mode with buffering disabled::"
162
206
msgstr ""
207
+ "A E/S bruta (também chamada de *E/S sem buffer*) é geralmente usada como um "
208
+ "bloco de construção de baixo nível para fluxos binários e de texto; "
209
+ "raramente é útil manipular diretamente um fluxo bruto a partir do código do "
210
+ "usuário. No entanto, você pode criar um fluxo bruto abrindo um arquivo em "
211
+ "modo binário com o buffer desabilitado::"
163
212
164
213
#: ../../library/io.rst:104
165
214
msgid "f = open(\" myfile.jpg\" , \" rb\" , buffering=0)"
166
- msgstr ""
215
+ msgstr "f = open( \" meuarquivo.jpg \" , \" rb \" , buffering=0) "
167
216
168
217
#: ../../library/io.rst:106
169
218
msgid ""
170
219
"The raw stream API is described in detail in the docs of :class:`RawIOBase`."
171
220
msgstr ""
221
+ "A API de fluxo bruto é descrita em detalhes na documentação de :class:"
222
+ "`RawIOBase`."
172
223
173
224
#: ../../library/io.rst:112
174
225
msgid "Text Encoding"
175
- msgstr ""
226
+ msgstr "Codificação do texto "
176
227
177
228
#: ../../library/io.rst:114
178
229
msgid ""
179
230
"The default encoding of :class:`TextIOWrapper` and :func:`open` is locale-"
180
231
"specific (:func:`locale.getencoding`)."
181
232
msgstr ""
233
+ "A codificação padrão de :class:`TextIOWrapper` e :func:`open` é específica "
234
+ "da localidade (:func:`locale.getencoding`)."
182
235
183
236
#: ../../library/io.rst:117
184
237
msgid ""
@@ -187,13 +240,21 @@ msgid ""
187
240
"platforms use UTF-8 locale by default. This causes bugs because the locale "
188
241
"encoding is not UTF-8 for most Windows users. For example::"
189
242
msgstr ""
243
+ "No entanto, muitos desenvolvedores esquecem de especificar a codificação ao "
244
+ "abrir arquivos de texto codificados em UTF-8 (por exemplo, JSON, TOML, "
245
+ "Markdown, etc.), já que a maioria das plataformas Unix usa a localidade "
246
+ "UTF-8 por padrão. Isso causa bugs porque a codificação de localidade não é "
247
+ "UTF-8 para a maioria dos usuários do Windows. Por exemplo:"
190
248
191
249
#: ../../library/io.rst:122
192
250
msgid ""
193
251
"# May not work on Windows when non-ASCII characters in the file.\n"
194
252
"with open(\" README.md\" ) as f:\n"
195
253
" long_description = f.read()"
196
254
msgstr ""
255
+ "# Pode não funcionar no Windows quando há caracteres não ASCII no arquivo.\n"
256
+ "with open(\" README.md\" ) as f:\n"
257
+ " long_description = f.read()"
197
258
198
259
#: ../../library/io.rst:126
199
260
msgid ""
@@ -202,16 +263,22 @@ msgid ""
202
263
"``encoding=\" utf-8\" ``. To use the current locale encoding, "
203
264
"``encoding=\" locale\" `` is supported since Python 3.10."
204
265
msgstr ""
266
+ "Portanto, é altamente recomendável que você especifique a codificação "
267
+ "explicitamente ao abrir arquivos de texto. Se quiser usar UTF-8, passe "
268
+ "``encoding=\" utf-8\" ``. Para usar a codificação da localidade atual, "
269
+ "``encoding=\" locale\" `` é suportado desde o Python 3.10."
205
270
206
271
#: ../../library/io.rst:133
207
272
msgid ":ref:`utf8-mode`"
208
- msgstr ""
273
+ msgstr ":ref:`utf8-mode` "
209
274
210
275
#: ../../library/io.rst:134
211
276
msgid ""
212
277
"Python UTF-8 Mode can be used to change the default encoding to UTF-8 from "
213
278
"locale-specific encoding."
214
279
msgstr ""
280
+ "O modo Python UTF-8 pode ser usado para alterar a codificação padrão para "
281
+ "UTF-8 a partir da codificação específica de localidade."
215
282
216
283
#: ../../library/io.rst:137
217
284
msgid ":pep:`686`"
@@ -223,11 +290,11 @@ msgstr "Python 3.15 utilizará :ref:`utf8-mode` por padrão."
223
290
224
291
#: ../../library/io.rst:143
225
292
msgid "Opt-in EncodingWarning"
226
- msgstr ""
293
+ msgstr "Ativar EncodingWarning "
227
294
228
295
#: ../../library/io.rst:145
229
296
msgid "See :pep:`597` for more details."
230
- msgstr ""
297
+ msgstr "Veja a :pep:`597` para mais detalhes. "
231
298
232
299
#: ../../library/io.rst:148
233
300
msgid ""
@@ -236,6 +303,10 @@ msgid ""
236
303
"envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will emit an :"
237
304
"exc:`EncodingWarning` when the default encoding is used."
238
305
msgstr ""
306
+ "Para descobrir onde a codificação da localidade padrão é usada, você pode "
307
+ "habilitar a opção de linha de comando :option:`-X warn_default_encoding <-"
308
+ "X>` ou definir a variável de ambiente :envvar:`PYTHONWARNDEFAULTENCODING`, "
309
+ "que emitirá um :exc:`EncodingWarning` quando a codificação padrão for usada."
239
310
240
311
#: ../../library/io.rst:153
241
312
msgid ""
@@ -245,6 +316,11 @@ msgid ""
245
316
"`EncodingWarning` if they don't pass an ``encoding``. However, please "
246
317
"consider using UTF-8 by default (i.e. ``encoding=\" utf-8\" ``) for new APIs."
247
318
msgstr ""
319
+ "Se você estiver fornecendo uma API que usa :func:`open` ou :class:"
320
+ "`TextIOWrapper` e passa ``encoding=None`` como parâmetro, você pode usar :"
321
+ "func:`text_encoding` para que os chamadores da API emitam um :exc:"
322
+ "`EncodingWarning` se não passarem um ``encoding``. No entanto, considere "
323
+ "usar UTF-8 por padrão (ou seja, ``encoding=\" utf-8\" ``) para novas APIs."
248
324
249
325
#: ../../library/io.rst:162
250
326
msgid "High-level Module Interface"
0 commit comments