| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,7 @@ | |||
| 44 | 44 | import multiprocessing | |
| 45 | 45 | import errno | |
| 46 | 46 | import copy | |
| 47 | + import io | ||
| 47 | 48 | ||
| 48 | 49 | ||
| 49 | 50 | if sys.version_info >= (3, 5): | |
@@ -1595,7 +1596,13 @@ def Main(): | |||
| 1595 | 1596 | parser.print_help() | |
| 1596 | 1597 | return 1 | |
| 1597 | 1598 | ||
| 1598 | - ch = logging.StreamHandler(sys.stdout) | ||
| 1599 | + stream = sys.stdout | ||
| 1600 | + try: | ||
| 1601 | + sys.stdout.reconfigure(encoding='utf8') | ||
| 1602 | + except AttributeError: | ||
| 1603 | + # Python < 3.7 does not have reconfigure | ||
| 1604 | + stream = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') | ||
| 1605 | + ch = logging.StreamHandler(stream) | ||
| 1599 | 1606 | logger.addHandler(ch) | |
| 1600 | 1607 | logger.setLevel(logging.INFO) | |
| 1601 | 1608 | if options.logfile: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments