First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

PSS/E Rev 33 - psspy.py UnicodeWarning

asked Sep 18 '13

EBahr gravatar image

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?

1 answer

Sort by » oldest newest most voted
1

answered Sep 18 '13

jsexauer gravatar image

updated Sep 18 '13

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.

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 gravatar imageEBahr (Sep 18 '13)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Sep 18 '13

Seen: 924 times

Last updated: Sep 18 '13