0

I'm trying to write a python script under z/OS, using IBM Open Enterprise SDK for Python 3.13.

I wrote the code under TSO OMVS and I got the following error trying to execute the code:

SyntaxError: Non-UTF-8 code starting with 'çx97' in file /u/u0n6758/prova5.py on line 1, but no encoding declared; see peps.python.org/pep-0263/ for details

In the text there some # and {}.

If I change the # in £ and delete the {} the code is working. The problem is that I need the {} (I have to deal with json).

I would not like to change all the special character on my script (the script was written on a Linux machine and there is working properly - I need to have it on USS now).

I've tried to put in the second line the enconding statement, using both IBM1047 than UTF-8 ma it didn't work. I'm not sure about the encoding statement syntax on z/OS. I've used £-- coding: IBM1047 --

Can anybody help me please? thanks Fabiana Can anyone please me help me? where can I find documentation about syntax python under z/OS?

Thanks everybody, have a nice day, Fabiana

6
  • The error reported relates to the Python script (prova5.py). You may need to provide an (en)coding hint as described here. Commented Jun 19 at 10:38
  • 1
    always put full error message because there are other useful information. Commented Jun 19 at 12:09
  • 1
    maybe show what you have in file instead of describing it. Commented Jun 19 at 12:10
  • The error is the one in the bold characters, it's all the error. Commented Jun 19 at 13:51
  • The script is very very simple, I'm just checking how to run python programs for the moment. It's # programma di prova a={'key': 'prova'} print('a=' + str(a)) Commented Jun 19 at 13:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.