Opened 8 years ago

Last modified 8 years ago

#26751 closed Cleanup/optimization

dbshell error handling — at Initial Version

Reported by: Étienne BERSAC Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: dbshell
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

The Django project made great improvements in batch mode for dbshell with password managment. That's a nice contribution !

For scripting, commands should return a non zero exit-code on error. But runshell seems to miss to manage exit code. Here is how to reproduce:

(venv) $ echo 'auieaui;' | django-admin dbshell
ERROR:  syntax error at or near "auieaui"
LINE 1: auieaui;
        ^
(venv) $ echo $?
0

I suggested a fix in https://github.com/django/django/pull/6768 . @charettes asked me to open a ticket for discussion. Here your are :)

Regards,
Étienne

Change History (0)

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