-
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathsys.po
More file actions
2790 lines (2348 loc) · 97.8 KB
/
sys.po
File metadata and controls
2790 lines (2348 loc) · 97.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-07 12:52+0000\n"
"PO-Revision-Date: 2023-04-26 02:54+0800\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.2.2\n"
#: ../../library/sys.rst:2
msgid ":mod:`!sys` --- System-specific parameters and functions"
msgstr ":mod:`!sys` --- 系統特定的參數與函式"
#: ../../library/sys.rst:9
msgid ""
"This module provides access to some variables used or maintained by the "
"interpreter and to functions that interact strongly with the interpreter. It "
"is always available. Unless explicitly noted otherwise, all variables are "
"read-only."
msgstr ""
"此模組提供存取一些由直譯器使用或維護的變數,以及與直譯器強烈互動的函式。它總是可用的。除非明確說明,否則所有變數都是唯讀的。"
#: ../../library/sys.rst:16
msgid ""
"On POSIX systems where Python was built with the standard ``configure`` "
"script, this contains the ABI flags as specified by :pep:`3149`."
msgstr ""
"在使用標準 ``configure`` 指令碼建置 Python 的 POSIX 系統上,這包含 :pep:`3149` 中規定的 ABI 旗標。"
#: ../../library/sys.rst:21
msgid ""
"Default flags became an empty string (``m`` flag for pymalloc has been "
"removed)."
msgstr ""
"預設旗標變成空字串(pymalloc 的 ``m`` 旗標已被移除)。"
#: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369
#: ../../library/sys.rst:760 ../../library/sys.rst:778
#: ../../library/sys.rst:1022 ../../library/sys.rst:1524
#: ../../library/sys.rst:1765 ../../library/sys.rst:1780
#: ../../library/sys.rst:1788 ../../library/sys.rst:1804
#: ../../library/sys.rst:2048
msgid "Availability"
msgstr "可用性"
#: ../../library/sys.rst:30
msgid ""
"Append the callable *hook* to the list of active auditing hooks for the "
"current (sub)interpreter."
msgstr ""
"將可呼叫的 *hook* 附加到目前(子)直譯器的活躍稽核 hook 清單中。"
#: ../../library/sys.rst:33
msgid ""
"When an auditing event is raised through the :func:`sys.audit` function, "
"each hook will be called in the order it was added with the event name and "
"the tuple of arguments. Native hooks added by :c:func:`PySys_AddAuditHook` "
"are called first, followed by hooks added in the current (sub)interpreter. "
"Hooks can then log the event, raise an exception to abort the operation, or "
"terminate the process entirely."
msgstr ""
"當稽核事件透過 :func:`sys.audit` 函式引發時,每個 hook 都會按照其新增的順序被呼叫,並傳入事件名稱和引數元組。由 :c:func:`PySys_AddAuditHook` 新增的原生 hook 會先被呼叫,接著是在目前(子)直譯器中新增的 hook。Hook 可以記錄事件、引發例外以中止操作,或完全終止程序。"
#: ../../library/sys.rst:40
msgid ""
"Note that audit hooks are primarily for collecting information about "
"internal or otherwise unobservable actions, whether by Python or libraries "
"written in Python. They are not suitable for implementing a \"sandbox\". In "
"particular, malicious code can trivially disable or bypass hooks added using "
"this function. At a minimum, any security-sensitive hooks must be added "
"using the C API :c:func:`PySys_AddAuditHook` before initialising the "
"runtime, and any modules allowing arbitrary memory modification (such as :"
"mod:`ctypes`) should be completely removed or closely monitored."
msgstr ""
"請注意稽核 hook 主要是用來收集關於內部或其他無法觀察的操作的資訊,無論是由 Python 或以 Python 撰寫的函式庫執行的。它們不適合用來實作「沙盒」。特別是,惡意程式碼可以輕易地停用或繞過使用此函式新增的 hook。至少,任何安全敏感的 hook 必須在初始化執行時期之前使用 C API :c:func:`PySys_AddAuditHook` 新增,而任何允許任意記憶體修改的模組(例如 :mod:`ctypes`)應該被完全移除或密切監控。"
#: ../../library/sys.rst:49 ../../library/sys.rst:51
msgid ""
"Calling :func:`sys.addaudithook` will itself raise an auditing event named "
"``sys.addaudithook`` with no arguments. If any existing hooks raise an "
"exception derived from :class:`RuntimeError`, the new hook will not be added "
"and the exception suppressed. As a result, callers cannot assume that their "
"hook has been added unless they control all existing hooks."
msgstr ""
"呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys.addaudithook`` "
"的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` 衍生的例外,則不會添加新的 hook "
"並抑制例外。因此,除非呼叫者控制所有已存在的 hook,他們不能假設他們的 hook 已被添加。"
#: ../../library/sys.rst:58
msgid ""
"See the :ref:`audit events table <audit-events>` for all events raised by "
"CPython, and :pep:`578` for the original design discussion."
msgstr ""
"所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 <audit-events>`、設"
"計相關討論請見 :pep:`578`。"
#: ../../library/sys.rst:65
msgid ""
"Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are "
"no longer suppressed."
msgstr ""
"衍生自 :class:`Exception` 但非 :class:`RuntimeError` 的例外不再被抑制。"
#: ../../library/sys.rst:70
msgid ""
"When tracing is enabled (see :func:`settrace`), Python hooks are only traced "
"if the callable has a ``__cantrace__`` member that is set to a true value. "
"Otherwise, trace functions will skip the hook."
msgstr ""
"當追蹤功能啟用時(參閱 :func:`settrace`),Python hook 只有在可呼叫物件具有設定為真值的 ``__cantrace__`` 成員時才會被追蹤。否則,追蹤函式會跳過該 hook。"
#: ../../library/sys.rst:77
msgid ""
"The list of command line arguments passed to a Python script. ``argv[0]`` is "
"the script name (it is operating system dependent whether this is a full "
"pathname or not). If the command was executed using the :option:`-c` "
"command line option to the interpreter, ``argv[0]`` is set to the string ``'-"
"c'``. If no script name was passed to the Python interpreter, ``argv[0]`` "
"is the empty string."
msgstr ""
"傳遞給 Python 指令碼的命令列引數清單。``argv[0]`` 是指令碼名稱(這是否為完整路徑取決於作業系統)。如果命令是使用直譯器的 :option:`-c` 命令列選項執行的,``argv[0]`` 會被設定為字串 ``'-c'``。如果沒有將指令碼名稱傳遞給 Python 直譯器,``argv[0]`` 是空字串。"
#: ../../library/sys.rst:83
msgid ""
"To loop over the standard input, or the list of files given on the command "
"line, see the :mod:`fileinput` module."
msgstr ""
#: ../../library/sys.rst:86
msgid "See also :data:`sys.orig_argv`."
msgstr "另請參閱 :data:`sys.orig_argv`。"
#: ../../library/sys.rst:89
msgid ""
"On Unix, command line arguments are passed by bytes from OS. Python decodes "
"them with filesystem encoding and \"surrogateescape\" error handler. When "
"you need original bytes, you can get it by ``[os.fsencode(arg) for arg in "
"sys.argv]``."
msgstr ""
"在 Unix 上,命令列引數會以位元組形式從作業系統傳遞。Python 使用檔案系統編碼和 \"surrogateescape\" 錯誤處理器來解碼它們。當你需要原始位元組時,可以透過 ``[os.fsencode(arg) for arg in sys.argv]`` 來取得。"
#: ../../library/sys.rst:101
msgid ""
"Raise an auditing event and trigger any active auditing hooks. *event* is a "
"string identifying the event, and *args* may contain optional arguments with "
"more information about the event. The number and types of arguments for a "
"given event are considered a public and stable API and should not be "
"modified between releases."
msgstr ""
"引發一個稽核事件並觸發任何活躍的稽核 hook。*event* 是識別事件的字串,*args* 可能包含關於該事件更多資訊的選擇性引數。給定事件的引數數量和型別被視為公開且穩定的 API,不應在版本之間修改。"
#: ../../library/sys.rst:107
msgid ""
"For example, one auditing event is named ``os.chdir``. This event has one "
"argument called *path* that will contain the requested new working directory."
msgstr ""
"舉例來說,一個名為 ``os.chdir`` 的稽核事件擁有一個引數 *path*,其內容為所要求"
"的新工作目錄。"
#: ../../library/sys.rst:111
msgid ""
":func:`sys.audit` will call the existing auditing hooks, passing the event "
"name and arguments, and will re-raise the first exception from any hook. In "
"general, if an exception is raised, it should not be handled and the process "
"should be terminated as quickly as possible. This allows hook "
"implementations to decide how to respond to particular events: they can "
"merely log the event or abort the operation by raising an exception."
msgstr ""
#: ../../library/sys.rst:119
msgid ""
"Hooks are added using the :func:`sys.addaudithook` or :c:func:"
"`PySys_AddAuditHook` functions."
msgstr ""
#: ../../library/sys.rst:122
msgid ""
"The native equivalent of this function is :c:func:`PySys_Audit`. Using the "
"native function is preferred when possible."
msgstr ""
#: ../../library/sys.rst:125
msgid ""
"See the :ref:`audit events table <audit-events>` for all events raised by "
"CPython."
msgstr ""
"所有會被 CPython 所引發的事件請參考\\ :ref:`稽核事件總表 <audit-events>`。"
#: ../../library/sys.rst:133
msgid ""
"Set during Python startup, before ``site.py`` is run, to the same value as :"
"data:`exec_prefix`. If not running in a :ref:`virtual environment <venv-"
"def>`, the values will stay the same; if ``site.py`` finds that a virtual "
"environment is in use, the values of :data:`prefix` and :data:`exec_prefix` "
"will be changed to point to the virtual environment, whereas :data:"
"`base_prefix` and :data:`base_exec_prefix` will remain pointing to the base "
"Python installation (the one which the virtual environment was created from)."
msgstr ""
#: ../../library/sys.rst:147
msgid ""
"Set during Python startup, before ``site.py`` is run, to the same value as :"
"data:`prefix`. If not running in a :ref:`virtual environment <venv-def>`, "
"the values will stay the same; if ``site.py`` finds that a virtual "
"environment is in use, the values of :data:`prefix` and :data:`exec_prefix` "
"will be changed to point to the virtual environment, whereas :data:"
"`base_prefix` and :data:`base_exec_prefix` will remain pointing to the base "
"Python installation (the one which the virtual environment was created from)."
msgstr ""
#: ../../library/sys.rst:160
msgid ""
"An indicator of the native byte order. This will have the value ``'big'`` "
"on big-endian (most-significant byte first) platforms, and ``'little'`` on "
"little-endian (least-significant byte first) platforms."
msgstr ""
#: ../../library/sys.rst:167
msgid ""
"A tuple of strings containing the names of all modules that are compiled "
"into this Python interpreter. (This information is not available in any "
"other way --- ``modules.keys()`` only lists the imported modules.)"
msgstr ""
#: ../../library/sys.rst:171
msgid "See also the :data:`sys.stdlib_module_names` list."
msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。"
#: ../../library/sys.rst:176
msgid ""
"Call ``func(*args)``, while tracing is enabled. The tracing state is saved, "
"and restored afterwards. This is intended to be called from a debugger from "
"a checkpoint, to recursively debug or profile some other code."
msgstr ""
#: ../../library/sys.rst:180
msgid ""
"Tracing is suspended while calling a tracing function set by :func:"
"`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!"
"call_tracing` enables explicit recursion of the tracing function."
msgstr ""
#: ../../library/sys.rst:187
msgid "A string containing the copyright pertaining to the Python interpreter."
msgstr ""
#: ../../library/sys.rst:192
msgid ""
"Clear the internal type cache. The type cache is used to speed up attribute "
"and method lookups. Use the function *only* to drop unnecessary references "
"during reference leak debugging."
msgstr ""
#: ../../library/sys.rst:196 ../../library/sys.rst:223
#: ../../library/sys.rst:236
msgid ""
"This function should be used for internal and specialized purposes only."
msgstr ""
#: ../../library/sys.rst:198
msgid "Use the more general :func:`_clear_internal_caches` function instead."
msgstr ""
#: ../../library/sys.rst:204
msgid ""
"Clear all internal performance-related caches. Use this function *only* to "
"release unnecessary references and memory blocks when hunting for leaks."
msgstr ""
#: ../../library/sys.rst:212
msgid ""
"Return a dictionary mapping each thread's identifier to the topmost stack "
"frame currently active in that thread at the time the function is called. "
"Note that functions in the :mod:`traceback` module can build the call stack "
"given such a frame."
msgstr ""
#: ../../library/sys.rst:217
msgid ""
"This is most useful for debugging deadlock: this function does not require "
"the deadlocked threads' cooperation, and such threads' call stacks are "
"frozen for as long as they remain deadlocked. The frame returned for a non-"
"deadlocked thread may bear no relationship to that thread's current activity "
"by the time calling code examines the frame."
msgstr ""
#: ../../library/sys.rst:225
msgid ""
"Raises an :ref:`auditing event <auditing>` ``sys._current_frames`` with no "
"arguments."
msgstr ""
"引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``sys._current_frames``。"
#: ../../library/sys.rst:229
msgid ""
"Return a dictionary mapping each thread's identifier to the topmost "
"exception currently active in that thread at the time the function is "
"called. If a thread is not currently handling an exception, it is not "
"included in the result dictionary."
msgstr ""
#: ../../library/sys.rst:234
msgid "This is most useful for statistical profiling."
msgstr ""
#: ../../library/sys.rst:238
msgid ""
"Raises an :ref:`auditing event <auditing>` ``sys._current_exceptions`` with "
"no arguments."
msgstr ""
"引發一個不附帶引數的\\ :ref:`稽核事件 <auditing>` ``sys._current_exceptions``。"
#: ../../library/sys.rst:240
msgid ""
"Each value in the dictionary is now a single exception instance, rather than "
"a 3-tuple as returned from ``sys.exc_info()``."
msgstr ""
#: ../../library/sys.rst:246
msgid ""
"This hook function is called by built-in :func:`breakpoint`. By default, it "
"drops you into the :mod:`pdb` debugger, but it can be set to any other "
"function so that you can choose which debugger gets used."
msgstr ""
#: ../../library/sys.rst:250
msgid ""
"The signature of this function is dependent on what it calls. For example, "
"the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you "
"might bind it to a function that expects additional arguments (positional "
"and/or keyword). The built-in ``breakpoint()`` function passes its "
"``*args`` and ``**kws`` straight through. Whatever ``breakpointhooks()`` "
"returns is returned from ``breakpoint()``."
msgstr ""
#: ../../library/sys.rst:257
msgid ""
"The default implementation first consults the environment variable :envvar:"
"`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns "
"immediately; i.e. it is a no-op. If the environment variable is not set, or "
"is set to the empty string, ``pdb.set_trace()`` is called. Otherwise this "
"variable should name a function to run, using Python's dotted-import "
"nomenclature, e.g. ``package.subpackage.module.function``. In this case, "
"``package.subpackage.module`` would be imported and the resulting module "
"must have a callable named ``function()``. This is run, passing in "
"``*args`` and ``**kws``, and whatever ``function()`` returns, ``sys."
"breakpointhook()`` returns to the built-in :func:`breakpoint` function."
msgstr ""
#: ../../library/sys.rst:269
msgid ""
"Note that if anything goes wrong while importing the callable named by :"
"envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the "
"breakpoint is ignored."
msgstr ""
#: ../../library/sys.rst:273
msgid ""
"Also note that if ``sys.breakpointhook()`` is overridden programmatically, :"
"envvar:`PYTHONBREAKPOINT` is *not* consulted."
msgstr ""
#: ../../library/sys.rst:280
msgid ""
"Print low-level information to stderr about the state of CPython's memory "
"allocator."
msgstr ""
#: ../../library/sys.rst:283
msgid ""
"If Python is :ref:`built in debug mode <debug-build>` (:option:`configure --"
"with-pydebug option <--with-pydebug>`), it also performs some expensive "
"internal consistency checks."
msgstr ""
#: ../../library/sys.rst:291
msgid ""
"This function is specific to CPython. The exact output format is not "
"defined here, and may change."
msgstr ""
#: ../../library/sys.rst:297
msgid "Integer specifying the handle of the Python DLL."
msgstr ""
#: ../../library/sys.rst:304
msgid ""
"If *value* is not ``None``, this function prints ``repr(value)`` to ``sys."
"stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not "
"encodable to ``sys.stdout.encoding`` with ``sys.stdout.errors`` error "
"handler (which is probably ``'strict'``), encode it to ``sys.stdout."
"encoding`` with ``'backslashreplace'`` error handler."
msgstr ""
#: ../../library/sys.rst:310
msgid ""
"``sys.displayhook`` is called on the result of evaluating an :term:"
"`expression` entered in an interactive Python session. The display of these "
"values can be customized by assigning another one-argument function to ``sys."
"displayhook``."
msgstr ""
#: ../../library/sys.rst:314
msgid "Pseudo-code::"
msgstr ""
#: ../../library/sys.rst:316
msgid ""
"def displayhook(value):\n"
" if value is None:\n"
" return\n"
" # Set '_' to None to avoid recursion\n"
" builtins._ = None\n"
" text = repr(value)\n"
" try:\n"
" sys.stdout.write(text)\n"
" except UnicodeEncodeError:\n"
" bytes = text.encode(sys.stdout.encoding, 'backslashreplace')\n"
" if hasattr(sys.stdout, 'buffer'):\n"
" sys.stdout.buffer.write(bytes)\n"
" else:\n"
" text = bytes.decode(sys.stdout.encoding, 'strict')\n"
" sys.stdout.write(text)\n"
" sys.stdout.write(\"\\n\")\n"
" builtins._ = value"
msgstr ""
#: ../../library/sys.rst:334
msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`."
msgstr ""
#: ../../library/sys.rst:340
msgid ""
"If this is true, Python won't try to write ``.pyc`` files on the import of "
"source modules. This value is initially set to ``True`` or ``False`` "
"depending on the :option:`-B` command line option and the :envvar:"
"`PYTHONDONTWRITEBYTECODE` environment variable, but you can set it yourself "
"to control bytecode file generation."
msgstr ""
#: ../../library/sys.rst:349
msgid ""
"A :term:`named tuple` holding information about the environment on the "
"*wasm32-emscripten* platform. The named tuple is provisional and may change "
"in the future."
msgstr ""
#: ../../library/sys.rst:355
msgid ""
"Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, "
"8)``."
msgstr ""
#: ../../library/sys.rst:359
msgid ""
"Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or "
"``'UNKNOWN'``."
msgstr ""
"運行環境字串,例如瀏覽器使用者代理(browser user agent) ``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。"
#: ../../library/sys.rst:363
msgid "``True`` if Python is compiled with Emscripten pthreads support."
msgstr ""
#: ../../library/sys.rst:367
msgid "``True`` if Python is compiled with shared memory support."
msgstr ""
#: ../../library/sys.rst:376
msgid ""
"If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` "
"files to (and read them from) a parallel directory tree rooted at this "
"directory, rather than from ``__pycache__`` directories in the source code "
"tree. Any ``__pycache__`` directories in the source code tree will be "
"ignored and new ``.pyc`` files written within the pycache prefix. Thus if "
"you use :mod:`compileall` as a pre-build step, you must ensure you run it "
"with the same pycache prefix (if any) that you will use at runtime."
msgstr ""
#: ../../library/sys.rst:384
msgid ""
"A relative path is interpreted relative to the current working directory."
msgstr ""
#: ../../library/sys.rst:386
msgid ""
"This value is initially set based on the value of the :option:`-X` "
"``pycache_prefix=PATH`` command-line option or the :envvar:"
"`PYTHONPYCACHEPREFIX` environment variable (command-line takes precedence). "
"If neither are set, it is ``None``."
msgstr ""
#: ../../library/sys.rst:396
msgid ""
"This function prints out a given traceback and exception to ``sys.stderr``."
msgstr ""
#: ../../library/sys.rst:398
msgid ""
"When an exception other than :exc:`SystemExit` is raised and uncaught, the "
"interpreter calls ``sys.excepthook`` with three arguments, the exception "
"class, exception instance, and a traceback object. In an interactive "
"session this happens just before control is returned to the prompt; in a "
"Python program this happens just before the program exits. The handling of "
"such top-level exceptions can be customized by assigning another three-"
"argument function to ``sys.excepthook``."
msgstr ""
#: ../../library/sys.rst:405 ../../library/sys.rst:407
msgid ""
"Raise an auditing event ``sys.excepthook`` with arguments ``hook``, "
"``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no "
"hook has been set, ``hook`` may be ``None``. If any hook raises an exception "
"derived from :class:`RuntimeError` the call to the hook will be suppressed. "
"Otherwise, the audit hook exception will be reported as unraisable and ``sys."
"excepthook`` will be called."
msgstr ""
#: ../../library/sys.rst:416
msgid ""
"The :func:`sys.unraisablehook` function handles unraisable exceptions and "
"the :func:`threading.excepthook` function handles exception raised by :func:"
"`threading.Thread.run`."
msgstr ""
#: ../../library/sys.rst:426
msgid ""
"These objects contain the original values of ``breakpointhook``, "
"``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the "
"program. They are saved so that ``breakpointhook``, ``displayhook`` and "
"``excepthook``, ``unraisablehook`` can be restored in case they happen to "
"get replaced with broken or alternative objects."
msgstr ""
#: ../../library/sys.rst:432
msgid "__breakpointhook__"
msgstr "__breakpointhook__"
#: ../../library/sys.rst:435
msgid "__unraisablehook__"
msgstr "__unraisablehook__"
#: ../../library/sys.rst:441
msgid ""
"This function, when called while an exception handler is executing (such as "
"an ``except`` or ``except*`` clause), returns the exception instance that "
"was caught by this handler. When exception handlers are nested within one "
"another, only the exception handled by the innermost handler is accessible."
msgstr ""
#: ../../library/sys.rst:446
msgid "If no exception handler is executing, this function returns ``None``."
msgstr ""
#: ../../library/sys.rst:453
msgid ""
"This function returns the old-style representation of the handled exception. "
"If an exception ``e`` is currently handled (so :func:`exception` would "
"return ``e``), :func:`exc_info` returns the tuple ``(type(e), e, e."
"__traceback__)``. That is, a tuple containing the type of the exception (a "
"subclass of :exc:`BaseException`), the exception itself, and a :ref:"
"`traceback object <traceback-objects>` which typically encapsulates the call "
"stack at the point where the exception last occurred."
msgstr ""
#: ../../library/sys.rst:464
msgid ""
"If no exception is being handled anywhere on the stack, this function return "
"a tuple containing three ``None`` values."
msgstr ""
#: ../../library/sys.rst:467
msgid ""
"The ``type`` and ``traceback`` fields are now derived from the ``value`` "
"(the exception instance), so when an exception is modified while it is being "
"handled, the changes are reflected in the results of subsequent calls to :"
"func:`exc_info`."
msgstr ""
#: ../../library/sys.rst:475
msgid ""
"A string giving the site-specific directory prefix where the platform-"
"dependent Python files are installed; by default, this is also ``'/usr/"
"local'``. This can be set at build time with the ``--exec-prefix`` argument "
"to the :program:`configure` script. Specifically, all configuration files "
"(e.g. the :file:`pyconfig.h` header file) are installed in the directory :"
"file:`{exec_prefix}/lib/python{X.Y}/config`, and shared library modules are "
"installed in :file:`{exec_prefix}/lib/python{X.Y}/lib-dynload`, where *X.Y* "
"is the version number of Python, for example ``3.2``."
msgstr ""
#: ../../library/sys.rst:486
msgid ""
"If a :ref:`virtual environment <venv-def>` is in effect, this value will be "
"changed in ``site.py`` to point to the virtual environment. The value for "
"the Python installation will still be available, via :data:"
"`base_exec_prefix`."
msgstr ""
#: ../../library/sys.rst:494
msgid ""
"A string giving the absolute path of the executable binary for the Python "
"interpreter, on systems where this makes sense. If Python is unable to "
"retrieve the real path to its executable, :data:`sys.executable` will be an "
"empty string or ``None``."
msgstr ""
#: ../../library/sys.rst:502
msgid ""
"Raise a :exc:`SystemExit` exception, signaling an intention to exit the "
"interpreter."
msgstr ""
"引發 :exc:`SystemExit` 例外,表示意圖退出直譯器。"
#: ../../library/sys.rst:504
msgid ""
"The optional argument *arg* can be an integer giving the exit status "
"(defaulting to zero), or another type of object. If it is an integer, zero "
"is considered \"successful termination\" and any nonzero value is considered "
"\"abnormal termination\" by shells and the like. Most systems require it to "
"be in the range 0--127, and produce undefined results otherwise. Some "
"systems have a convention for assigning specific meanings to specific exit "
"codes, but these are generally underdeveloped; Unix programs generally use 2 "
"for command line syntax errors and 1 for all other kind of errors. If "
"another type of object is passed, ``None`` is equivalent to passing zero, "
"and any other object is printed to :data:`stderr` and results in an exit "
"code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick "
"way to exit a program when an error occurs."
msgstr ""
"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit(\"some error message\")`` 是在發生錯誤時退出程式的快速方法。"
#: ../../library/sys.rst:517
msgid ""
"Since :func:`exit` ultimately \"only\" raises an exception, it will only "
"exit the process when called from the main thread, and the exception is not "
"intercepted. Cleanup actions specified by finally clauses of :keyword:`try` "
"statements are honored, and it is possible to intercept the exit attempt at "
"an outer level."
msgstr ""
"由於 :func:`exit` 最終「只是」引發例外,它只有在從主執行緒呼叫且例外未被攔截時才會退出程序。:keyword:`try` 陳述式的 finally 子句中指定的清理動作會被執行,並且可以在外層攔截退出嘗試。"
#: ../../library/sys.rst:522
msgid ""
"If an error occurs in the cleanup after the Python interpreter has caught :"
"exc:`SystemExit` (such as an error flushing buffered data in the standard "
"streams), the exit status is changed to 120."
msgstr ""
#: ../../library/sys.rst:530
msgid ""
"The :term:`named tuple` *flags* exposes the status of command line flags. "
"The attributes are read only."
msgstr ""
#: ../../library/sys.rst:536
msgid ":option:`-d`"
msgstr ":option:`-d`"
#: ../../library/sys.rst:539 ../../library/sys.rst:542
msgid ":option:`-i`"
msgstr ":option:`-i`"
#: ../../library/sys.rst:545
msgid ":option:`-I`"
msgstr ":option:`-I`"
#: ../../library/sys.rst:548
msgid ":option:`-O` or :option:`-OO`"
msgstr ":option:`-O` 或 :option:`-OO`"
#: ../../library/sys.rst:551
msgid ":option:`-B`"
msgstr ":option:`-B`"
#: ../../library/sys.rst:554
msgid ":option:`-s`"
msgstr ":option:`-s`"
#: ../../library/sys.rst:557
msgid ":option:`-S`"
msgstr ":option:`-S`"
#: ../../library/sys.rst:560
msgid ":option:`-E`"
msgstr ":option:`-E`"
#: ../../library/sys.rst:563
msgid ":option:`-v`"
msgstr ":option:`-v`"
#: ../../library/sys.rst:566
msgid ":option:`-b`"
msgstr ":option:`-b`"
#: ../../library/sys.rst:569
msgid ":option:`-q`"
msgstr ":option:`-q`"
#: ../../library/sys.rst:572
msgid ":option:`-R`"
msgstr ":option:`-R`"
#: ../../library/sys.rst:575
msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode <devmode>`)"
msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 <devmode>`)"
#: ../../library/sys.rst:578
msgid ":option:`-X utf8 <-X>`"
msgstr ":option:`-X utf8 <-X>`"
#: ../../library/sys.rst:581
msgid ":option:`-P`"
msgstr ":option:`-P`"
#: ../../library/sys.rst:584
msgid ""
":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length "
"limitation <int_max_str_digits>`)"
msgstr ""
#: ../../library/sys.rst:588
msgid ":option:`-X warn_default_encoding <-X>`"
msgstr ":option:`-X warn_default_encoding <-X>`"
#: ../../library/sys.rst:590
msgid "Added ``quiet`` attribute for the new :option:`-q` flag."
msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。"
#: ../../library/sys.rst:593
msgid "The ``hash_randomization`` attribute."
msgstr "``hash_randomization`` 屬性。"
#: ../../library/sys.rst:596
msgid "Removed obsolete ``division_warning`` attribute."
msgstr "移除過時的 ``division_warning`` 屬性。"
#: ../../library/sys.rst:599
msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag."
msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。"
#: ../../library/sys.rst:602
msgid ""
"Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode "
"<devmode>` and the ``utf8_mode`` attribute for the new :option:`-X` "
"``utf8`` flag."
msgstr ""
#: ../../library/sys.rst:607
msgid ""
"Added ``warn_default_encoding`` attribute for :option:`-X` "
"``warn_default_encoding`` flag."
msgstr ""
"新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` "
"``warn_default_encoding`` 旗標。"
#: ../../library/sys.rst:610
msgid "Added the ``safe_path`` attribute for :option:`-P` option."
msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。"
#: ../../library/sys.rst:613
msgid "Added the ``int_max_str_digits`` attribute."
msgstr "新增 ``int_max_str_digits`` 屬性。"
#: ../../library/sys.rst:619
msgid ""
"A :term:`named tuple` holding information about the float type. It contains "
"low level information about the precision and internal representation. The "
"values correspond to the various floating-point constants defined in the "
"standard header file :file:`float.h` for the 'C' programming language; see "
"section 5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics of "
"floating types', for details."
msgstr ""
#: ../../library/sys.rst:626
msgid "Attributes of the :data:`!float_info` :term:`named tuple`"
msgstr ""
#: ../../library/sys.rst:629
msgid "attribute"
msgstr "屬性"
#: ../../library/sys.rst:630
msgid "float.h macro"
msgstr "float.h macro"
#: ../../library/sys.rst:631
msgid "explanation"
msgstr "解釋"
#: ../../library/sys.rst:634
msgid ":c:macro:`!DBL_EPSILON`"
msgstr ":c:macro:`!DBL_EPSILON`"
#: ../../library/sys.rst:635
msgid ""
"difference between 1.0 and the least value greater than 1.0 that is "
"representable as a float."
msgstr ""
#: ../../library/sys.rst:638
msgid "See also :func:`math.ulp`."
msgstr "另請參閱 :func:`math.ulp`。"
#: ../../library/sys.rst:641
msgid ":c:macro:`!DBL_DIG`"
msgstr ":c:macro:`!DBL_DIG`"
#: ../../library/sys.rst:642
msgid ""
"The maximum number of decimal digits that can be faithfully represented in a "
"float; see below."
msgstr ""
#: ../../library/sys.rst:646
msgid ":c:macro:`!DBL_MANT_DIG`"
msgstr ":c:macro:`!DBL_MANT_DIG`"
#: ../../library/sys.rst:647
msgid ""
"Float precision: the number of base-``radix`` digits in the significand of a "
"float."
msgstr ""
#: ../../library/sys.rst:651
msgid ":c:macro:`!DBL_MAX`"
msgstr ":c:macro:`!DBL_MAX`"
#: ../../library/sys.rst:652
msgid "The maximum representable positive finite float."
msgstr ""
#: ../../library/sys.rst:655
msgid ":c:macro:`!DBL_MAX_EXP`"
msgstr ":c:macro:`!DBL_MAX_EXP`"
#: ../../library/sys.rst:656
msgid ""
"The maximum integer *e* such that ``radix**(e-1)`` is a representable finite "
"float."
msgstr ""
#: ../../library/sys.rst:660
msgid ":c:macro:`!DBL_MAX_10_EXP`"
msgstr ":c:macro:`!DBL_MAX_10_EXP`"
#: ../../library/sys.rst:661
msgid ""
"The maximum integer *e* such that ``10**e`` is in the range of representable "
"finite floats."
msgstr ""
#: ../../library/sys.rst:665
msgid ":c:macro:`!DBL_MIN`"
msgstr ":c:macro:`!DBL_MIN`"
#: ../../library/sys.rst:666
msgid "The minimum representable positive *normalized* float."
msgstr ""
#: ../../library/sys.rst:668
msgid ""
"Use :func:`math.ulp(0.0) <math.ulp>` to get the smallest positive "
"*denormalized* representable float."
msgstr ""
#: ../../library/sys.rst:672
msgid ":c:macro:`!DBL_MIN_EXP`"
msgstr ":c:macro:`!DBL_MIN_EXP`"
#: ../../library/sys.rst:673
msgid ""
"The minimum integer *e* such that ``radix**(e-1)`` is a normalized float."
msgstr ""
#: ../../library/sys.rst:677
msgid ":c:macro:`!DBL_MIN_10_EXP`"
msgstr ":c:macro:`!DBL_MIN_10_EXP`"
#: ../../library/sys.rst:678
msgid "The minimum integer *e* such that ``10**e`` is a normalized float."
msgstr ""
#: ../../library/sys.rst:681
msgid ":c:macro:`!FLT_RADIX`"
msgstr ":c:macro:`!FLT_RADIX`"
#: ../../library/sys.rst:682
msgid "The radix of exponent representation."
msgstr ""
#: ../../library/sys.rst:685
msgid ":c:macro:`!FLT_ROUNDS`"
msgstr ":c:macro:`!FLT_ROUNDS`"
#: ../../library/sys.rst:686
msgid ""
"An integer representing the rounding mode for floating-point arithmetic. "
"This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at "
"interpreter startup time:"
msgstr ""
#: ../../library/sys.rst:690
msgid "``-1``: indeterminable"
msgstr ""
#: ../../library/sys.rst:691
msgid "``0``: toward zero"
msgstr ""
#: ../../library/sys.rst:692
msgid "``1``: to nearest"
msgstr ""
#: ../../library/sys.rst:693
msgid "``2``: toward positive infinity"
msgstr ""
#: ../../library/sys.rst:694
msgid "``3``: toward negative infinity"
msgstr ""
#: ../../library/sys.rst:696
msgid ""
"All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-"
"defined rounding behavior."
msgstr ""
#: ../../library/sys.rst:699
msgid ""
"The attribute :attr:`sys.float_info.dig` needs further explanation. If "
"``s`` is any string representing a decimal number with at most :attr:`!sys."
"float_info.dig` significant digits, then converting ``s`` to a float and "
"back again will recover a string representing the same decimal value::"
msgstr ""
#: ../../library/sys.rst:705
msgid ""
">>> import sys\n"
">>> sys.float_info.dig\n"
"15\n"
">>> s = '3.14159265358979' # decimal string with 15 significant digits\n"
">>> format(float(s), '.15g') # convert to float and back -> same value\n"
"'3.14159265358979'"
msgstr ""
#: ../../library/sys.rst:712
msgid ""
"But for strings with more than :attr:`sys.float_info.dig` significant "
"digits, this isn't always true::"
msgstr ""
#: ../../library/sys.rst:715
msgid ""
">>> s = '9876543211234567' # 16 significant digits is too many!\n"
">>> format(float(s), '.16g') # conversion changes value\n"
"'9876543211234568'"
msgstr ""
#: ../../library/sys.rst:721
msgid ""
"A string indicating how the :func:`repr` function behaves for floats. If "
"the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` "
"aims to produce a short string with the property that ``float(repr(x)) == "
"x``. This is the usual behaviour in Python 3.1 and later. Otherwise, "
"``float_repr_style`` has value ``'legacy'`` and ``repr(x)`` behaves in the "
"same way as it did in versions of Python prior to 3.1."
msgstr ""
#: ../../library/sys.rst:734
msgid ""
"Return the number of memory blocks currently allocated by the interpreter, "
"regardless of their size. This function is mainly useful for tracking and "
"debugging memory leaks. Because of the interpreter's internal caches, the "
"result can vary from call to call; you may have to call :func:"
"`_clear_internal_caches` and :func:`gc.collect` to get more predictable "
"results."
msgstr ""
#: ../../library/sys.rst:741
msgid ""
"If a Python build or implementation cannot reasonably compute this "
"information, :func:`getallocatedblocks` is allowed to return 0 instead."
msgstr ""
#: ../../library/sys.rst:749
msgid "Return the number of unicode objects that have been interned."
msgstr ""