File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -1963,19 +1963,19 @@ def main(args = None):
1963
1963
args = sys .argv [1 :]
1964
1964
1965
1965
if not args or args [0 ] not in ('-l' , '-c' , '-e' , '-t' ):
1966
- print (USAGE )
1966
+ print (USAGE , file = sys . stderr )
1967
1967
sys .exit (1 )
1968
1968
1969
1969
if args [0 ] == '-l' :
1970
1970
if len (args ) != 2 :
1971
- print (USAGE )
1971
+ print (USAGE , file = sys . stderr )
1972
1972
sys .exit (1 )
1973
1973
with ZipFile (args [1 ], 'r' ) as zf :
1974
1974
zf .printdir ()
1975
1975
1976
1976
elif args [0 ] == '-t' :
1977
1977
if len (args ) != 2 :
1978
- print (USAGE )
1978
+ print (USAGE , file = sys . stderr )
1979
1979
sys .exit (1 )
1980
1980
with ZipFile (args [1 ], 'r' ) as zf :
1981
1981
badfile = zf .testzip ()
@@ -1985,15 +1985,15 @@ def main(args = None):
1985
1985
1986
1986
elif args [0 ] == '-e' :
1987
1987
if len (args ) != 3 :
1988
- print (USAGE )
1988
+ print (USAGE , file = sys . stderr )
1989
1989
sys .exit (1 )
1990
1990
1991
1991
with ZipFile (args [1 ], 'r' ) as zf :
1992
1992
zf .extractall (args [2 ])
1993
1993
1994
1994
elif args [0 ] == '-c' :
1995
1995
if len (args ) < 3 :
1996
- print (USAGE )
1996
+ print (USAGE , file = sys . stderr )
1997
1997
sys .exit (1 )
1998
1998
1999
1999
def addToZip (zf , path , zippath ):
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ Core and Builtins
13
13
Library
14
14
-------
15
15
16
+ Tools/Demos
17
+ -----------
18
+
19
+ - Issue #28102: The zipfile module CLI now prints usage to stderr.
20
+ Patch by Stephen J. Turnbull.
21
+
16
22
17
23
What's New in Python 3.6.0 beta 1
18
24
=================================
You can’t perform that action at this time.
0 commit comments