Corsinvest / cv4pve-autosnap

Automatic snapshot tool for Proxmox VE
https://www.corsinvest.it/cv4pve
GNU General Public License v3.0
413 stars 51 forks source link

UnicodeDecodeError while trying to remove a snap when accentuated characters in old snap description #33

Closed zorrobiwan closed 4 years ago

zorrobiwan commented 4 years ago

I got the following error while testing autosnap on my LXC containers.

Traceback (most recent call last):
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 119, in <module>
    remove_snapsot(vmid=k, virtualization=v, label=argp.label, keep=argp.keep, mute=argp.mute)
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 25, in create_pid
    return func(*args, **kwargs)
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 68, in remove_snapsot
    snapshots = run_command([virtualization, 'listsnapshot', vmid])
  File "/root/proxmox-autosnap/proxmox-autosnap.py", line 35, in run_command
    return {'status': True, 'message': out.decode('utf-8').rstrip()}
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 45: invalid continuation byte

It's due to the fact that one of my containers has already a snap with accentuated characters in the comment.

Once the accentuated character removed, the process runs smoothly

franklupo commented 4 years ago

Hi, this script is not mine. We don't work with python.

best regards

zorrobiwan commented 4 years ago

My bad, wrong project :) Sorry !!