Skip to content

Conversation

@jaap3
Copy link

@jaap3 jaap3 commented Nov 4, 2021

Added a test that demonstrates the behavior reported in issue #78

Not sure how to fix this, so I'll keep this PR as a draft. Any guidance on how to "fix" this would be much appreciated.

@jaap3 jaap3 marked this pull request as draft November 4, 2021 14:08
@nedbat
Copy link
Member

nedbat commented Nov 4, 2021

Can you give me a small example of a Django project using a non-utf8 template?

@jaap3
Copy link
Author

jaap3 commented Nov 5, 2021

Hi Ned. As mentioned in the original issue (#78), in my case it's not actually a template but a changelog.txt file tucked away in a static directory of a submodule. django_coverage_plugin finds it (with the default settings) and stops working because of the encoding error.

As you said:

We should be more robust in the face of these sorts of things.

I'd like django_coverage_plugin to at least continue operating when it encounters a unreadable file. An acceptable solution would be to just mark the file as unreadable/uncovered.

@jaap3
Copy link
Author

jaap3 commented Nov 8, 2021

I've updated the test to more accurately show when/where the issue arises. I've also added a proposed fix.

@jaap3
Copy link
Author

jaap3 commented Nov 10, 2021

Fixed in #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants