2810

Django Dumpdata Unable To Serialize Database

Hi, We are trying to migrate between databases and we are running into a problem while trying to use dumpdata. We've tried:./manage.py dumpdata --natural --indent 2 >dump.json and:./manage.py dumpdata --natural --format xml --indent 2 >dump.xml Both return the following error: Error: Unable to serialize database: 'ascii' codec can't encode character u' xe9' in position 18: ordinal not in range(128) Is there a way to dump and load non-ASCII data?

-- Eric Chamberlain, Founder RF.com - -- You received this message because you are subscribed to the Google Groups 'Django users' group. To post to this group, send email to. To unsubscribe from this group, send email to. For more options, visit this group. >Hi, >>We are trying to migrate between databases and we are running into a problem while trying to use dumpdata.

We've tried: >>./manage. Bmw Fsc Code Keygen Photoshop. py dumpdata --natural --indent 2 >dump.json >>and: >>./manage.py dumpdata --natural --format xml --indent 2 >dump.xml >>Both return the following error: >>Error: Unable to serialize database: 'ascii' codec can't encode character u' xe9' in position 18: ordinal not in range(128) >>Is there a way to dump and load non-ASCII data? >>>-- >Eric Chamberlain, Founder >RF.com - >>>>>>>-- You received this message because you are subscribed to the Google Groups 'Django users' group. To post to this group, send email to. To unsubscribe from this group, send email to.

Unable to serialize UUIDField when running dumpdata with. Unable to serialize database. Import uuid from django.contrib.auth.models import AbstractUser.

For more options, visit this group. >Or is there a better way to migrate a database from postgres to MySQL? >>On Jan 3, 2011, at 6:35 PM, Eric Chamberlain wrote: >>>>>>>>>Hi, >>>Dragon Ball Perfect Edition Finale Alternativo Mx. We are trying to migrate between databases and we are running into a problem while trying to use dumpdata.

We've tried: >>>./manage.py dumpdata --natural --indent 2 >dump.json >>>and: >>>./manage.py dumpdata --natural --format xml --indent 2 >dump.xml >>>Both return the following error: >>>Error: Unable to serialize database: 'ascii' codec can't encode character u' xe9' in position 18: ordinal not in range(128) >>>Is there a way to dump and load non-ASCII data? >>>-- >>Eric Chamberlain, Founder >>RF.com - -- You received this message because you are subscribed to the Google Groups 'Django users' group. To post to this group, send email to. To unsubscribe from this group, send email to. For more options, visit this group.

The answers you seek can be partially found by reading the ticket history. The ticket *was* DDN until it was marked 'Fixed on a branch' by an anonymous user (who also marked it for milestone 1.3). Since the anonymous person didn't give any explanation, you can probably assume that that update was spam. That means the ticket is waiting on a design decision. A patch has been provided; that patch isn't a diff against trunk, and it doesn't include tests. It also introduces a new management command, but includes no documentation for that management command.

Assuming that the patch is the right fix, the patch isn't ready for trunk because of these missing elements. However, I'm not convinced the patch is the right approach.

We already have a 'find the errors' command -- it's called validate. I don't see the use case for an additional management command to catch serialization errors. In any case, blank=True without null=True shouldn't pose a serialization problem, but the reporter doesn't provide a clear test case to validate the problem they describe.

Given that this problem was reported 3 years ago, there have been many improvements in serialization error reporting since that time, and many edge cases caught in serialization since then, I'm going to close this needsinfo. If someone can verify that this is still a problem, feel free to reopen, providing a specific reproduction test case. I encountered this exact same problem with Django 1.3 when working with some legacy data. Whilst validate returned no errors, dumpdata reported the error 'Space matching query does not exist.' The problem was that the legacy data allowed a value of 0 for a blank foreign key, instead of NULL.

Django was (logically) unable to match the ID 0 to an existing foreign row. To fix the issue, I updated the legacy data to use NULL instead of 0 for blank foreign keys. I agree that the error message could be more explicit or maybe validate could catch these types of problems? Replying to: I encountered this exact same problem with Django 1.3 when working with some legacy data. Whilst validate returned no errors, dumpdata reported the error 'Space matching query does not exist.' The problem was that the legacy data allowed a value of 0 for a blank foreign key, instead of NULL. Django was (logically) unable to match the ID 0 to an existing foreign row.

To fix the issue, I updated the legacy data to use NULL instead of 0 for blank foreign keys. I agree that the error message could be more explicit or maybe validate could catch these types of problems? A simple, bare, (without the brackets) in place of a 0 for null foreign key properties in an import json fixture will also take care of the problem.