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

Unicode error with description characters within config. #54

Open
ekrichbaum opened this issue Mar 27, 2023 · 1 comment
Open

Unicode error with description characters within config. #54

ekrichbaum opened this issue Mar 27, 2023 · 1 comment

Comments

@ekrichbaum
Copy link

Plugin version

current

NetBox version

3.4.5

Python version

3.9

Steps to Reproduce

Config backup seems to run and file is in git. "Last Backup" field in grid goes blank.

Clicking that job shows uid and going to the git dir, cat uid.running does show the valid config.

Clicking the job config specifically though gives a unicode error.

The string that could not be encoded/decoded was: - Fl���� N

Legit that the characters are there. They were imported from Peeringdb via peeringmanager as descriptions for bgp.

            description "Peering: AS32098 - Fl� Networks";
            description "Peering: AS32098 - Fl� Networks";

Expected Behavior

Mask or handle characters without error.

Observed Behavior

'ascii' codec can't decode byte 0xc3 in position 52799: ordinal not in range(128)
Request Method:	GET
Request URL:	https://netbox.netfortris.net/plugins/configbackup/devices/22/config/26/
Django Version:	4.1.7
Exception Type:	UnicodeDecodeError
Exception Value:	
'ascii' codec can't decode byte 0xc3 in position 52799: ordinal not in range(128)
Exception Location:	/opt/netbox/venv/lib64/python3.11/site-packages/netbox_config_backup/git.py, line 96, in read
Raised during:	netbox_config_backup.views.ConfigView
Python Executable:	/opt/netbox/venv/bin/python3
Python Version:	3.11.2
Python Path:	
['/opt/netbox/netbox',
 '/opt/netbox/venv/lib64/python3.11/site-packages/git/ext/gitdb',
 '/opt/netbox',
 '/opt/netbox/venv/bin',
 '/usr/lib64/python311.zip',
 '/usr/lib64/python3.11',
 '/usr/lib64/python3.11/lib-dynload',
 '/opt/netbox/venv/lib64/python3.11/site-packages',
 '/opt/netbox/venv/lib/python3.11/site-packages']
Server time:	Mon, 27 Mar 2023 18:13:38 +0000
@DanSheps
Copy link
Owner

This is an issue as we simply choose to decode as ASCII. I could likely encode/decode as utf but there might be issues with that.

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

2 participants