0

PSS/E Rev 33 - psspy.py UnicodeWarning

I have been testing out some of my code in PSS/E 33 and am getting the following error:

C:\Progra~2\PTI\PSSE33\PSSBIN\psspy.py:16893: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal

It is cluttering up my output and I am not sure what is causing it. There is A LOT of code in my program, so I haven't been able to pinpoint what commands are causing it to produce this error. Also, I do not get this error when I run the same program in PSS/E 32. Any thoughts?

EBahr's avatar
420
EBahr
asked 2013-09-17 18:34:24 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

You can run your program and cause warning to be raised as exceptions by doing the following:

python -W error program.py

alternately, put this at the top of your code:

import warnings    
warnings.simplefilter("error")

That way a nice stack trace is generated and you can see which call(s) are causing the problem.

Refer to the warnings documentation for more details, including how your could just suppress printing the warnings if you find that's the best way to resolve your problem.

jsexauer's avatar
586
jsexauer
answered 2013-09-18 07:29:38 -0500, updated 2013-09-18 07:33:16 -0500
edit flag offensive 0 remove flag delete link

Comments

Looks like it is throwing the warning every time I am using a string retrieved from a `wx.TextCtrl` box. I wonder if it doesn't like my version of `wx` (I believe it is the unicode version). `warnings.simplefilter("ignore")` did the trick though.

EBahr's avatar EBahr (2013-09-18 08:25:16 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer