Issue2874

classification
Title: Jython 2.7 is not able to import an EBCDIC file on z/OS
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Rodriguez
Priority: Keywords:

Created on 2020-04-20.02:40:52 by Rodriguez, last changed 2020-04-20.02:41:56 by Rodriguez.

Messages
msg13026 (view) Author: Gil (Rodriguez) Date: 2020-04-20.02:40:52
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:41:56Rodriguezsettitle: Jython 2,7 is not able to import an EBCDIC file on z/OS -> Jython 2.7 is not able to import an EBCDIC file on z/OS
2020-04-20 02:41:50Rodriguezsettitle: EBCDIC endo -> Jython 2,7 is not able to import an EBCDIC file on z/OS
2020-04-20 02:40:52Rodriguezcreate