2

I am trying to determine why I can't use a debugger when I call:

python manage.py dumpdata --indent=2  > forum/fixtures/initial_data.json'

I've put the following statements in the management command code:

import pdb; pdb.set_trace()
# I also tried 
import ipdb; ipdb.set_trace()

When called the command just hangs and has to be stopped with ctl-C:

$ python manage.py dumpdata --indent=2 > forum/fixtures/initial_data.json  


^CERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid  
The error message is: ('EOF in multi-line statement', (55, 0))  
ERROR: An unexpected error occurred while tokenizing input  
The following traceback may be corrupted or invalid  
The error message is: ('EOF in multi-line statement', (101, 0))  

Why is the debugger not working?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
BryanWheelock
  • 12,146
  • 18
  • 64
  • 109

1 Answers1

4

You are redirecting output to a file.

If you check contest of forum/fixtures/initial_data.json, you would see that pdb asked for an input there. If you want to debug dumpdata, do not redirect output.

bmihelac
  • 6,233
  • 34
  • 45