1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-12-23 18:30:06 +01:00

Make the "-" output file name equivalent to /dev/stdout (fixes issue #103)

This commit is contained in:
Ricardo Garcia 2010-03-19 17:51:20 +01:00
parent 5caacaddc6
commit 131bc7651a

View File

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