Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test with non-unicode text file #82

Closed
wants to merge 1 commit into from
Closed

Conversation

jaap3
Copy link
Contributor

@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
Owner

nedbat commented Nov 4, 2021

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

@jaap3
Copy link
Contributor 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
Contributor 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
Contributor 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.

None yet

2 participants