Installation & Licensing
Welcome to Autodesk’s Installation and Licensing Forums. Share your knowledge, ask questions, and explore popular Download, Installation, and Licensing topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maya 2013 utils.py encoding error (need help)

0 REPLIES 0
Reply
Message 1 of 1
ertyghjkvbn145
929 Views, 0 Replies

Maya 2013 utils.py encoding error (need help)

Hello! I use Maya 2013 x64 and when running Python scripts, see the message of an error in the file named  utils.py-

# Error: line 1: Error in maya.utils._guiExceptHook:
# File "C:\Program Files\Autodesk\Maya2013\Python\lib\site-packages\maya\utils.py", line 296, in formatGuiException
# result = u'%s: file %s line %s: %s' % (exceptionType.__name__, file, line, exceptionMsg)
# UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 9: ordinal not in range(128)

 

I googled for this error and learned it happens often in non-English Windows (I use cyrillic version of Windows). Some people adviced me to change by force the encoding of the file utils.py to ASCII. What text editor has this option? I tried to use Notepad ++ - there is options for UTF-8 but not for ASCII.

Or may it be the problem is in non-Latin Windows? I found a similar problem here - http://stackoverflow.com/questions/16029285/change-non-english-os-to-only-output-english-in-python

That user used Korean Windows and he got the advice -

You might want to try using sys.setdefaultencoding. To use it, you'll probably have to put a call to it in your site.py or sitecustomize.py files, because as the documentation states:
Once used by the site module, it is removed from the sys module’s namespace.
I'd first try utf-8, since C1 is a valid UTF-8 start byte and UTF-8 would make sense. If that doesn't work, then I think there's a few Korean-specific encodings, but unfortunately, I don't know much about them. If UTF-8 doesn't work, this list of encodings supported by Python suggests that you may want to try euc_kr, iso2022_kr, cp949, johab, or iso2022_jp_2.

 


What must I do under cyrillic (Russian) Windows? How to use sys.setdefaultencoding? What must I write in the files site.py or sitecustomize.py (I did not find them yet in Maya folder, where to look for them? ). Which encoding do I need for cyrillic Windows 7 x64?

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Administrator Productivity


Autodesk Design & Make Report