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

Fix UnicodeEncodeError when running unit tests in Windows #16497

Closed
wants to merge 1 commit into from
Closed

Fix UnicodeEncodeError when running unit tests in Windows #16497

wants to merge 1 commit into from

Conversation

stephenatgithub
Copy link
Contributor

When running unit test in Windows, got this error:
UnicodeDecodeError: 'cp950' codec can't decode byte 0xc3 in position 268: illegal multibyte sequence

Besides Linux or MacOS, this is to provide an extra resolution for Windows.
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#many-test-failures-with-unicodeencodeerror

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you set the PYTHONUTF8 environment variable, as per the Common Pitfalls section of the How to install Django on Windows
docs.

This should then pass. We don't support running with a non-utf-8 enconding.

I'm going to close this, assuming that setting the env var resolves your issue.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants