[BUG] plugin 'version-info' prints out summary information for a branch
Alexander Belchenko
bialix at ukr.net
Thu Dec 29 06:42:13 GMT 2005
John Arbash Meinel пишет:
> So I created a plugin, which can be found at:
> http://bzr.arbash-meinel.com/plugins/version_info/
>
> This adds a new command 'bzr version-info' which can generate either rio
> style information, or python text which contains a dictionary of
> information.
I try this plugin and have persistent error when running inside any
branch (with command `bzr version-info`).
bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode
byte 0xc3 in position 56: ordinal not in range(128)
at C:\Python24\lib\codecs.py line 186
in writelines
When I run command in debugger I see that in method rio.py:
Stanza.to_lines() when you go:
for tag, value in self.items:
then when tag is 'date' then value on my russian win32 is
'2005-12-29 08:14:33 (Thursday, December 29, 2005,
\xc3\xf0\xe5\xf6\xe8\xff, \xd2\xf3\xf0\xf6\xe8\xff (\xe7\xe8\xec\xe0))'
or in string form is:
2005-12-29 08:14:33 (Thursday, December 29, 2005, Греция, Турция (зима))
that equivalent to english form:
2005-12-29 08:14:33 (Thursday, December 29, 2005, Greece, Turkey (winter))
I.e. obtained long date form contain description of current time zone in
default (russian) language.
I think simple fix for this is decoding flat string with
bzrlib.user_encoding.
When I run with flag --format=python I don't have any encodings errors
but output looks like a mix of flat strings and unicode strings:
version_info ={'branch_nick':
u'E:\\work\\Python\\bzr\\plugins\\zip-exporter',
'clean': None,
'date': '2005-12-29 08:31:45 (Thursday, December 29, 2005,
\xc3\xf0\xe5\xf6\xe8\xff, \xd2\xf3\xf0\xf6\xe8\xff (\xe7\xe8\xec\xe0))',
'revision_id': u'bialix at ukr.net-20051114211523-e15049ea116cc221',
'revisions': None,
'revno': 9}
I think it's not good because information of string encoding is lost.
--
Alexander
More information about the bazaar
mailing list