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

some fixes for et #2589

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mslib/msui/flighttrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
import os

import fs
import xml.dom.minidom
import xml.parsers.expat
import xml.dom.minidom # nosec
import defusedxml.minidom
from defusedxml import DefusedXmlException

from PyQt5 import QtGui, QtCore, QtWidgets

Expand Down Expand Up @@ -97,8 +98,8 @@ def seconds_to_string(seconds):

def load_from_xml_data(xml_content, name="Flight track"):
try:
doc = xml.dom.minidom.parseString(xml_content)
except xml.parsers.expat.ExpatError as ex:
doc = defusedxml.minidom.parseString(xml_content)
except DefusedXmlException as ex:
raise SyntaxError(str(ex))

ft_el = doc.getElementsByTagName("FlightTrack")[0]
Expand Down
2 changes: 1 addition & 1 deletion mslib/mswms/mpl_lsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# style definitions should be put in mpl_lsec_styles.py

import logging
from xml.dom.minidom import getDOMImplementation
from xml.dom.minidom import getDOMImplementation # nosec
import matplotlib as mpl
from pint import Quantity

Expand Down
2 changes: 1 addition & 1 deletion mslib/mswms/mpl_vsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import logging
import numpy as np
from abc import abstractmethod
from xml.dom.minidom import getDOMImplementation
from xml.dom.minidom import getDOMImplementation # nosec
import matplotlib as mpl
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
import mpl_toolkits.axes_grid1
Expand Down
2 changes: 1 addition & 1 deletion mslib/mswms/wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import werkzeug
import urllib.parse

from xml.etree import ElementTree
from defusedxml import ElementTree
from chameleon import PageTemplateLoader
from owslib.crs import axisorder_yx
from PIL import Image
Expand Down
3 changes: 2 additions & 1 deletion mslib/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ def setup_logging(args):
logger.addHandler(fh)


# ToDo likely this can be removed in python 3 because that uses unicode
# modified Version from minidom, https://github.com/python/cpython/blob/2.7/Lib/xml/dom/minidom.py
# MSS needed to change all writings as unicode not str
from xml.dom.minidom import _write_data, Node
from xml.dom.minidom import _write_data, Node # nosec
# Copyright © 2001-2018 Python Software Foundation. All rights reserved.
# Copyright © 2000 BeOpen.com. All rights reserved.

Expand Down
Loading