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

decode issue for special characters #3

Open
wavelet123 opened this issue Jul 1, 2021 · 1 comment
Open

decode issue for special characters #3

wavelet123 opened this issue Jul 1, 2021 · 1 comment

Comments

@wavelet123
Copy link

Hi ahes
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 30: invalid start byte
we have the above error when there are special characters in the slow log.
Could you please have a look?

    1. (integer) 378
    2. (integer) 1625074653
    3. (integer) 21205
      1. "SET"
      2. "AccountDB_idx_91464248_3"
      3. "\b\xb8\xc4\xce+\x12\x0eBadis Bouazdia"

Thanks

@wavelet123
Copy link
Author

wavelet123 commented Jul 1, 2021

fixed this by change code as below:

    try:
        commandtmp = entry['command'].decode()
    except:
        commandtmp = str(entry['command']) 
    yield Entry(
        id = entry['id'],
        start_time = datetime.fromtimestamp(entry['start_time']),
        duration = round(entry['duration'] / 1000 / 1000, 2), # in seconds
        command = commandtmp )

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