Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1378c32

Browse files
committed
Document the -W option as best as I can.
Get rid of BeOpen references.
1 parent d1db30b commit 1378c32

1 file changed

Lines changed: 70 additions & 7 deletions

File tree

Misc/python.man

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ python \- an interpreted, interactive, object-oriented programming language
3333
[
3434
.B \-V
3535
]
36+
[
37+
.B \-W
38+
.I argument
39+
]
3640
.br
3741
[
3842
.B \-c
@@ -116,6 +120,71 @@ Prints the usage for the interpreter executable and exits.
116120
.B \-V
117121
Prints the Python version number of the executable and exits.
118122
.TP
123+
.BI "\-W " argument
124+
Warning control. Python sometimes prints warning message to
125+
.IR sys.stderr .
126+
A typical warning message has the following form:
127+
.IB file ":" line ": " category ": " message.
128+
By default, each warning is printed once for each source line where it
129+
occurs. This option controls how often warnings are printed.
130+
Multiple
131+
.B \-W
132+
options may be given; when a warning matches more than one
133+
option, the action for the last matching option is performed.
134+
Invalid
135+
.B \-W
136+
options are ignored (a warning message is printed about invalid
137+
options when the first warning is issued). Warnings can also be
138+
controlled from within a Python program using the
139+
.I warnings
140+
module.
141+
142+
The simplest form of
143+
.I argument
144+
is one of the following
145+
.I action
146+
strings (or a unique abbreviation):
147+
.B ignore
148+
to ignore all warnings;
149+
.B default
150+
to explicitly request the default behavior (printing each warning once
151+
per source line);
152+
.B all
153+
to print a warning each time it occurs (this may generate many
154+
messages if a warning is triggered repeatedly for the same source
155+
line, e.g. inside a loop);
156+
.B module
157+
to print each warning only only the first time it occurs in each
158+
module;
159+
.B once
160+
to print each warning only the first time it occurs in the program; or
161+
.B error
162+
to raise an exception instead of printing a warning message.
163+
164+
The full form of
165+
.I argument
166+
is
167+
.IB action : message : category : module : line.
168+
Here,
169+
.I action
170+
is as explained above but only applies to messages that match the
171+
remaining fields. Empty fields match all values; trailing empty
172+
fields may be omitted. The
173+
.I message
174+
field matches the start of the warning message printed; this match is
175+
case-insensitive. The
176+
.I category
177+
field matches the warning category. This must be a class name; the
178+
match test whether the actual warning category of the message is a
179+
subclass of the specified warning category. The full class name must
180+
be given. The
181+
.I module
182+
field matches the (fully-qualified) module name; this match is
183+
case-sensitive. The
184+
.I line
185+
field matches the line number, where zero matches all line numbers and
186+
is thus equivalent to an omitted line number.
187+
.TP
119188
.BI "\-c " command
120189
Specify the command to execute (see next section).
121190
This terminates the option list (following options are passed as
@@ -250,20 +319,14 @@ the \fB\-v\fP option.
250319
.SH AUTHOR
251320
.nf
252321
Guido van Rossum
253-
BeOpen.com
254-
160 Saratoga Avenue
255-
Santa Clara, CA 95051
256-
USA
257322
.PP
258-
E-mail: guido@beopen.com, guido@python.org
323+
259324
.fi
260325
.PP
261326
And a cast of thousands.
262327
.SH INTERNET RESOURCES
263328
Main website: http://www.python.org
264329
.br
265-
BeOpen development team: http://pythonlabs.com
266-
.br
267330
Community website: http://starship.python.net
268331
.br
269332
Developer resources:

0 commit comments

Comments
 (0)