GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: allow test tap output to include unicode characters · nodejs/node@78ce8d3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tools
    • test.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import multiprocessing
4545
import errno
4646
import copy
47+
import io
4748

4849

4950
if sys.version_info >= (3, 5):
@@ -1595,7 +1596,13 @@ def Main():
15951596
parser.print_help()
15961597
return 1
15971598

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)
15991606
logger.addHandler(ch)
16001607
logger.setLevel(logging.INFO)
16011608
if options.logfile:

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.