Re: Unicode Decode Error

Harry Zink <[email protected]>
Newsgroups gmane.mail.spam.tmda.user
Message-ID <[email protected]>
It would be wonderful if someone has a solution (i.e. a fix) to this  
unicode problem... This is becoming particularly critical as more and  
more spam is coming from China, Japan and other parts of South Asia.

I too am running tmda.cgi 0.13, so does anyone know if a more recent,  
or CVS version, addresses this issue, finally (It appears by checking  
on mailing lists, that this issue has been around for at least 3-4  
years, without a resolution).

Any ideas?

Harry

On Sep 4, 2007, at 10:21 PM, Andreas Plachy wrote:

> Hi all!
>
> We got often problems with spammails, which have special characters in
> the header.
> The tmda-cgi is still unaseable, till I delete the pending file or
> remove the specials chars in it.
>
> What we have to change to bypass this unicode error?
>
> In this expamle the "From"-field looks like this: "From: Viagra.com  
> Inc
> ® <[email protected]>"
>
> Hope someone needs an answer...
>
> so long,
> Andreas
>
>
>
>
> UnicodeDecodeError Python 2.3.4: /usr/bin/python
> Wed Sep 5 07:17:50 2007
>
> A problem occurred in a Python script. Here is the sequence of  
> function
> calls leading up to the error, in the order they occurred.
>
>  /usr/src/tmda-cgi-0.13/tmda-cgi.py
>   188   elif Cmd == "pending":
>
>   189     import PendList
>
>   190     Call(PendList)
>
>   191   elif Cmd == "restore":
>
>   192     pass
>
> Call = <function Call>, PendList = <module 'PendList' from
> '/usr/src/tmda-cgi-0.13/PendList.pyc'>
>
>
>  /usr/src/tmda-cgi-0.13/tmda-cgi.py in Call(Library=<module 'PendList'
> from '/usr/src/tmda-cgi-0.13/PendList.pyc'>, Str=None)
>    86     Library.Show(Str)
>
>    87   else:
>
>    88     Library.Show()
>
>    89
>
>    90 # Capture WebUID
>
> Library = <module 'PendList' from
> '/usr/src/tmda-cgi-0.13/PendList.pyc'>, Library.Show = <function Show>
>
>
>  /usr/src/tmda-cgi-0.13/PendList.py in Show()
>   498               value += Unicode.TranslateToUTF8(CharSet,
> decoded[0], "ignore")
>
>   499           else:
>
>   500             value += Unicode.TranslateToUTF8(CharSet, decoded 
> [0],
> "ignore")
>
>   501         From = value
>
>   502         Temp = Address.search(From)
>
> value = '', global Unicode = <module 'Unicode' from
> '/usr/src/tmda-cgi-0.13/Unicode.pyc'>, Unicode.TranslateToUTF8 =
> <function TranslateToUTF8>, CharSet = 'us-ascii"', decoded =
> ('Viagra.com Inc \xae <[email protected]>', None)
>
>
>  /usr/src/tmda-cgi-0.13/Unicode.py in
> TranslateToUTF8(CharSet='us-ascii"', Str='Viagra.com Inc \xae
> <[email protected]>', Errors='ignore')
>   113     Uni = Decoder(Str, errors = Errors)[0]
>
>   114   except:
>
>   115     Uni = Decoder(Str)[0]
>
>   116
>
>   117   # Encode for UTF-8
>
> Uni undefined, Decoder = <built-in function ascii_decode>, Str =
> 'Viagra.com Inc \xae <[email protected]>'
>
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in  
> position 15:
> ordinal not in range(128)
>       args = ('ascii', 'Viagra.com Inc \xae <[email protected]>', 15, 16,
> 'ordinal not in range(128)')
>       encoding = 'ascii'
>       end = 16
>       object = 'Viagra.com Inc \xae <[email protected]>'
>       reason = 'ordinal not in range(128)'
>       start = 15
>
> _____________________________________________
> tmda-users mailing list ([email protected])
> http://tmda.net/lists/listinfo/tmda-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.