Skip to content

Log and ignore when meet unknown encoding file - #76

Open
JaySon-Huang wants to merge 1 commit into
johann-petrak:masterfrom
JaySon-Huang:fix_invalid_bytes
Open

Log and ignore when meet unknown encoding file#76
JaySon-Huang wants to merge 1 commit into
johann-petrak:masterfrom
JaySon-Huang:fix_invalid_bytes

Conversation

@JaySon-Huang

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

Copy link
Copy Markdown

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

Signed-off-by: JaySon-Huang <tshent@qq.com>
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