I am using Jython 2.5.0 on Windows XP.
I created a simple Java application which would invoke a Jython script (new PythonInterpreter.execFile(…)).
The initial script is simple:
print 'Hello World!'
response = SomejavaClass.someMethod(…)
print 'Response=' + response
So long as I define the VM argument python.home=<whatever> to my Jython invocation this works fine.
However, I don’t want to have to do that so I just included jython.jar in my application lib.
Then I get the error "no codec search functions registered" on the second print statement.
I included __init__.py, aliases.py and codecs.py in an encodings subdir and the error changed to LookupError: unknown encoding cp1252.
When I added cp1252.py to the encodings dir my program now worked.
It doesn’t seem right that I should have to be doing this.
What should be needed beyond jython.jar to run Jython scripts?
Confidentiality Notice! This electronic transmission and any attached documents or other writings are confidential and are for the sole use of the intended recipient(s) identified above. This message may contain information that is privileged, confidential or otherwise protected from disclosure under applicable law. If the receiver of this information is not the intended recipient, or the employee, or agent responsible for delivering the information to the intended recipient, you are hereby notified that any use, reading, dissemination, distribution, copying or storage of this information is strictly prohibited. If you have received this information in error, please notify the sender by return email and delete the electronic transmission, including all attachments from your system.