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 failures with Jython #46

Closed
Arfrever opened this issue Aug 8, 2013 · 1 comment
Closed

Test failures with Jython #46

Arfrever opened this issue Aug 8, 2013 · 1 comment

Comments

@Arfrever
Copy link

Arfrever commented Aug 8, 2013

Jython does not support "utf_8" encoding in header comment in source code, but supports "utf-8":

$ python2.7 -c 'eval("# coding=utf-8\nNone")'
$ jython2.7 -c 'eval("# coding=utf-8\nNone")
$ python2.7 -c 'eval("# coding=utf_8\nNone")'
$ jython2.7 -c 'eval("# coding=utf_8\nNone")'
  File "<string>", line 1
SyntaxError: Unknown encoding: utf_8

This patch fixes Jython-specific test failures:

--- babel/util.py
+++ babel/util.py
@@ -80,7 +80,7 @@
                 raise SyntaxError(
                     "python refuses to compile code with both a UTF8 "
                     "byte-order-mark and a magic encoding comment")
-            return 'utf_8'
+            return 'utf-8'
         elif m:
             return m.group(1).decode('latin-1')
         else:
@mgax mgax closed this as completed in 2af2c17 Jan 6, 2014
@mgax
Copy link
Contributor

mgax commented Jan 6, 2014

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
Development

No branches or pull requests

2 participants