Make the "-" output file name equivalent to /dev/stdout (fixes issue #103)
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Fri, 19 Mar 2010 16:51:20 +0000 (17:51 +0100)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:26:48 +0000 (11:26 +0100)
youtube-dl

index 742fabb4922fe2a1d16bf4997ace98fe34697be2..b79ab02943c5c1593139f8d8028a5907bd13a677 100755 (executable)
@@ -93,6 +93,8 @@ def sanitize_open(filename, open_mode):
        It returns the tuple (stream, definitive_file_name).
        """
        try:
+               if filename == u'-':
+                       return (sys.stdout, filename)
                stream = open(filename, open_mode)
                return (stream, filename)
        except (IOError, OSError), err: