django-bootstrap-studio-tools icon indicating copy to clipboard operation
django-bootstrap-studio-tools copied to clipboard

Argv usage dangerous.

Open AbcSxyZ opened this issue 5 years ago • 0 comments

You're selecting filename with infile = sys.argv[-1].

In normal usage, called by BSS, it won't create any trouble. However, if image you're using it as standalone, or if something wrong occur and no argument is given, you're going to select argv[0], the script filename.

It will rewrite the export.py file. Some condition must be added, raise en error if there isn't the right number of arguments, whatever.

AbcSxyZ avatar Aug 08 '20 11:08 AbcSxyZ