ASCII encoding error: ordinal not in range(128)

Jose Isaias Cabrera jicman at cinops.xerox.com
Tue Mar 20 16:28:03 EST 2001


Greetings all!

I have a python program that interfaces with Microsoft Outlook.  I am running into a problem when I have attachments and subject
titles with different characters that are not your normal everyday character.  For example:  The program is giving me a Traceback
because of the following attachment:

"Desenbanco_customização docushare.doc"

Here is the Trackback...

C:\>qna0.py
Traceback (most recent call last):
  File "C:\myprograms\qna0.py", line 1570, in ?
    main()
  File "C:\myprograms\qna0.py", line 1556, in main
    ProcessAllItems(wf2,workpath,workpath,NSpace)
  File "C:\myprograms\qna0.py", line 1484, in ProcessAllItems
    FindIfAttachments(em,Rec['SPAR'],wID,fam)
  File "C:\myprograms\qna0.py", line 1156, in FindIfAttachments
    name = code.encode()
UnicodeError: ASCII encoding error: ordinal not in range(128)

I've search on python sites for this, and though there is something about Unicode, there is no python example code to use.

Does anyone have any idea how to fix this?

Thanks for your help.

josé

>





More information about the Python-list mailing list