This repository was archived by the owner on Jun 3, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ def download_cmd():
272272
273273def get_cmd ():
274274 import argparse
275- from stream .io .std import StdOut
275+ from stream .io .std import StdOut , stderr
276276 parser = argparse .ArgumentParser ()
277277 parser .add_argument ('url' , type = str , nargs = '?' )
278278 parser .add_argument ('--host' , '-H' , type = str )
@@ -290,4 +290,8 @@ def get_cmd():
290290 path ,
291291 ) as f :
292292 with StdOut () as stdout :
293- f .dump_to_buffer (stdout .buffer )
293+ try :
294+ f .dump_to_buffer (stdout .buffer )
295+ except BrokenPipeError :
296+ # avoid "exception ignored" message
297+ stderr .close ()
Original file line number Diff line number Diff line change @@ -126,11 +126,15 @@ def download_cmd():
126126
127127def get_cmd ():
128128 import argparse
129- from stream .io .std import StdOut
129+ from stream .io .std import StdOut , stderr
130130 parser = argparse .ArgumentParser ()
131131 parser .add_argument ('url' , type = str )
132132 args = parser .parse_args ()
133133
134134 with HttpDownloadFile (args .url ) as f :
135135 with StdOut () as stdout :
136- f .copy_to (stdout .buffer )
136+ try :
137+ f .copy_to (stdout .buffer )
138+ except BrokenPipeError :
139+ # avoid "exception ignored" message
140+ stderr .close ()
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ def get_cmd():
355355 Stream to stdout
356356 """
357357 import argparse
358- from stream .io .std import StdOut
358+ from stream .io .std import StdOut , stderr
359359 parser = argparse .ArgumentParser ()
360360 parser .add_argument ('bucket' )
361361 parser .add_argument ('key' )
@@ -367,7 +367,11 @@ def get_cmd():
367367 lines = False ,
368368 ) as f :
369369 with StdOut () as stdout :
370- f .copy_to (stdout .buffer )
370+ try :
371+ f .copy_to (stdout .buffer )
372+ except BrokenPipeError :
373+ # avoid "exception ignored" message
374+ stderr .close ()
371375
372376
373377def copy_cmd ():
You can’t perform that action at this time.
0 commit comments