← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #272186]: double backslashes in printed strings --- is by convention (a \ must be escaped with a \ )

 

Question #272186 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/272186

    Status: Answered => Open

furni is still having a problem:
I upgraded to final version! but still get errors. ...

########

data = u"C:\Users\aaaaa\Desktop\依頼文\sikuli_funcあ.txt"
dir = os.path.dirname(data)
uprint("*** content of " + dir)
for fname in os.listdir(dir):
  uprint(fname)
uprint("*** content of " + data)
ftxt = open(data)
for line in ftxt.readlines():
  uprint(line.strip())

########

and print out


[error] script [ FIRST ]] stopped with error at line --unknown--
[error] Could not evaluate error source nor reason. Analyze StackTrace!
[error] java.lang.IllegalArgumentException: Cannot create PyString with non-byte value 
at org.python.core.PyString.<init>(PyString.java:64) 
at org.python.core.PyString.<init>(PyString.java:70) 
at org.python.core.Py.UnicodeDecodeError(Py.java:357) 
at org.python.core.codecs.decoding_error(codecs.java:1601) 
at org.python.core.codecs.insertReplacementAndGetResume(codecs.java:1573) 
at org.python.core.PyString.hexescape(PyString.java:537) 
at org.python.core.PyString.decode_UnicodeEscape(PyString.java:465) 
at org.python.antlr.GrammarActions.extractString(GrammarActions.java:535) 
at org.python.antlr.GrammarActions.extractStrings(GrammarActions.java:468) 
at org.python.antlr.PythonParser.atom(PythonParser.java:10996) 
at org.python.antlr.PythonParser.power(PythonParser.java:10363) 
at org.python.antlr.PythonParser.factor(PythonParser.java:10290) 


at org.python.antlr.PythonParser.term(PythonParser.java:9855) 
at org.python.antlr.PythonParser.arith_expr(PythonParser.java:9581) 
at org.python.antlr.PythonParser.shift_expr(PythonParser.java:9308) 
at org.python.antlr.PythonParser.and_expr(PythonParser.java:9141) 
at org.python.antlr.PythonParser.xor_expr(PythonParser.java:8978) 
at org.python.antlr.PythonParser.expr(PythonParser.java:8814) 
at org.python.antlr.PythonParser.comparison(PythonParser.java:8360) 
at org.python.antlr.PythonParser.not_test(PythonParser.java:8287) 
at org.python.antlr.PythonParser.and_test(PythonParser.java:8073) 
at org.python.antlr.PythonParser.or_test(PythonParser.java:7911) 
at org.python.antlr.PythonParser.test(PythonParser.java:7771) 
at org.python.antlr.PythonParser.testlist(PythonParser.java:12705) 
at org.python.antlr.PythonParser.expr_stmt(PythonParser.java:3021) 
at org.python.antlr.PythonParser.small_stmt(PythonParser.java:2675) 
at org.python.antlr.PythonParser.simple_stmt(PythonParser.jav

a:2524) 
at org.python.antlr.PythonParser.stmt(PythonParser.java:2438) 
at org.python.antlr.PythonParser.file_input(PythonParser.java:618) 
at org.python.antlr.BaseParser.parseModule(BaseParser.java:78) 
at org.python.core.CompileMode$3.dispatch(CompileMode.java:22) 
at org.python.core.ParserFacade.parse(ParserFacade.java:158) 
at org.python.core.ParserFacade.parse(ParserFacade.java:188) 
at org.python.core.Py.compile_flags(Py.java:1956) 
at org.python.core.__builtin__.execfile_flags(__builtin__.java:527) 
at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:286) 
at org.sikuli.scriptrunner.JythonScriptRunner.runPython(JythonScriptRunner.java:208) 
at org.sikuli.scriptrunner.JythonScriptRunner.runScript(JythonScriptRunner.java:176) 
at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:2369) 

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException:
Cannot create PyString with non-byte value

##########

awwww

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.