Skip to content

Commit bbfa260

Browse files
sync with cpython d9dde70e
1 parent 3ec206c commit bbfa260

1 file changed

Lines changed: 61 additions & 48 deletions

File tree

‎library/tempfile.po‎

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.14\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2026-08-25 00:10+0000\n"
11+
"POT-Creation-Date: 2026-10-10 00:22+0000\n"
1212
"PO-Revision-Date: 2022-06-12 15:17+0800\n"
1313
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -136,7 +136,7 @@ msgstr ""
136136
"在不是 Posix 或 Cygwin 的平臺上,TemporaryFile 是 NamedTemporaryFile 的別名。"
137137

138138
#: ../../library/tempfile.rst:68 ../../library/tempfile.rst:137
139-
#: ../../library/tempfile.rst:266
139+
#: ../../library/tempfile.rst:275
140140
msgid ""
141141
"Raises an :ref:`auditing event <auditing>` ``tempfile.mkstemp`` with "
142142
"argument ``fullpath``."
@@ -388,23 +388,36 @@ msgstr ""
388388
"時所採取的操作似乎不常見,但它在除錯期間或當你需要基於其他邏輯的清理行為時會"
389389
"非常有用。"
390390

391-
#: ../../library/tempfile.rst:210 ../../library/tempfile.rst:292
391+
#: ../../library/tempfile.rst:212
392+
msgid ""
393+
"Cleanup is not robust against the tree being modified while it is removed. "
394+
"Files outside of the tree may have their permissions and file flags reset."
395+
msgstr ""
396+
397+
#: ../../library/tempfile.rst:215
398+
msgid ""
399+
"On systems where :data:`shutil.rmtree.avoids_symlink_attacks` is false, "
400+
"manipulating symbolic links during cleanup may cause files outside of the "
401+
"tree to be removed."
402+
msgstr ""
403+
404+
#: ../../library/tempfile.rst:219 ../../library/tempfile.rst:301
392405
msgid ""
393406
"Raises an :ref:`auditing event <auditing>` ``tempfile.mkdtemp`` with "
394407
"argument ``fullpath``."
395408
msgstr ""
396409
"引發一個附帶引數 ``fullpath`` 的 ``tempfile.mkdtemp`` :ref:`稽核事件 "
397410
"<auditing>`。"
398411

399-
#: ../../library/tempfile.rst:214
412+
#: ../../library/tempfile.rst:223
400413
msgid "Added *ignore_cleanup_errors* parameter."
401414
msgstr "新增 *ignore_cleanup_errors* 參數。"
402415

403-
#: ../../library/tempfile.rst:217
416+
#: ../../library/tempfile.rst:226
404417
msgid "Added the *delete* parameter."
405418
msgstr "新增 *delete* 參數。"
406419

407-
#: ../../library/tempfile.rst:223
420+
#: ../../library/tempfile.rst:232
408421
msgid ""
409422
"Creates a temporary file in the most secure manner possible. There are no "
410423
"race conditions in the file's creation, assuming that the platform properly "
@@ -418,13 +431,13 @@ msgstr ""
418431
"況。該檔案只能由建立者讀寫,如果所在平臺用 permission bit(許可權位元)來表示"
419432
"檔案是否可執行,則沒有人有執行權。"
420433

421-
#: ../../library/tempfile.rst:230
434+
#: ../../library/tempfile.rst:239
422435
msgid ""
423436
"The file descriptor is :ref:`not inherited by child processes "
424437
"<fd_inheritance>`."
425438
msgstr "檔案描述器\\ :ref:`不會被子行程繼承 <fd_inheritance>`。"
426439

427-
#: ../../library/tempfile.rst:232
440+
#: ../../library/tempfile.rst:241
428441
#, fuzzy
429442
msgid ""
430443
"Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible for "
@@ -434,7 +447,7 @@ msgstr ""
434447
"與 :func:`TemporaryFile` 不同,:func:`mkstemp` 使用者用完臨時檔案後需要自行將"
435448
"其刪除。"
436449

437-
#: ../../library/tempfile.rst:236
450+
#: ../../library/tempfile.rst:245
438451
msgid ""
439452
"If *suffix* is not ``None``, the file name will end with that suffix, "
440453
"otherwise there will be no suffix. :func:`mkstemp` does not put a dot "
@@ -445,7 +458,7 @@ msgstr ""
445458
"func:`mkstemp` 不會在檔名和後綴之間加點 (dot),如果需要加一個點號,請將其放"
446459
"在 *suffix* 的開頭。"
447460

448-
#: ../../library/tempfile.rst:241
461+
#: ../../library/tempfile.rst:250
449462
msgid ""
450463
"If *prefix* is not ``None``, the file name will begin with that prefix; "
451464
"otherwise, a default prefix is used. The default is the return value of :"
@@ -455,7 +468,7 @@ msgstr ""
455468
"綴。預設前綴是 :func:`gettempprefix` 或 :func:`gettempprefixb` 函式的回傳值"
456469
"(自動呼叫合適的函式)。"
457470

458-
#: ../../library/tempfile.rst:245
471+
#: ../../library/tempfile.rst:254
459472
msgid ""
460473
"If *dir* is not ``None``, the file will be created in that directory; "
461474
"otherwise, a default directory is used. The default directory is chosen "
@@ -471,7 +484,7 @@ msgstr ""
471484
"檔案路徑是使用者友善的,比如透過 ``os.popen()`` 將路徑傳遞給外部命令時仍需要"
472485
"加引號 (quoting)。"
473486

474-
#: ../../library/tempfile.rst:253
487+
#: ../../library/tempfile.rst:262
475488
msgid ""
476489
"If any of *suffix*, *prefix*, and *dir* are not ``None``, they must be the "
477490
"same type. If they are bytes, the returned name will be bytes instead of "
@@ -482,15 +495,15 @@ msgstr ""
482495
"型別相同。如果它們是位元組串,則回傳名稱的型別就是位元組串而非字串。如果不想"
483496
"遵循預設行為但又想要回傳值是位元組串型別,請傳入 ``suffix=b''``。"
484497

485-
#: ../../library/tempfile.rst:259
498+
#: ../../library/tempfile.rst:268
486499
msgid ""
487500
"If *text* is specified and true, the file is opened in text mode. Otherwise, "
488501
"(the default) the file is opened in binary mode."
489502
msgstr ""
490503
"如果指定了 *text* 且為真值,檔案會以文字模式開啟。否則,檔案(預設)以二進位"
491504
"制模式開啟。"
492505

493-
#: ../../library/tempfile.rst:262
506+
#: ../../library/tempfile.rst:271
494507
msgid ""
495508
":func:`mkstemp` returns a tuple containing an OS-level handle to an open "
496509
"file (as would be returned by :func:`os.open`) and the absolute pathname of "
@@ -500,7 +513,7 @@ msgstr ""
500513
"level) 控制代碼,指向一個開啟的檔案(如同 :func:`os.open` 的回傳值),第二元"
501514
"素是該檔案的絕對路徑。"
502515

503-
#: ../../library/tempfile.rst:268 ../../library/tempfile.rst:294
516+
#: ../../library/tempfile.rst:277 ../../library/tempfile.rst:303
504517
msgid ""
505518
"*suffix*, *prefix*, and *dir* may now be supplied in bytes in order to "
506519
"obtain a bytes return value. Prior to this, only str was allowed. *suffix* "
@@ -511,11 +524,11 @@ msgstr ""
511524
"串型別的回傳值。在之前只允許使用字串。*suffix* 和 *prefix* 現在可以接受 "
512525
"``None``,並且預設為 ``None`` 以使用合適的預設值。"
513526

514-
#: ../../library/tempfile.rst:274 ../../library/tempfile.rst:300
527+
#: ../../library/tempfile.rst:283 ../../library/tempfile.rst:309
515528
msgid "The *dir* parameter now accepts a :term:`path-like object`."
516529
msgstr "*dir* 參數現在可接受一個類路徑物件 (:term:`path-like object`)。"
517530

518-
#: ../../library/tempfile.rst:280
531+
#: ../../library/tempfile.rst:289
519532
msgid ""
520533
"Creates a temporary directory in the most secure manner possible. There are "
521534
"no race conditions in the directory's creation. The directory is readable, "
@@ -524,60 +537,60 @@ msgstr ""
524537
"盡可能以最安全的方式建立一個臨時目錄,建立該目錄時不會有 race condition 的情"
525538
"況,該目錄只能由建立者讀取、寫入和搜尋。"
526539

527-
#: ../../library/tempfile.rst:284
540+
#: ../../library/tempfile.rst:293
528541
msgid ""
529542
"The user of :func:`mkdtemp` is responsible for deleting the temporary "
530543
"directory and its contents when done with it."
531544
msgstr ":func:`mkdtemp` 的使用者用完臨時目錄後需要自行將其刪除。"
532545

533-
#: ../../library/tempfile.rst:287
546+
#: ../../library/tempfile.rst:296
534547
msgid ""
535548
"The *prefix*, *suffix*, and *dir* arguments are the same as for :func:"
536549
"`mkstemp`."
537550
msgstr ""
538551
"引數 *prefix*、*suffix* 和 *dir* 的含義與它們在 :func:`mkstemp` 中相同。"
539552

540-
#: ../../library/tempfile.rst:290
553+
#: ../../library/tempfile.rst:299
541554
msgid ":func:`mkdtemp` returns the absolute pathname of the new directory."
542555
msgstr ":func:`mkdtemp` 回傳新目錄的絕對路徑名稱。"
543556

544-
#: ../../library/tempfile.rst:303
557+
#: ../../library/tempfile.rst:312
545558
msgid ""
546559
":func:`mkdtemp` now always returns an absolute path, even if *dir* is "
547560
"relative."
548561
msgstr ":func:`mkdtemp` 現在都會回傳絕對路徑,即使 *dir* 是相對路徑。"
549562

550-
#: ../../library/tempfile.rst:309
563+
#: ../../library/tempfile.rst:318
551564
msgid ""
552565
"Return the name of the directory used for temporary files. This defines the "
553566
"default value for the *dir* argument to all functions in this module."
554567
msgstr ""
555568
"回傳儲存臨時檔案的目錄名稱。這設定了此 module 所有函式 *dir* 引數的預設值。"
556569

557-
#: ../../library/tempfile.rst:313
570+
#: ../../library/tempfile.rst:322
558571
msgid ""
559572
"Python searches a standard list of directories to find one which the calling "
560573
"user can create files in. The list is:"
561574
msgstr ""
562575
"Python 搜尋標準目錄列表來找到呼叫者可以在其中建立檔案的目錄。這個列表是:"
563576

564-
#: ../../library/tempfile.rst:316
577+
#: ../../library/tempfile.rst:325
565578
msgid "The directory named by the :envvar:`TMPDIR` environment variable."
566579
msgstr ":envvar:`TMPDIR` 環境變數指向的目錄。"
567580

568-
#: ../../library/tempfile.rst:318
581+
#: ../../library/tempfile.rst:327
569582
msgid "The directory named by the :envvar:`TEMP` environment variable."
570583
msgstr ":envvar:`TEMP` 環境變數指向的目錄。"
571584

572-
#: ../../library/tempfile.rst:320
585+
#: ../../library/tempfile.rst:329
573586
msgid "The directory named by the :envvar:`TMP` environment variable."
574587
msgstr ":envvar:`TMP` 環境變數指向的目錄。"
575588

576-
#: ../../library/tempfile.rst:322
589+
#: ../../library/tempfile.rst:331
577590
msgid "A platform-specific location:"
578591
msgstr "與平臺相關的位置:"
579592

580-
#: ../../library/tempfile.rst:324
593+
#: ../../library/tempfile.rst:333
581594
#, fuzzy
582595
msgid ""
583596
"On Windows, the directories :file:`%USERPROFILE%\\\\AppData\\\\Local\\"
@@ -587,47 +600,47 @@ msgstr ""
587600
"在 Windows 上,目錄依次為 :file:`C:\\\\TEMP`、:file:`C:\\\\TMP`、:file:`\\"
588601
"\\TEMP` 和 :file:`\\\\TMP`。"
589602

590-
#: ../../library/tempfile.rst:330
603+
#: ../../library/tempfile.rst:339
591604
msgid ""
592605
"On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and :"
593606
"file:`/usr/tmp`, in that order."
594607
msgstr ""
595608
"在所有其他平臺上,目錄依次為 :file:`/tmp`、:file:`/var/tmp` 和 :file:`/usr/"
596609
"tmp`。"
597610

598-
#: ../../library/tempfile.rst:333
611+
#: ../../library/tempfile.rst:342
599612
msgid "As a last resort, the current working directory."
600613
msgstr "不得已時,使用目前工作目錄。"
601614

602-
#: ../../library/tempfile.rst:335
615+
#: ../../library/tempfile.rst:344
603616
msgid ""
604617
"The result of this search is cached, see the description of :data:`tempdir` "
605618
"below."
606619
msgstr "搜尋的結果會被 cache(快取)起來,請見下面 :data:`tempdir` 的描述。"
607620

608-
#: ../../library/tempfile.rst:340
621+
#: ../../library/tempfile.rst:349
609622
msgid ""
610623
"Always returns a str. Previously it would return any :data:`tempdir` value "
611624
"regardless of type so long as it was not ``None``."
612625
msgstr ""
613626
"回傳一個字串。在之前的版本中它會回傳任意 :data:`tempdir` 的值而不考慮它的型"
614627
"別,只要它不為 ``None``。"
615628

616-
#: ../../library/tempfile.rst:345
629+
#: ../../library/tempfile.rst:354
617630
msgid "Same as :func:`gettempdir` but the return value is in bytes."
618631
msgstr "與 :func:`gettempdir` 相同,但回傳值為位元組串型別。"
619632

620-
#: ../../library/tempfile.rst:351
633+
#: ../../library/tempfile.rst:360
621634
msgid ""
622635
"Return the filename prefix used to create temporary files. This does not "
623636
"contain the directory component."
624637
msgstr "回傳用於建立臨時檔案的檔名前綴,它不包含目錄部分。"
625638

626-
#: ../../library/tempfile.rst:356
639+
#: ../../library/tempfile.rst:365
627640
msgid "Same as :func:`gettempprefix` but the return value is in bytes."
628641
msgstr "與 :func:`gettempprefix` 相同,但回傳值為位元組串型別。"
629642

630-
#: ../../library/tempfile.rst:360
643+
#: ../../library/tempfile.rst:369
631644
msgid ""
632645
"The module uses a global variable to store the name of the directory used "
633646
"for temporary files returned by :func:`gettempdir`. It can be set directly "
@@ -641,7 +654,7 @@ msgstr ""
641654
"式都接受一個 *dir* 引數,它可被用於指定目錄。這是個推薦的做法,它不會透過改變"
642655
"全域性 API 行為而對其他不預期此行為的程式造成影響。"
643656

644-
#: ../../library/tempfile.rst:369
657+
#: ../../library/tempfile.rst:378
645658
msgid ""
646659
"When set to a value other than ``None``, this variable defines the default "
647660
"value for the *dir* argument to the functions defined in this module, "
@@ -651,7 +664,7 @@ msgstr ""
651664
"預設值,包括確定其型別為位元組串還是字串。它不可以為 :term:`path-like "
652665
"object`。"
653666

654-
#: ../../library/tempfile.rst:374
667+
#: ../../library/tempfile.rst:383
655668
msgid ""
656669
"If ``tempdir`` is ``None`` (the default) at any call to any of the above "
657670
"functions except :func:`gettempprefix` it is initialized following the "
@@ -660,7 +673,7 @@ msgstr ""
660673
"如果在呼叫除 :func:`gettempprefix` 外的上述任何函式時 ``tempdir`` 為 "
661674
"``None`` (預設值) 則它會按照 :func:`gettempdir` 中所描述的演算法來初始化。"
662675

663-
#: ../../library/tempfile.rst:380
676+
#: ../../library/tempfile.rst:389
664677
msgid ""
665678
"Beware that if you set ``tempdir`` to a bytes value, there is a nasty side "
666679
"effect: The global default return type of :func:`mkstemp` and :func:"
@@ -674,16 +687,16 @@ msgstr ""
674687
"``prefix``、``suffix`` 或 ``dir`` 時被改為位元組串。請不要編寫預期此行為或依"
675688
"賴於此行為的程式。這個奇怪的行為是為了維持與以往實作版本的相容性。"
676689

677-
#: ../../library/tempfile.rst:391
690+
#: ../../library/tempfile.rst:400
678691
msgid "Examples"
679692
msgstr "範例"
680693

681-
#: ../../library/tempfile.rst:393
694+
#: ../../library/tempfile.rst:402
682695
msgid ""
683696
"Here are some examples of typical usage of the :mod:`!tempfile` module::"
684697
msgstr "以下是 :mod:`!tempfile` module 的一些常見用法範例: ::"
685698

686-
#: ../../library/tempfile.rst:395
699+
#: ../../library/tempfile.rst:404
687700
msgid ""
688701
">>> import tempfile\n"
689702
"\n"
@@ -765,11 +778,11 @@ msgstr ""
765778
">>>\n"
766779
"# 目錄及其內容已被刪除"
767780

768-
#: ../../library/tempfile.rst:438
781+
#: ../../library/tempfile.rst:447
769782
msgid "Deprecated functions and variables"
770783
msgstr "已棄用的函式和變數"
771784

772-
#: ../../library/tempfile.rst:440
785+
#: ../../library/tempfile.rst:449
773786
msgid ""
774787
"A historical way to create temporary files was to first generate a file name "
775788
"with the :func:`mktemp` function and then create a file using this name. "
@@ -784,11 +797,11 @@ msgstr ""
784797
"之間的時間裡,其他程式可能會使用該名稱建立檔案。解決方案是將兩個步驟結合起"
785798
"來,並立即建立檔案。這個方案目前被 :func:`mkstemp` 和上述其他函式所採用。"
786799

787-
#: ../../library/tempfile.rst:451
800+
#: ../../library/tempfile.rst:460
788801
msgid "Use :func:`mkstemp` instead."
789802
msgstr "使用 :func:`mkstemp` 代替。"
790803

791-
#: ../../library/tempfile.rst:454
804+
#: ../../library/tempfile.rst:463
792805
msgid ""
793806
"Return an absolute pathname of a file that did not exist at the time the "
794807
"call is made. The *prefix*, *suffix*, and *dir* arguments are similar to "
@@ -799,7 +812,7 @@ msgstr ""
799812
"與 :func:`mkstemp` 中所用的類似,除了在於不支援位元組串型別的檔名且不支援 "
800813
"``suffix=None`` 和 ``prefix=None``。"
801814

802-
#: ../../library/tempfile.rst:461
815+
#: ../../library/tempfile.rst:470
803816
msgid ""
804817
"Use of this function may introduce a security hole in your program. By the "
805818
"time you get around to doing anything with the file name it returns, someone "
@@ -811,7 +824,7 @@ msgstr ""
811824
"作時,可能有人已經捷足先登了。:func:`mktemp` 的功能可以很輕鬆地用帶有 "
812825
"``delete=False`` 參數的 :func:`NamedTemporaryFile` 代替: ::"
813826

814-
#: ../../library/tempfile.rst:467
827+
#: ../../library/tempfile.rst:476
815828
msgid ""
816829
">>> f = NamedTemporaryFile(delete=False)\n"
817830
">>> f.name\n"

0 commit comments

Comments
 (0)