On Fri, Jul 15, 2005 at 09:12:00AM +0200,
 Michal Sojka <[EMAIL PROTECTED]> wrote 
 a message of 43 lines which said:

> AttributeError: 'unicode' object has no attribute 'decode'
>       args = ("'unicode' object has no attribute 'decode'",)
> 
> It occurs at line 76 of darcsweb.cgi:
> 
>  /var/www/localhost/htdocs/darcs/darcsweb.cgi in fixu8
> (s=u'20050714170919-f2ef6-4a726324666839d75840810d3e3984e4580a89bb.gz')
>    74                 # small optimization to avoid the conversion to utf8 and
>    75                 # entering the loop
>    76                 return s.decode(config.repoencoding).encode('utf8')
>    77 
>    78         s = s.encode(config.repoencoding).decode('raw_unicode_escape')
> s = u'20050714170919-f2ef6-4a726324666839d75840810d3e3984e4580a89bb.gz', 
> s.decode undefined, global config = <class __main__.config>, 
> config.repoencoding = 'latin1', ).encode = <built-in method encode of str 
> object>

May be (untested):

Beginning:

import types

Line 76:

if isinstance(s, types.UnicodeType):
   return s.encode('utf8')
else:
   return s.decode(config.repoencoding).encode('utf8')

But this is just a workaround, not a real fix.

_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to