﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16261	Model.__repr__() should never return unicode	Luc Saffre	nobody	"Unlike stated in ticket #13831, 
and according to
[http://stackoverflow.com/questions/3627793/best-output-type-and-coding-practices-for-repr-functions this post on slashdot],
it seems that {{{__repr__()}}} should never return unicode in Python 2.

The current version does:

{{{
    def __repr__(self):
        try:
            u = unicode(self)
        except (UnicodeEncodeError, UnicodeDecodeError):
            u = '[Bad Unicode data]'
        return smart_str(u'<%s: %s>' % (self.__class__.__name__, u))

}}}

My suggestion would be to change this to:


{{{
    def __repr__(self):
        try:
            u = unicode(self)
        except (UnicodeEncodeError, UnicodeDecodeError):
            u = '[Bad Unicode data]'
        return '<%s: %r>' % (self.__class__.__name__, u)
}}}
"	Bug	closed	Core (Other)	1.3	Normal	worksforme			Unreviewed	0	0	0	0	0	0
