Skip to content

[BUG] Encoding command-line parameter #81

Description

@Paul-Wassermann-CA

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions