#12256: TypeError when calling unicode(type(Form()))
---------------------------------+------------------------------------------
Reporter: sethrh | Owner: nobody
Status: new | Milestone:
Component: Forms | Version: 1.1
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
Comment (by sethrh):
Replying to [comment:3 Alex]:
> This must be a bug in certain versions of python because your code
snippet runs fine for me:
> {{{
> >>> class X(object):
> ... def __init__(self, x):
> ... self.x = x
> ... def __unicode__(self):
> ... return unicode(self.x)
> ...
> ...
>
> >>> x = X(5)
>
> >>> unicode(x)
> [3] u'5'
>
> >>> unicode(type(x))
> [4] u"<class '__main__.X'>"
> }}}
>
> What version of CPython are you guys on?
I tried reproducing on Python 2.6.2 (r262:71600 Apr 16 2009 / Mac OS X
10.4). Neither mine nor kmtracey's example cause issues there. Python
2.5.1 (r251:54863 Apr 18 2007 / XP Pro) gets exceptions with both cases.
(Wow! Looks like python 2.5.1 is getting pretty old!)
--
Ticket URL: <http://code.djangoproject.com/ticket/12256#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=.