Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#12756 closed Cleanup/optimization (fixed)

dumpdata error message should note pyyaml requirement

Reported by: abeld@… 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 Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Adam Vandenberg, 14 years ago

The "serialization formats" page does note the PyYAML requirement: http://docs.djangoproject.com/en/dev/topics/serialization/#serialization-formats

comment:3 by Julien Phalip, 14 years ago

Severity: Normal
Type: Cleanup/optimization

comment:4 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 by Tim Graham, 11 years ago

Resolution: wontfix
Status: newclosed

I don't think there's a need to special case the error message for yaml to note the needed dependency.

comment:7 by Chris Curvey, 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 Russell Keith-Magee, 11 years ago

Component: DocumentationCore (Serialization)
Easy pickings: set
Resolution: wontfix
Status: closednew

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 berto, 11 years ago

Owner: changed from nobody to berto
Status: newassigned

comment:10 by berto, 11 years ago

I've created a pull request here: https://github.com/django/django/pull/1564

Thanks!

comment:12 by Russell Keith-Magee <russell@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 4f5faa1916e7c8cb72cc9ebf1a1fd964ba6e707b:

Merge pull request #1582 from rca/12756-missing-yaml-module-serializer-error-message

Fixed #12756: Improved error message when yaml module is missing.

comment:13 by Russell Keith-Magee <russell@…>, 11 years ago

In 3df9647ad96eb0f1919be921bb96e949f1a518a0:

[1.6.x] Merge pull request #1582 from rca/12756-missing-yaml-module-serializer-error-message

Fixed #12756: Improved error message when yaml module is missing.

Backport of 4f5faa1916e7c8cb72cc9ebf1a1fd964ba6e707b from master.

Note: See TracTickets for help on using tickets.
Back to Top