Ask Your Question
1

'charmap' codec can't decode byte 0x8f in position 2: character maps to <undefined>

asked Jul 24 '1

PythonGuy gravatar image

Hello All, I have been getting the below error when I tried to run the query that returns the branch name and not sure how to resolve the issue. Your help is much appreciated. Thanks in Advance!!

*

*>     ierr1, rval = psspy.brnnam(barray[0][j],jbus,ickt)  
> File ".\psspy.py", line 90052, in
> brnnam   File
> "C:\Python37\lib\encodings\cp1252.py",
> line 15, in decode
>         return codecs.charmap_decode(input,errors,decoding_table)
> UnicodeDecodeError: 'charmap' codec
> can't decode byte 0x8f in position 2:
> character maps to <undefined>*

*

2 answers

Sort by » oldest newest most voted
0

answered Jan 10 '4

KyleA gravatar image

After reaching out to Siemens about this, their answer was to upgrade to a newer version. In my case, I was using v34, and they recommended version 34.9.4 or later. After upgrading to v 34.9.6 the issue seems to have gone away.

link
-1

answered Aug 2 '1

jconto gravatar image

updated Aug 13 '1

It happen to me too. It works fine after adding the next command to the top of the python script:

# -*- coding: cp1252 -*-
link

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

1 follower

Stats

Asked: Jul 24 '1

Seen: 3,000 times

Last updated: Jan 10 '24