Message13026

Author Rodriguez
Recipients Rodriguez
Date 2020-04-20.02:40:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587350452.77.0.278220043344.issue2874@roundup.psfhosted.org>
In-reply-to
Content
Hi,

We're trying to debug an issue with Jython 2.7 in z/OS. 
To recreate, we use 2 files
test.py file has:
======
import sys

sys.setdefaultencoding('ascii')

import test2
======


The test2.py file has:
========
import sys

sys.setdefaultencoding('ascii')

print "I am test2 file"
=======

When executing test.py, we get the following error:

com.ibm.bsf.BSFException: exception from Jython:
Traceback (most recent call last):
File "<string>", line 1, in <module>
SyntaxError: Non-ASCII character in file '/local/bvt/bvt_was/test2.py',
but no encoding declared; see http://www.python.org/peps/pep-0263.html

We've tried executing with "script.encoding=Cp1047" added but that still fails with the above exception. For what it's worth, it seems to work when we use Jython 2.1. Is there we're missing on this? Or is this a bug (or change of behavior) with how encoding works in version 2.7?

Thanks!
History
Date User Action Args
2020-04-20 02:40:52Rodriguezsetrecipients: + Rodriguez
2020-04-20 02:40:52Rodriguezsetmessageid: <1587350452.77.0.278220043344.issue2874@roundup.psfhosted.org>
2020-04-20 02:40:52Rodriguezlinkissue2874 messages
2020-04-20 02:40:52Rodriguezcreate