I've been told that I may have encountered a bug - I'm trying to
serialize a model that includes fields that could be unicode data.
Here is the information I collected. Let me know if there's anything
else that would be helpful.
Specs of the local dev workstation - having the same issues in prod
using Linux/FastCGI:
Windows XP Home Edition Version 2002 SP 2
Python 2.4.4
Latest Django from SVN: 0.97-pre-SVN-6024
SQLite3
Using internal django web server (for dev)
Here's the traceback:
Traceback (most recent call last):
File "C:\Python24\lib\site-packages\django\core\handlers\base.py" in
get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Documents and Settings\Gabe Harriman\My
Documents\dev\texty\cms\views.py" in syndicate
178. comments = serializers.serialize("json",
texty.comment_set.all(), fields=('name','comment','created_date',),
ensure_ascii=False)
File "C:\Python24\lib\site-packages\django\core\serializers
\__init__.py"
in serialize
67. s.serialize(queryset, **options)
File "C:\Python24\lib\site-packages\django\core\serializers\base.py"
in serialize
50. self.end_serialization()
File "C:\Python24\lib\site-packages\django\core\serializers\json.py"
in end_serialization
26. simplejson.dump(self.objects, self.stream,
cls=DjangoJSONEncoder, **self.options)
File "C:\Python24\lib\site-packages\django\utils\simplejson
\__init__.py" in dump
139. fp.write(chunk)
UnicodeEncodeError at /cms/syndicate/d5f8eba5-d4a8-4590-
a3d9-4d9e34503c5b.js
'ascii' codec can't encode characters in position 1-7: ordinal not
in range(128)
Unicode error hint:
The string that could not be encoded/decoded was: "ﺥﺾﻤﻼﺚﻴﻴ"
As you can see from above, the error starts here:
comments = serializers.serialize("json", texty.comment_set.all(),
fields=('name','comment','created_date',), ensure_ascii=False)
The data in the name field is "ﺥﺾﻤﻼﺚﻴﻴ". The rest is normal ascii
data.
Let me know if this looks like a bug or not. If not, I'll keep
hacking away on my end. Sorry if I left anything out - I'm new to
this whole unicode thing.
Thanks!
Gabe
On Aug 30, 2:12 pm, mynameisgabe <mynameisg...@gmail.com> wrote:
> Hello All-
>
> I've been told that I may have encountered abug- I'm trying to
> Unicodeerror hint:
> The string that could not be encoded/decoded was: "ﺥﺾﻤﻼﺚﻴﻴ"
>
> As you can see from above, the error starts here:
>
> comments = serializers.serialize("json", texty.comment_set.all(),
> fields=('name','comment','created_date',), ensure_ascii=False)
>
> The data in the name field is "ﺥﺾﻤﻼﺚﻴﻴ". The rest is normal ascii
> data.
>
> Let me know if this looks like abugor not. If not, I'll keep
Is this bug documented?
G
On Aug 30, 2:12 pm, mynameisgabe <mynameisg...@gmail.com> wrote:
> Hello All-
>
> I've been told that I may have encountered abug- I'm trying to
> Unicodeerror hint:
> The string that could not be encoded/decoded was: "ﺥﺾﻤﻼﺚﻴﻴ"
>
> As you can see from above, the error starts here:
>
> comments = serializers.serialize("json", texty.comment_set.all(),
> fields=('name','comment','created_date',), ensure_ascii=False)
>
> The data in the name field is "ﺥﺾﻤﻼﺚﻴﻴ". The rest is normal ascii
> data.
>
> Let me know if this looks like abugor not. If not, I'll keep