forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

python does not show any error

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
cdan



Joined: 21 Jun 2016
Posts: 3

PostPosted: Tue Jun 21, 2016 11:38 am    Post subject: python does not show any error Reply with quote

python scripts are working BUT I have 2 strange symptoms:
- no version header when I enter python, I just have the prompt:
$>python
>>> exit()
-no error at all when I do some syntax mistake, script or command just does not work and gives me back the prompt. Does not matter if I enter command at the prompt >>> or if I run a script as parameter, like $ python myscript.py

So python is working but my scripting has to be perfect Smile which is not easy for a python newbie.

I used LD images JFPLIB0008A and JFPPY0700A on OpenVMS 7.3-2
No other errors during compilation except those 3 "bad syntax" mentioned already on this forum as ignorable.
_________________
CD
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Wed Jun 22, 2016 10:43 am    Post subject: Reply with quote

I don't have any Alpha anymore, but I agree the no version header problem is strange.

To check if your program has no syntax error, you can try pychecker
Code:

$ pychecker myscript.py


pychecker try to find also many common mistake, for example a typo error in a variable name.

I will take a look if it's the correct behavior or if python should return an error when there is a syntax error.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cdan



Joined: 21 Jun 2016
Posts: 3

PostPosted: Mon Jun 27, 2016 6:24 pm    Post subject: Reply with quote

Hello JFP, thanks for the reply. It looks like even pychecker is misbehaving for me.

$>type test.py
bad_command
print "its working"

$>python test.py
$>pychecker test.py

Warnings...

test:1: NOT PROCESSED UNABLE TO IMPORT

BUT if the bad_command is after the print, it's working!

I expected the pychecker will give me something similar to the same script on linux:
python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
bad_command
NameError: name 'bad_command' is not defined
_________________
CD
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 618

PostPosted: Wed Jun 29, 2016 8:19 am    Post subject: Reply with quote

Hi cdan,

be sure that your source file is streamlf

You can verify and eventually convert it using the 'pystmlf' command.

for example :
Code:
$ pystmlf -t file.py
$ pystmlf file.py


The first just check is the file is stmlf the second do the convert.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cdan



Joined: 21 Jun 2016
Posts: 3

PostPosted: Mon Aug 08, 2016 1:55 pm    Post subject: Reply with quote

Hello JFP,

I finally found out the "bug" in the security features of the system Smile The SYS$ERROR was redefined by default to a file instead of terminal, by a general login procedure (not sylogin).

Thanks for your help.
_________________
CD
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group