[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Bug in svnmerge.py, rev 30107 (not fully compatible with Python 2.2.x)

From: Blair Zajac <blair_at_orcaware.com>
Date: Fri, 28 Mar 2008 16:27:36 -0700

Hi Justin,

svnmerge has it's own mailing list that you can send this report to:

http://www.orcaware.com/mailman/listinfo/svnmerge

It'll probably get more visibility there.

Regards,
Blair

Justin Akehurst wrote:
> Traceback I received:
> Traceback (most recent call last):
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 2160, in ?
> main(sys.argv[1:])
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 2155, in main
> cmd(branch_dir, branch_props)
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 1642, in
> __call__
> return self.func(*args, **kwargs)
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 1391, in
> action_merge
> print >>f, construct_merged_log_message(opts["source-url"], revs),
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 964, in
> construct_merged_log_message
> message = get_commit_log(url, r)
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 950, in
> get_commit_log
> return recode_stdout_to_file("".join(out[1:]))
> File "/ifs/home/jakehurst/workspace/tools/svnmerge.py", line 220, in
> recode_stdout_to_file
> if locale.getdefaultlocale()[1] is None or sys.stdout.encoding is None:
> AttributeError: 'file' object has no attribute 'encoding'
>
> The problem: sys.stdout (file object) under Python 2.2.2 does not have the
> 'encoding' attribute.
>
> My workaround:
> @@ -217,7 +217,7 @@
> return prefix + lines[:-1].replace("\n", "\n"+prefix) + "\n"
>
> def recode_stdout_to_file(s):
> - if locale.getdefaultlocale()[1] is None or sys.stdout.encoding is None:
> + if locale.getdefaultlocale()[1] is None or not
> sys.stdout.has_attr('encoding') or sys.stdout.encoding is None:
> return s
> u = s.decode(sys.stdout.encoding)
> return u.encode(locale.getdefaultlocale()[1])
>
> Is this a real bug? I think it is.
>
> -Justin Akehurst
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-29 00:27:54 CET

This is an archived mail posted to the Subversion Dev mailing list.