Description
Specifying an --enc argument results in an error (see below). Therefore, the encoding used to read / write files cannot be changed.
To repoduce :
Call python -m licenseheaders --enc utf8 -f
An error is raised : TypeError: open() argument 'encoding' must be str or None, not list
How to fix the bug
See https://github.com/johann-petrak/licenseheaders/blob/master/licenseheaders.py#L412 for reference. The add_argument method for the "--enc" parameter should be called without specifying nargs, as specifying it results in the encoding being wrappend in a list (even for nargs=1).
Description
Specifying an
--encargument results in an error (see below). Therefore, the encoding used to read / write files cannot be changed.To repoduce :
Call
python -m licenseheaders --enc utf8 -fAn error is raised :
TypeError: open() argument 'encoding' must be str or None, not listHow to fix the bug
See https://github.com/johann-petrak/licenseheaders/blob/master/licenseheaders.py#L412 for reference. The
add_argumentmethod for the "--enc" parameter should be called without specifyingnargs, as specifying it results in the encoding being wrappend in a list (even for nargs=1).