]> granicus.if.org Git - python/commitdiff
rstlint: explicitly open files as UTF8
authorZachary Ware <zachary.ware@gmail.com>
Wed, 22 Jul 2015 03:50:29 +0000 (22:50 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 22 Jul 2015 03:50:29 +0000 (22:50 -0500)
Doc/tools/rstlint.py

index be19ec8b377b7fb3f2f97e3b9f411c53b78f3c75..7dccf72f99cb56627fd8940374a3db7ad1f31e94 100755 (executable)
@@ -196,7 +196,7 @@ Options:  -v       verbose (print all checked file names)
                 print('Checking %s...' % fn)
 
             try:
-                with open(fn, 'r') as f:
+                with open(fn, 'r', encoding='utf-8') as f:
                     lines = list(f)
             except (IOError, OSError) as err:
                 print('%s: cannot open: %s' % (fn, err))