Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: UnicodeDecodeError getting revision log with Python

subversion
Discussion topic

Back to topic list

Re: UnicodeDecodeError getting revision log with Python

Author David James <james82 at gmail dot com>
Full name David James <james82 at gmail dot com>
Date 2009-05-28 15:58:49 PDT
Message On Thu, May 28, 2009 at 10:47 AM, Jack Bates <ms419 at freezone dot co dot uk> wrote:
>> Jack Bates wrote:
>> > A script we use for XMPP commit notification occasionally complains,
>> >
>> > [...]
>> > exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
>> > position 21: ordinal not in range(128)
>>
>> Google(python UnicodeDecodeError ordinal) returns
>> <http://www.xinotes.o​rg/notes/note/391/​>. Does that help?
>
> Thanks Julian, if I understand correctly, svn.fs.revision_prop() returns
> a bytestring and I need to know the encoding of the bytestring to decode
> it to a unicode object?

Yes, that's right. A good guess would be to check if the log message
is UTF-8. Subversion standardizes on UTF-8 internally, but I don't
think we verify that log messages are UTF-8 -- I think that users can
encode their log messages using any encoding they want.

> Is there something in the Subversion Python bindings to return a decoded
> unicode object instead of a bytestring?

No, I don't think so.

Cheers,

David

« Previous message in topic | 5 of 8 | Next message in topic »

Messages

Show all messages in topic

UnicodeDecodeError getting revision log with Python jablko Jack Bates 2009-05-26 16:28:48 PDT
     Re: UnicodeDecodeError getting revision log with Python julianfoad Julian Foad 2009-05-27 03:44:14 PDT
     Re: UnicodeDecodeError getting revision log with Python jablko Jack Bates 2009-05-28 14:34:19 PDT
         Re: UnicodeDecodeError getting revision log with Python julianfoad Julian Foad 2009-05-28 15:17:00 PDT
         Re: UnicodeDecodeError getting revision log with Python David James <james82 at gmail dot com> David James <james82 at gmail dot com> 2009-05-28 15:58:49 PDT
             Re: UnicodeDecodeError getting revision log with Python Daniel Shahaf <d dot s at daniel dot shahaf dot name> Daniel Shahaf <d dot s at daniel dot shahaf dot name> 2009-05-28 22:11:18 PDT
     Re: UnicodeDecodeError getting revision log with Python jablko Jack Bates 2009-06-01 09:44:44 PDT
         Re: UnicodeDecodeError getting revision log with Python cmpilato C. Michael Pilato 2009-06-01 10:01:10 PDT
Messages per page: