From 051e27bf26e253d1abb1bf50d5bcf87b8aede787 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 2 Nov 2019 13:35:22 +0100 Subject: [PATCH] tools: check-imports using utf-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/30220 Reviewed-By: Michaƫl Zasso Reviewed-By: Richard Lau Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- tools/check-imports.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/check-imports.py b/tools/check-imports.py index b71b4a9271dfc4..51b4e63aa03903 100755 --- a/tools/check-imports.py +++ b/tools/check-imports.py @@ -2,6 +2,7 @@ from __future__ import print_function import glob +import io import re import sys @@ -15,7 +16,7 @@ def do_exist(file_name, lines, imported): def is_valid(file_name): - with open(file_name) as source_file: + with io.open(file_name, encoding='utf-8') as source_file: lines = [line.strip() for line in source_file] usings, importeds, line_numbers, valid = [], [], [], True