Code

Opened 4 years ago

Closed 10 months ago

Last modified 10 months 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.

Attachments (0)

Change History (13)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by adamv

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

comment:3 Changed 3 years ago by julien

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:4 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 2 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:6 Changed 12 months ago by timo

  • Resolution set to wontfix
  • Status changed from new to closed

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

comment:7 Changed 10 months ago by ccurvey

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 Changed 10 months ago by russellm

  • Component changed from Documentation to Core (Serialization)
  • Easy pickings set
  • Resolution wontfix deleted
  • Status changed from closed to 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 Changed 10 months ago by berto

  • Owner changed from nobody to berto
  • Status changed from new to assigned

comment:10 Changed 10 months ago by berto

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

Thanks!

comment:12 Changed 10 months ago by Russell Keith-Magee <russell@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

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 Changed 10 months ago by Russell Keith-Magee <russell@…>

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.