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

Log and ignore when meet unknown encoding file #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JaySon-Huang
Copy link

@JaySon-Huang JaySon-Huang commented Aug 17, 2023

First of all, thanks for this fantastic script!

When using this script to handle my codes, the script exit with an exception. I think it is better to log an error and continue for other files in the directory.

I've tested it as follows

>  python3 licenseheaders.py -t templates/apache-2.tmpl -y 2023 -o 'JaySon' -d tests -vv
licenseheaders_0.8.8 INFO: Using file /Users/jayson/Projects/licenseheaders/templates/apache-2.tmpl
licenseheaders_0.8.8 INFO: Processing file tests/driver.py as python
licenseheaders_0.8.8 INFO: Processing file tests/expected/test.h as c
licenseheaders_0.8.8 INFO: Processing file tests/expected/test.cpp as cpp
licenseheaders_0.8.8 INFO: Processing file tests/expected/test.sh as script
licenseheaders_0.8.8 INFO: Processing file tests/expected/test.py as python
licenseheaders_0.8.8 INFO: Processing file tests/expected/CMakeLists.txt as cmake
licenseheaders_0.8.8 INFO: Processing file tests/expected/test.v as ocaml
licenseheaders_0.8.8 ERROR: Exceptions when reading file tests/input/shark0.cc, error='utf-8' codec can't decode byte 0xff in position 0: invalid start byte
licenseheaders_0.8.8 INFO: Processing file tests/input/test.h as c
licenseheaders_0.8.8 INFO: Processing file tests/input/test.cpp as cpp
licenseheaders_0.8.8 INFO: Processing file tests/input/test.sh as script
licenseheaders_0.8.8 INFO: Processing file tests/input/test.py as python
licenseheaders_0.8.8 INFO: Processing file tests/input/CMakeLists.txt as cmake
licenseheaders_0.8.8 INFO: Processing file tests/input/test.v as ocaml

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

Successfully merging this pull request may close these issues.

1 participant