No, I don't know what encoding is using?
How I can know that?
Right now the only way to avoid this error is assign err to a local variable
before and use "decode"
class DBQueryException(DatabaseException):
def __init__(self, err, sql):
self.sql = sql.lower()
errMsg= str(err)
self.err_desc =errMsg.decode('utf-8','ignore')
def __str__(self):
return self.err_desc + '\nSQL: ' + self.sql
with this code I can get the error msg in the app instead python launch a
exception :D
best regards.
On 5/23/08, Ed Leafe <[EMAIL PROTECTED]> wrote:
>
> On May 23, 2008, at 3:55 PM, Jorge Mota wrote:
>
> > How Python interprets this concatenation if self_error is enconded
> > with
> > something different of self.sql?
>
>
>
> Python is supposed to convert everything to unicode. So "ascii" +
> "uni" should yield unicode.
>
>
> > self.err_desc + '\nSQL: ' + self.sql
> >
> > If I do
> >
> > print 'err_desc:',self.err_desc
> >
> > print 'Sql:',self.sql
> >
> > there is no problem, but
> >
> > print self.err_desc + u'\nSQL: ' + self.sql alert in same way about
> > coding...
>
>
> I know that you are getting non-ASCII error messages, but what are
> they? Do you know what encoding they are in? Maybe this is a problem
> of conflicting encodings?
>
>
> -- Ed Leafe
>
>
>
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]