-
Notifications
You must be signed in to change notification settings - Fork 481
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
meet unicode encode error while audit the baseline #211
Comments
I’ll be sure to grep for |
@KevinHock Thx. I add the code "from future import unicode_literals" to both main.py and color.py files and still not working.Below is the error message when audit the same file.For your reference. Traceback (most recent call last): |
@KevinHock I add below code in main.py by using utf-8 as default and it works fine with me now. But I just don't know running on UTF-8 for scan functionality will cross any issues . So far so good. reload(sys) |
So I added an |
* Attempts to fix db2 detector Installing from this branch and testing... * debugging * don't catch exception to see what it is * Print username password * Back to try except * print conn string * Fix single quote issue * Test case * Remove print statements * Test case for double quotes * code comment
* Attempts to fix db2 detector Installing from this branch and testing... * debugging * don't catch exception to see what it is * Print username password * Back to try except * print conn string * Fix single quote issue * Test case * Remove print statements * Test case for double quotes * code comment
Uncertain the action item to be taken here. Closing as fixed given the comment thread. |
Hi , guys , I met the unicode encode error when I was trying to audit the baseline. The detail as below:
Filename: src/main/java/com/XX/account/microservice/common/AccountConstants.java
Secret Type: Secret Keyword
Traceback (most recent call last):
File "/bin/detect-secrets", line 11, in
sys.exit(main())
File "/usr/lib/python2.7/site-packages/detect_secrets/main.py", line 64, in main
audit.audit_baseline(args.filename[0])
File "/usr/lib/python2.7/site-packages/detect_secrets/core/audit.py", line 83, in audit_baseline
original_baseline['plugins_used'],
File "/usr/lib/python2.7/site-packages/detect_secrets/core/audit.py", line 479, in _print_context
force=force,
File "/usr/lib/python2.7/site-packages/detect_secrets/core/audit.py", line 586, in _get_secret_with_context
snippet.highlight_line(raw_secret_value)
File "/usr/lib/python2.7/site-packages/detect_secrets/core/code_snippet.py", line 97, in highlight_line
self.apply_highlight(self.target_line[index_of_payload:end_of_payload]),
File "/usr/lib/python2.7/site-packages/detect_secrets/core/code_snippet.py", line 114, in apply_highlight
AnsiColor.RED_BACKGROUND,
File "/usr/lib/python2.7/site-packages/detect_secrets/core/color.py", line 17, in colorize
AnsiColor.RESET.value,
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
Seeking help with this error.
The text was updated successfully, but these errors were encountered: