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

test/spec_tests.py not working #344

Closed
XAMPPRocky opened this issue Jul 3, 2015 · 4 comments
Closed

test/spec_tests.py not working #344

XAMPPRocky opened this issue Jul 3, 2015 · 4 comments

Comments

@XAMPPRocky
Copy link

When python test/spec_tests.py --dump-tests is run the following error appears.

Traceback (most recent call last):
  File "test/spec_tests.py", line 127, in <module>
    print(json.dumps(tests, ensure_ascii=False, indent=2))
  File "C:\Python34\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 100: character maps to <undefined> 

Python version: 3.4.3

@jgm
Copy link
Member

jgm commented Jul 3, 2015

I'm unable to reproduce this. Python 3.4.3, OSX 10.9.5;
LANG=en_US.UTF-8. I also tried it on Ubuntu. More information on your
environment? What is your locale?

+++ Aaron Power [Jul 03 15 07:58 ]:

When python test/spec_tests.py --dump-tests is run the following error
appears.
Traceback (most recent call last):
File "test/spec_tests.py", line 127, in
print(json.dumps(tests, ensure_ascii=False, indent=2))
File "C:\Python34\lib\encodings\cp437.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position
100: character maps to

Python version: 3.4.3


Reply to this email directly or [1]view it on GitHub.

References

  1. test/spec_tests.py not working #344

@XAMPPRocky
Copy link
Author

Oh sorry, I forgot to mention this is on windows 7.

@jgm
Copy link
Member

jgm commented Jul 3, 2015

Unfortunately, I don't know enough about character encoding
on Windows to help with this. Maybe someone else can?

+++ Aaron Power [Jul 03 15 10:45 ]:

Oh sorry, I forgot to mention this is on windows 7.


Reply to this email directly or [1]view it on GitHub.

References

  1. test/spec_tests.py not working #344 (comment)

@jgm jgm closed this as completed in 7379211 Jul 4, 2015
@jgm
Copy link
Member

jgm commented Jul 4, 2015

I think this change should fix your problem; it forces the output to be UTF-8 (which is desirable; we don't want the contents of the dumped json to vary depending on the platform you used to produce it).
Let me know if you still have the problem.

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

No branches or pull requests

2 participants