[Django] #11443: smart_str can't encode a unicde string

0 views
Skip to first unread message

Django

unread,
Jul 9, 2009, 4:58:32 AM7/9/09
to djang...@holovaty.com, django-...@googlegroups.com
#11443: smart_str can't encode a unicde string
----------------------------------+-----------------------------------------
Reporter: sp...@paulisageek.com | Owner: nobody
Status: new | Milestone:
Component: Uncategorized | Version: 1.0
Keywords: | Stage: Unreviewed
Has_patch: 0 |
----------------------------------+-----------------------------------------
I'm getting

encode() takes at most 2 arguments (3 given)

From line 95 of django/utils/encoding.py :

elif isinstance(s, unicode):
return s.encode(encoding, errors)

I think it should be

elif isinstance(s, unicode):
return s.encode(encoding)

I'm on python 2.5

--
Ticket URL: <http://code.djangoproject.com/ticket/11443>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 9, 2009, 7:09:54 AM7/9/09
to djang...@holovaty.com, django-...@googlegroups.com
#11443: smart_str can't encode a unicde string
-------------------------------------------+--------------------------------
Reporter: sp...@paulisageek.com | Owner: nobody
Status: closed | Milestone:
Component: Uncategorized | Version: 1.0
Resolution: worksforme | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by dc):

* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0

Comment:

Cannot reproduce this bug:
{{{
>>> from django.utils.encoding import smart_str
>>> smart_str(u'iñtërnâtiônàlizætiøn')
'i\xc3\x83\xc2\xb1t\xc3\x83\xc2\xabrn\xc3\x83\xc2\xa2ti\xc3\x83\xc2\xb4n\xc3\x83\xc2\xa0liz\xc3\x83\xc2\xa6ti\xc3\x83\xc2\xb8n'
}}}

--
Ticket URL: <http://code.djangoproject.com/ticket/11443#comment:1>
Reply all
Reply to author
Forward
0 new messages