Issue1159156

classification
Title: codec.open() does not work with different systemstates
Type: Severity: normal
Components: Library Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, kersam
Priority: low Keywords:

Created on 2005-03-08.16:23:09 by kersam, last changed 2007-12-02.21:10:13 by cgroves.

Messages
msg965 (view) Author: kersam (kersam) Date: 2005-03-08.16:23:09
I have a Java -Applications that starts different Python-
Interpreters with different System-States:
PythonInterpreter pi = new PythonInterpreter(null, new 
PySystemState());
pi.exec("import codecs");
pi.exec("f = codecs.open(\"Test.java\",\"rb\", \"cp1252\")")
;
pi.exec("print f.readline()");
pi.cleanup();
pi = new PythonInterpreter(null, new PySystemState());
pi.exec("import codecs");
pi.exec("f = codecs.open(\"Test.java\",\"rb\", \"cp437\")");
pi.exec("print f.readline()");
pi.cleanup();

The second codec.open() fails with: LookupError: 
unknown encoding cp437
If you debug the application, you see that the application 
fails calling the PyFunction registered in org.python.core.
codecs. Is this because the function was registred with a 
different system state?
Are mutiple systeme states in the same application 
supported?
msg966 (view) Author: Charlie Groves (cgroves) Date: 2007-12-02.21:10:13
Multiple states are supported, and this appears to work on trunk so I'm closing it.
History
Date User Action Args
2005-03-08 16:23:09kersamcreate