add 'output.stdout', '.stdin', and '.stderr' options

(#1621, #2152, #2529)

Allow setting custom input/output encodings and options
without having to rely on Python's defaults.
This commit is contained in:
Mike Fährmann
2023-02-26 14:56:19 +01:00
parent a70a3e5da6
commit e480a93337
3 changed files with 62 additions and 11 deletions

View File

@@ -33,9 +33,6 @@ def progress(urls, pformat):
def main():
try:
if sys.stdout and sys.stdout.encoding.lower() != "utf-8":
output.replace_std_streams()
parser = option.build_parser()
args = parser.parse_args()
log = output.initialize_logging(args.loglevel)
@@ -77,6 +74,8 @@ def main():
for opts in args.options:
config.set(*opts)
output.configure_standard_streams()
# signals
signals = config.get((), "signals-ignore")
if signals: