Code

Opened 7 years ago

Closed 7 years ago

#4301 closed (duplicate)

"manage.py loaddata" cannot work with python dumps (but tries hard anyway)

Reported by: mtredinnick Owned by: russellm
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If you use dumppdata with --format=python and then try to load the result with loaddata, it fails with an error about using non-ints as string offsets inside serializers.python.Deserializer.

This actually makes sense. although it took me more than a couple of minutes to realise it. In core.management we are reading the input file and passing it to the deserializer, but the deserializer for python assumes the input is a python object, not a string (a good thing; we don't eval() untrusted code).

We should probably just abort with a sensible error is loaddata tries to use the python format, because the current error message looks like it should work but there is something wrong with the dump.

Assigning to Russell, just for laughs, since he's been playing in this area a lot of late and might have some bright ideas.

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Simon G. <dev@…>

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

comment:2 Changed 7 years ago by russellm

  • Owner changed from russelm to russellm

comment:3 Changed 7 years ago by russellm

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

Duplicates #4187.

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.