Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Encoding command-line parameter #81

Open
Paul-Wassermann-CA opened this issue Mar 5, 2024 · 0 comments
Open

[BUG] Encoding command-line parameter #81

Paul-Wassermann-CA opened this issue Mar 5, 2024 · 0 comments

Comments

@Paul-Wassermann-CA
Copy link

Paul-Wassermann-CA commented Mar 5, 2024

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

@Paul-Wassermann-CA Paul-Wassermann-CA changed the title [BUG] Encoding argument [BUG] Encoding command-line parameter Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant