1 | >>> from django.contrib.auth.models import AnonymousUser
|
---|
2 | >>> from django.utils.encoding import smart_unicode,force_unicode
|
---|
3 | >>> a = AnonymousUser()
|
---|
4 | >>> # the same is for smart_unicode
|
---|
5 |
|
---|
6 | >>> force_unicode( a )
|
---|
7 | Traceback (most recent call last):
|
---|
8 | File "<input>", line 1, in <module>
|
---|
9 | File "C:\python251\lib\site-packages\django\utils\encoding.py", line 38, in force_unicode
|
---|
10 | s = unicode(s)
|
---|
11 | TypeError: coercing to Unicode: need string or buffer, __proxy__ found
|
---|
12 |
|
---|
13 | >>> force_unicode( a, strings_only=True )
|
---|
14 | Traceback (most recent call last):
|
---|
15 | File "<input>", line 1, in <module>
|
---|
16 | File "C:\python251\lib\site-packages\django\utils\encoding.py", line 38, in force_unicode
|
---|
17 | s = unicode(s)
|
---|
18 | TypeError: coercing to Unicode: need string or buffer, __proxy__ found
|
---|
19 |
|
---|