#12756 closed Cleanup/optimization (fixed)
dumpdata error message should note pyyaml requirement
Reported by: | Owned by: | berto | |
---|---|---|---|
Component: | Core (Serialization) | Version: | 1.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
When trying to dumping some data to yaml, if pyyaml is not installed, one gets the following error message:
$ ./manage-dev dumpdata --indent=2 --format=yaml auth
Error: Unknown serialization format: yaml
It would be very helpful, if the error message would mention the lack of pyyaml, for example by saying:
"Error: Unknown serialization format: yaml (you need to install PyYAML perhaps?)"
Also, the PyYAML requirement should be mentioned on the http://docs.djangoproject.com/en/dev/howto/initial-data/ page, as well.
The point is that although the need for pyyaml is mentioned on the "Serializing Django objects" page, when one uses the documentation as a reference, one might miss that page resulting in some head-scratching as to how come yaml doesn't work even though the documentation claims it does.
Change History (13)
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
comment:6 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I don't think there's a need to special case the error message for yaml to note the needed dependency.
comment:7 by , 11 years ago
not that my opinon counts, but I agree with the original request. How many folks will google for 'django dumpdata unknown serialization format' only to end up on this page.
comment:8 by , 11 years ago
Component: | Documentation → Core (Serialization) |
---|---|
Easy pickings: | set |
Resolution: | wontfix |
Status: | closed → new |
Yeah - I agree with the original request as well. We're swallowing an ImportError, and reporting it as a "missing backend" error. The two errors are distinct, and should be reported as such. It's not about special casing YAML - it's about modifying our error reporting in the general case so that if a backend has an import dependency, we accurately report the underlying problem.
comment:9 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:10 by , 11 years ago
I've created a pull request here: https://github.com/django/django/pull/1564
Thanks!
comment:12 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The "serialization formats" page does note the PyYAML requirement: http://docs.djangoproject.com/en/dev/topics/serialization/#serialization-formats