This is an archive of the discontinued Mercurial Phabricator instance.

import-checker: open all source files as utf-8
ClosedPublic

Authored by indygreg on Nov 4 2019, 11:57 PM.

Details

Summary

Before, we opened in text mode and used the default encoding
to interpret the bytes within.

This caused problems interpreting some byte sequences in some
files.

This commit changes things to always open files as UTF-8, which
makes the error go away.

test-check-module-imports.t now passes on Python 3.5 and 3.6
with this change.

Diff Detail

Repository
rHG Mercurial
Branch
stable
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

indygreg created this revision.Nov 4 2019, 11:57 PM
pulkit accepted this revision.Nov 5 2019, 4:16 AM
This revision is now accepted and ready to land.Nov 5 2019, 4:16 AM
This revision was automatically updated to reflect the committed changes.