Issue1458

classification
Title: no codec search functions registered: can't find encoding 'utf-8'
Type: crash Severity: critical
Components: Core Versions: 2.5.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bioform, cgroves
Priority: Keywords:

Created on 2009-09-04.13:24:07 by bioform, last changed 2009-09-11.06:56:16 by cgroves.

Messages
msg5100 (view) Author: bioform (bioform) Date: 2009-09-04.13:24:06
When I try to use Jython 2.5.1rc1 with Java scripting I get following error:

Exception in thread "main" javax.script.ScriptException: LookupError: no
codec search functions registered: can't find encoding 'utf-8'
	at
org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:187)
	at org.python.jsr223.PyScriptEngine.compileScript(PyScriptEngine.java:76)
	at org.python.jsr223.PyScriptEngine.compile(PyScriptEngine.java:60)
	at
com.symantec.cas.ucf.scriptengines.RubyScriptProcessor.main(RubyScriptProcessor.java:52)
Caused by: LookupError: no codec search functions registered: can't find
encoding 'utf-8'

	at org.python.core.PyException.fillInStackTrace(PyException.java:70)
	at java.lang.Throwable.<init>(Throwable.java:181)
	at java.lang.Exception.<init>(Exception.java:29)
	at java.lang.RuntimeException.<init>(RuntimeException.java:32)
	at org.python.core.PyException.<init>(PyException.java:46)
	at org.python.core.PyException.<init>(PyException.java:43)
	at org.python.core.PyException.<init>(PyException.java:61)
	at org.python.core.codecs.lookup(codecs.java:80)
	at org.python.core.codecs.getEncoder(codecs.java:209)
	at org.python.core.codecs.encode(codecs.java:187)
	at org.python.core.PyString.str_encode(PyString.java:2429)
	at org.python.core.PyString.encode(PyString.java:2420)
	at org.python.antlr.GrammarActions.extractString(GrammarActions.java:438)
	at org.python.antlr.GrammarActions.extractStrings(GrammarActions.java:394)
	at org.python.antlr.PythonParser.atom(PythonParser.java:11335)
	at org.python.antlr.PythonParser.power(PythonParser.java:10444)
	at org.python.antlr.PythonParser.factor(PythonParser.java:10371)
	at org.python.antlr.PythonParser.term(PythonParser.java:9939)
	at org.python.antlr.PythonParser.arith_expr(PythonParser.java:9669)
	at org.python.antlr.PythonParser.shift_expr(PythonParser.java:9400)
	at org.python.antlr.PythonParser.and_expr(PythonParser.java:9233)
	at org.python.antlr.PythonParser.xor_expr(PythonParser.java:9070)
	at org.python.antlr.PythonParser.expr(PythonParser.java:8906)
	at org.python.antlr.PythonParser.comparison(PythonParser.java:8474)
	at org.python.antlr.PythonParser.not_test(PythonParser.java:8410)
	at org.python.antlr.PythonParser.and_test(PythonParser.java:8187)
	at org.python.antlr.PythonParser.or_test(PythonParser.java:8025)
	at org.python.antlr.PythonParser.test(PythonParser.java:7871)
	at org.python.antlr.PythonParser.printlist(PythonParser.java:3803)
	at org.python.antlr.PythonParser.print_stmt(PythonParser.java:3556)
	at org.python.antlr.PythonParser.small_stmt(PythonParser.java:2633)
	at org.python.antlr.PythonParser.simple_stmt(PythonParser.java:2468)
	at org.python.antlr.PythonParser.stmt(PythonParser.java:2382)
	at org.python.antlr.PythonParser.file_input(PythonParser.java:630)
	at org.python.antlr.BaseParser.parseModule(BaseParser.java:107)
	at org.python.core.CompileMode$3.dispatch(CompileMode.java:22)
	at org.python.core.ParserFacade.parse(ParserFacade.java:156)
	at
org.python.core.ParserFacade.parseExpressionOrModule(ParserFacade.java:130)
	at org.python.util.PythonInterpreter.compile(PythonInterpreter.java:221)
	at org.python.util.PythonInterpreter.compile(PythonInterpreter.java:218)

/-------------------------------------------------------/
Additional information:
Script engine: org.python.jsr223.PyScriptEngine@b2c6a6
Script engine name: jython
Script version: 2.5.1
/--------------------------------------------------------/
Java code:
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("python");
ScriptContext context = engine.getContext();
context.setAttribute("passed_in", "World", ScriptContext.ENGINE_SCOPE);
Compilable compiledEng=(Compilable) engine;
CompiledScript script= compiledEng.compile("print 'mmm'\n\"Hello %s\" %
passed_in");
result = script.eval();
System.out.println(result);
msg5133 (view) Author: Charlie Groves (cgroves) Date: 2009-09-11.06:56:15
Should be fixed in r6785.  Thanks for the report!
History
Date User Action Args
2009-09-11 06:56:16cgrovessetstatus: open -> closed
resolution: fixed
messages: + msg5133
nosy: + cgroves
2009-09-04 13:24:07bioformcreate