1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #4895: Force UTF-8 encoding when embedding model documentation

This commit is contained in:
Jeremy Stretch
2020-07-24 09:26:20 -04:00
parent bb4f21d5ee
commit cb570790e6
3 changed files with 3 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ def get_docs(model):
model._meta.model_name
)
try:
with open(path) as docfile:
with open(path, encoding='utf-8') as docfile:
content = docfile.read()
except FileNotFoundError:
return "Unable to load documentation, file not found: {}".format(path)