We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9abec55 commit 9da3f07Copy full SHA for 9da3f07
1 file changed
flickr_download/flick_download.py
@@ -8,6 +8,7 @@
8
from __future__ import print_function
9
from __future__ import unicode_literals
10
import argparse
11
+import codecs
12
import errno
13
import logging
14
import os
@@ -209,6 +210,11 @@ def main():
209
210
if not ret:
211
return 1
212
213
+ # Replace stdout with a non-strict writer that replaces unknown characters instead of throwing
214
+ # an exception. This "fixes" print issues on the standard Windows terminal
215
+ if sys.stdout.encoding.lower() != 'utf-8':
216
+ sys.stdout = codecs.getwriter(sys.stdout.encoding)(sys.stdout, 'replace')
217
+
218
if args.list:
219
print_sets(args.list)
220
return 0
0 commit comments