files with incorrect encoding are ignored in Python3 · Issue #351 · nedbat/coveragepy (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@nedbat

Description

@nedbat

Originally reported by Thomas Tanner (Bitbucket: ttanner, GitHub: ttanner)


I've noticed a module containing a © (0xa9) character and specifying an incorrect PEP 263 source encoding (e.g. "-_- coding: utf-8 -_-" or no encoding instead of "-_- coding: latin1 -_-") is completely ignored by "coverage report -i" with Python 3.4, but not by Python 2.7.9.

This is inconsistent behaviour and surprising if you port from Python 2 to 3.

EDIT: -i flag