@@ -54,7 +54,7 @@ msgstr "파이썬 개발 모드를 활성화하는 것은 다음 명령과 유
54
54
55
55
#: ../../library/devmode.rst:24
56
56
msgid "PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler"
57
- msgstr ""
57
+ msgstr "PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler "
58
58
59
59
#: ../../library/devmode.rst:26
60
60
msgid "Effects of the Python Development Mode:"
@@ -145,16 +145,16 @@ msgstr ""
145
145
"``default``\\ 로 설정하십시오."
146
146
147
147
#: ../../library/devmode.rst:61
148
- #, fuzzy
149
148
msgid ""
150
149
"Call :func:`faulthandler.enable` at Python startup to install handlers "
151
150
"for the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, "
152
151
":const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and "
153
152
":const:`~signal.SIGILL` signals to dump the Python traceback on a crash."
154
153
msgstr ""
155
- "파이썬 시작 시 :func:`faulthandler.enable`\\ 을 호출하여 :const:`SIGSEGV`, "
156
- ":const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` 및 :const:`SIGILL` 시그널에"
157
- " 대한 처리기를 설치하여 충돌 시 파이썬 트레이스백을 덤프합니다."
154
+ "파이썬 시작 시 :func:`faulthandler.enable`\\ 을 호출하여 :const:`~signal.SIGSEGV`, "
155
+ ":const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, "
156
+ ":const:`~signal.SIGBUS` 및 :const:`~signal.SIGILL` 시그널에 대한 처리기를 설치하여 충돌 시 "
157
+ "파이썬 트레이스백을 덤프합니다."
158
158
159
159
#: ../../library/devmode.rst:66
160
160
msgid ""
@@ -202,11 +202,10 @@ msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions."
202
202
msgstr ":class:`io.IOBase` 파괴자는 ``close()`` 예외를 로그 합니다."
203
203
204
204
#: ../../library/devmode.rst:85
205
- #, fuzzy
206
205
msgid ""
207
206
"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to "
208
207
"``True``."
209
- msgstr ":attr :`sys.flags`\\ 의 :attr:`~sys.flags.dev_mode` 어트리뷰트를 ``True``\\ 로 설정합니다."
208
+ msgstr ":data :`sys.flags`\\ 의 :attr:`~sys.flags.dev_mode` 어트리뷰트를 ``True``\\ 로 설정합니다."
210
209
211
210
#: ../../library/devmode.rst:88
212
211
msgid ""
@@ -271,6 +270,16 @@ msgid ""
271
270
"if __name__ == \" __main__\" :\n"
272
271
" main()"
273
272
msgstr ""
273
+ "import sys\n"
274
+ "\n"
275
+ "def main():\n"
276
+ " fp = open(sys.argv[1])\n"
277
+ " nlines = len(fp.readlines())\n"
278
+ " print(nlines)\n"
279
+ " # 파일이 묵시적으로 닫힙니다\n"
280
+ "\n"
281
+ "if __name__ == \" __main__\" :\n"
282
+ " main()"
274
283
275
284
#: ../../library/devmode.rst:127
276
285
msgid ""
@@ -285,6 +294,8 @@ msgid ""
285
294
"$ python script.py README.txt\n"
286
295
"269"
287
296
msgstr ""
297
+ "$ python script.py README.txt\n"
298
+ "269"
288
299
289
300
#: ../../library/devmode.rst:135
290
301
msgid ""
@@ -301,6 +312,12 @@ msgid ""
301
312
" main()\n"
302
313
"ResourceWarning: Enable tracemalloc to get the object allocation traceback"
303
314
msgstr ""
315
+ "$ python -X dev script.py README.txt\n"
316
+ "269\n"
317
+ "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper "
318
+ "name='README.rst' mode='r' encoding='UTF-8'>\n"
319
+ " main()\n"
320
+ "ResourceWarning: Enable tracemalloc to get the object allocation traceback"
304
321
305
322
#: ../../library/devmode.rst:145
306
323
msgid ""
@@ -321,6 +338,16 @@ msgid ""
321
338
" File \" script.py\" , lineno 4\n"
322
339
" fp = open(sys.argv[1])"
323
340
msgstr ""
341
+ "$ python -X dev -X tracemalloc=5 script.py README.rst\n"
342
+ "269\n"
343
+ "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper "
344
+ "name='README.rst' mode='r' encoding='UTF-8'>\n"
345
+ " main()\n"
346
+ "Object allocated at (most recent call last):\n"
347
+ " File \" script.py\" , lineno 10\n"
348
+ " main()\n"
349
+ " File \" script.py\" , lineno 4\n"
350
+ " fp = open(sys.argv[1])"
324
351
325
352
#: ../../library/devmode.rst:160
326
353
msgid "The fix is to close explicitly the file. Example using a context manager::"
@@ -334,6 +361,11 @@ msgid ""
334
361
" nlines = len(fp.readlines())\n"
335
362
" print(nlines)"
336
363
msgstr ""
364
+ "def main():\n"
365
+ " # 블록에서 빠져나갈 때 파일을 명시적으로 닫습니다\n"
366
+ " with open(sys.argv[1]) as fp:\n"
367
+ " nlines = len(fp.readlines())\n"
368
+ " print(nlines)"
337
369
338
370
#: ../../library/devmode.rst:168
339
371
msgid ""
@@ -367,6 +399,16 @@ msgid ""
367
399
"\n"
368
400
"main()"
369
401
msgstr ""
402
+ "import os\n"
403
+ "\n"
404
+ "def main():\n"
405
+ " fp = open(__file__)\n"
406
+ " firstline = fp.readline()\n"
407
+ " print(firstline.rstrip())\n"
408
+ " os.close(fp.fileno())\n"
409
+ " # 파일이 묵시적으로 닫힙니다\n"
410
+ "\n"
411
+ "main()"
370
412
371
413
#: ../../library/devmode.rst:190
372
414
msgid "By default, Python does not emit any warning:"
@@ -377,6 +419,8 @@ msgid ""
377
419
"$ python script.py\n"
378
420
"import os"
379
421
msgstr ""
422
+ "$ python script.py\n"
423
+ "import os"
380
424
381
425
#: ../../library/devmode.rst:197
382
426
msgid ""
@@ -402,6 +446,19 @@ msgid ""
402
446
" main()\n"
403
447
"OSError: [Errno 9] Bad file descriptor"
404
448
msgstr ""
449
+ "$ python -X dev script.py\n"
450
+ "import os\n"
451
+ "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper "
452
+ "name='script.py' mode='r' encoding='UTF-8'>\n"
453
+ " main()\n"
454
+ "ResourceWarning: Enable tracemalloc to get the object allocation "
455
+ "traceback\n"
456
+ "Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' "
457
+ "encoding='UTF-8'>\n"
458
+ "Traceback (most recent call last):\n"
459
+ " File \" script.py\" , line 10, in <module>\n"
460
+ " main()\n"
461
+ "OSError: [Errno 9] Bad file descriptor"
405
462
406
463
#: ../../library/devmode.rst:213
407
464
msgid ""
0 commit comments