The following issues were found
pipenv/patched/notpip/_vendor/chardet/big5prober.py
9 issues
Line: 28
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import Big5DistributionAnalysis
from .mbcssm import BIG5_SM_MODEL
Reported by Pylint.
Line: 29
Column: 1
######################### END LICENSE BLOCK #########################
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import Big5DistributionAnalysis
from .mbcssm import BIG5_SM_MODEL
class Big5Prober(MultiByteCharSetProber):
Reported by Pylint.
Line: 30
Column: 1
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import Big5DistributionAnalysis
from .mbcssm import BIG5_SM_MODEL
class Big5Prober(MultiByteCharSetProber):
def __init__(self):
Reported by Pylint.
Line: 31
Column: 1
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import Big5DistributionAnalysis
from .mbcssm import BIG5_SM_MODEL
class Big5Prober(MultiByteCharSetProber):
def __init__(self):
super(Big5Prober, self).__init__()
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
Reported by Pylint.
Line: 34
Column: 1
from .mbcssm import BIG5_SM_MODEL
class Big5Prober(MultiByteCharSetProber):
def __init__(self):
super(Big5Prober, self).__init__()
self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
self.distribution_analyzer = Big5DistributionAnalysis()
self.reset()
Reported by Pylint.
Line: 36
Column: 9
class Big5Prober(MultiByteCharSetProber):
def __init__(self):
super(Big5Prober, self).__init__()
self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
self.distribution_analyzer = Big5DistributionAnalysis()
self.reset()
@property
Reported by Pylint.
Line: 42
Column: 5
self.reset()
@property
def charset_name(self):
return "Big5"
@property
def language(self):
return "Chinese"
Reported by Pylint.
Line: 46
Column: 5
return "Big5"
@property
def language(self):
return "Chinese"
Reported by Pylint.
pipenv/patched/notpip/_vendor/pytoml/test.py
9 issues
Line: 2
Column: 1
import datetime
from .utils import format_rfc3339
try:
_string_types = (str, unicode)
_int_types = (int, long)
except NameError:
_string_types = str
_int_types = int
Reported by Pylint.
Line: 1
Column: 1
import datetime
from .utils import format_rfc3339
try:
_string_types = (str, unicode)
_int_types = (int, long)
except NameError:
_string_types = str
_int_types = int
Reported by Pylint.
Line: 8
Column: 5
_string_types = (str, unicode)
_int_types = (int, long)
except NameError:
_string_types = str
_int_types = int
def translate_to_test(v):
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
Reported by Pylint.
Line: 9
Column: 5
_int_types = (int, long)
except NameError:
_string_types = str
_int_types = int
def translate_to_test(v):
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
Reported by Pylint.
Line: 11
Column: 1
_string_types = str
_int_types = int
def translate_to_test(v):
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
a = [translate_to_test(x) for x in v]
if v and isinstance(v[0], dict):
Reported by Pylint.
Line: 11
Column: 1
_string_types = str
_int_types = int
def translate_to_test(v):
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
a = [translate_to_test(x) for x in v]
if v and isinstance(v[0], dict):
Reported by Pylint.
Line: 11
Column: 1
_string_types = str
_int_types = int
def translate_to_test(v):
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
a = [translate_to_test(x) for x in v]
if v and isinstance(v[0], dict):
Reported by Pylint.
Line: 15
Column: 9
if isinstance(v, dict):
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
a = [translate_to_test(x) for x in v]
if v and isinstance(v[0], dict):
return a
else:
return {'type': 'array', 'value': a}
if isinstance(v, datetime.datetime):
Reported by Pylint.
Line: 16
Column: 9
return { k: translate_to_test(v) for k, v in v.items() }
if isinstance(v, list):
a = [translate_to_test(x) for x in v]
if v and isinstance(v[0], dict):
return a
else:
return {'type': 'array', 'value': a}
if isinstance(v, datetime.datetime):
return {'type': 'datetime', 'value': format_rfc3339(v)}
Reported by Pylint.
pipenv/patched/notpip/_vendor/cachecontrol/compat.py
9 issues
Line: 2
Column: 5
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
Reported by Pylint.
Line: 8
Column: 5
try:
import cPickle as pickle
except ImportError:
import pickle
# Handle the case where the requests module has been patched to not have
Reported by Pylint.
Line: 10
Column: 5
try:
import cPickle as pickle
except ImportError:
import pickle
# Handle the case where the requests module has been patched to not have
# urllib3 bundled as part of its source.
try:
Reported by Pylint.
Line: 16
Column: 5
# Handle the case where the requests module has been patched to not have
# urllib3 bundled as part of its source.
try:
from pipenv.patched.notpip._vendor.requests.packages.urllib3.response import HTTPResponse
except ImportError:
from pipenv.patched.notpip._vendor.urllib3.response import HTTPResponse
try:
from pipenv.patched.notpip._vendor.requests.packages.urllib3.util import is_fp_closed
Reported by Pylint.
Line: 21
Column: 5
from pipenv.patched.notpip._vendor.urllib3.response import HTTPResponse
try:
from pipenv.patched.notpip._vendor.requests.packages.urllib3.util import is_fp_closed
except ImportError:
from pipenv.patched.notpip._vendor.urllib3.util import is_fp_closed
# Replicate some six behaviour
try:
Reported by Pylint.
Line: 1
Column: 1
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
try:
import cPickle as pickle
except ImportError:
Reported by Pylint.
Line: 8
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b403-import-pickle
try:
import cPickle as pickle
except ImportError:
import pickle
# Handle the case where the requests module has been patched to not have
Reported by Bandit.
Line: 10
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b403-import-pickle
try:
import cPickle as pickle
except ImportError:
import pickle
# Handle the case where the requests module has been patched to not have
# urllib3 bundled as part of its source.
try:
Reported by Bandit.
Line: 29
Column: 5
try:
text_type = unicode
except NameError:
text_type = str
Reported by Pylint.
pipenv/vendor/tomlkit/toml_char.py
9 issues
Line: 3
Column: 1
import string
from ._compat import PY2
from ._compat import unicode
if PY2:
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
Reported by Pylint.
Line: 4
Column: 1
import string
from ._compat import PY2
from ._compat import unicode
if PY2:
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
Reported by Pylint.
Line: 8
Column: 5
if PY2:
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
from functools import lru_cache
class TOMLChar(unicode):
Reported by Pylint.
Line: 8
Column: 5
if PY2:
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
from functools import lru_cache
class TOMLChar(unicode):
Reported by Pylint.
Line: 14
Column: 24
class TOMLChar(unicode):
def __init__(self, c):
super(TOMLChar, self).__init__()
if len(self) > 1:
raise ValueError("A TOML character must be of length 1")
Reported by Pylint.
Line: 1
Column: 1
import string
from ._compat import PY2
from ._compat import unicode
if PY2:
from pipenv.vendor.backports.functools_lru_cache import lru_cache
else:
Reported by Pylint.
Line: 13
Column: 1
from functools import lru_cache
class TOMLChar(unicode):
def __init__(self, c):
super(TOMLChar, self).__init__()
if len(self) > 1:
raise ValueError("A TOML character must be of length 1")
Reported by Pylint.
Line: 14
Column: 5
class TOMLChar(unicode):
def __init__(self, c):
super(TOMLChar, self).__init__()
if len(self) > 1:
raise ValueError("A TOML character must be of length 1")
Reported by Pylint.
Line: 15
Column: 9
class TOMLChar(unicode):
def __init__(self, c):
super(TOMLChar, self).__init__()
if len(self) > 1:
raise ValueError("A TOML character must be of length 1")
BARE = string.ascii_letters + string.digits + "-_"
Reported by Pylint.
pipenv/vendor/yarg/exceptions.py
8 issues
Line: 48
Column: 36
for key, val in kwargs.items():
setattr(self, key, val)
if hasattr(self, 'status_code'):
setattr(self, 'errno', self.status_code)
if hasattr(self, 'reason'):
setattr(self, 'message', self.reason)
def __str__(self):
return self.__repr__()
Reported by Pylint.
Line: 50
Column: 38
if hasattr(self, 'status_code'):
setattr(self, 'errno', self.status_code)
if hasattr(self, 'reason'):
setattr(self, 'message', self.reason)
def __str__(self):
return self.__repr__()
def __repr__(self):
Reported by Pylint.
Line: 57
Column: 49
def __repr__(self):
if hasattr(self, 'status_code') and hasattr(self, 'reason'):
return "<HTTPError {0} {1}>".format(self.status_code, self.reason)
return "<HTTPError>"
Reported by Pylint.
Line: 57
Column: 67
def __repr__(self):
if hasattr(self, 'status_code') and hasattr(self, 'reason'):
return "<HTTPError {0} {1}>".format(self.status_code, self.reason)
return "<HTTPError>"
Reported by Pylint.
Line: 44
Column: 5
:member: status_code
"""
def __init__(self, *args, **kwargs):
for key, val in kwargs.items():
setattr(self, key, val)
if hasattr(self, 'status_code'):
setattr(self, 'errno', self.status_code)
if hasattr(self, 'reason'):
Reported by Pylint.
Line: 44
Column: 5
:member: status_code
"""
def __init__(self, *args, **kwargs):
for key, val in kwargs.items():
setattr(self, key, val)
if hasattr(self, 'status_code'):
setattr(self, 'errno', self.status_code)
if hasattr(self, 'reason'):
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
# (The MIT License)
#
# Copyright (c) 2014 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
Reported by Pylint.
Line: 29
Column: 1
from requests.exceptions import HTTPError as RHTTPError
class YargException(Exception):
pass
class HTTPError(YargException, RHTTPError):
"""
Reported by Pylint.
pipenv/vendor/importlib_resources/tests/_compat.py
8 issues
Line: 5
Column: 5
try:
from test.support import import_helper # type: ignore
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
Reported by Pylint.
Line: 14
Column: 5
try:
# Python 3.10
from test.support.os_helper import unlink
except ImportError:
from test.support import unlink as _unlink
def unlink(target):
return _unlink(os.fspath(target))
Reported by Pylint.
Line: 1
Column: 1
import os
try:
from test.support import import_helper # type: ignore
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
Reported by Pylint.
Line: 8
Column: 5
from test.support import import_helper # type: ignore
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
try:
# Python 3.10
Reported by Pylint.
Line: 8
Column: 5
from test.support import import_helper # type: ignore
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
try:
# Python 3.10
Reported by Pylint.
Line: 8
Column: 5
from test.support import import_helper # type: ignore
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
try:
# Python 3.10
Reported by Pylint.
Line: 9
Column: 9
except ImportError:
# Python 3.9 and earlier
class import_helper: # type: ignore
from test.support import modules_setup, modules_cleanup
try:
# Python 3.10
from test.support.os_helper import unlink
Reported by Pylint.
Line: 18
Column: 5
except ImportError:
from test.support import unlink as _unlink
def unlink(target):
return _unlink(os.fspath(target))
Reported by Pylint.
pipenv/vendor/charset_normalizer/__init__.py
8 issues
Line: 23
Column: 1
:copyright: (c) 2021 by Ahmed TAHRI
:license: MIT, see LICENSE for more details.
"""
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
from charset_normalizer.legacy import detect
from charset_normalizer.version import __version__, VERSION
from charset_normalizer.models import CharsetMatch, CharsetMatches
# Backward-compatible v1 imports
Reported by Pylint.
Line: 24
Column: 1
:license: MIT, see LICENSE for more details.
"""
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
from charset_normalizer.legacy import detect
from charset_normalizer.version import __version__, VERSION
from charset_normalizer.models import CharsetMatch, CharsetMatches
# Backward-compatible v1 imports
from charset_normalizer.models import CharsetNormalizerMatch
Reported by Pylint.
Line: 25
Column: 1
"""
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
from charset_normalizer.legacy import detect
from charset_normalizer.version import __version__, VERSION
from charset_normalizer.models import CharsetMatch, CharsetMatches
# Backward-compatible v1 imports
from charset_normalizer.models import CharsetNormalizerMatch
import charset_normalizer.api as CharsetDetector
Reported by Pylint.
Line: 26
Column: 1
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
from charset_normalizer.legacy import detect
from charset_normalizer.version import __version__, VERSION
from charset_normalizer.models import CharsetMatch, CharsetMatches
# Backward-compatible v1 imports
from charset_normalizer.models import CharsetNormalizerMatch
import charset_normalizer.api as CharsetDetector
CharsetNormalizerMatches = CharsetDetector
Reported by Pylint.
Line: 29
Column: 1
from charset_normalizer.models import CharsetMatch, CharsetMatches
# Backward-compatible v1 imports
from charset_normalizer.models import CharsetNormalizerMatch
import charset_normalizer.api as CharsetDetector
CharsetNormalizerMatches = CharsetDetector
Reported by Pylint.
Line: 30
Column: 1
# Backward-compatible v1 imports
from charset_normalizer.models import CharsetNormalizerMatch
import charset_normalizer.api as CharsetDetector
CharsetNormalizerMatches = CharsetDetector
Reported by Pylint.
Line: 11
Column: 1
Basic usage:
>>> from charset_normalizer import from_bytes
>>> results = from_bytes('Bсеки човек има право на образование. Oбразованието трябва да бъде безплатно, поне що се отнася до началното и основното образование.'.encode('utf_8'))
>>> "utf_8" in results
True
>>> best_result = results.best()
>>> str(best_result)
'Bсеки човек има право на образование. Oбразованието трябва да бъде безплатно, поне що се отнася до началното и основното образование.'
Reported by Pylint.
Line: 16
Column: 1
True
>>> best_result = results.best()
>>> str(best_result)
'Bсеки човек има право на образование. Oбразованието трябва да бъде безплатно, поне що се отнася до началното и основното образование.'
Others methods and usages are available - see the full documentation
at <https://github.com/Ousret/charset_normalizer>.
:copyright: (c) 2021 by Ahmed TAHRI
:license: MIT, see LICENSE for more details.
Reported by Pylint.
pipenv/vendor/chardet/langhungarianmodel.py
8 issues
Line: 4
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 4378
Column: 1
WINDOWS_1250_HUNGARIAN_MODEL = SingleByteCharSetModel(charset_name='windows-1250',
language='Hungarian',
char_to_order_map=WINDOWS_1250_HUNGARIAN_CHAR_TO_ORDER,
language_model=HUNGARIAN_LANG_MODEL,
typical_positive_ratio=0.947368,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű')
Reported by Pylint.
Line: 4382
Column: 1
language_model=HUNGARIAN_LANG_MODEL,
typical_positive_ratio=0.947368,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű')
ISO_8859_2_HUNGARIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 4645
Column: 1
ISO_8859_2_HUNGARIAN_MODEL = SingleByteCharSetModel(charset_name='ISO-8859-2',
language='Hungarian',
char_to_order_map=ISO_8859_2_HUNGARIAN_CHAR_TO_ORDER,
language_model=HUNGARIAN_LANG_MODEL,
typical_positive_ratio=0.947368,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű')
Reported by Pylint.
Line: 4649
Column: 1
language_model=HUNGARIAN_LANG_MODEL,
typical_positive_ratio=0.947368,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű')
Reported by Pylint.
Line: 4650
Column: 1
typical_positive_ratio=0.947368,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVZabcdefghijklmnoprstuvzÁÉÍÓÖÚÜáéíóöúüŐőŰű')
Reported by Pylint.
pipenv/vendor/chardet/langbulgarianmodel.py
8 issues
Line: 4
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 4378
Column: 1
ISO_8859_5_BULGARIAN_MODEL = SingleByteCharSetModel(charset_name='ISO-8859-5',
language='Bulgarian',
char_to_order_map=ISO_8859_5_BULGARIAN_CHAR_TO_ORDER,
language_model=BULGARIAN_LANG_MODEL,
typical_positive_ratio=0.969392,
keep_ascii_letters=False,
alphabet='АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя')
Reported by Pylint.
Line: 4382
Column: 1
language_model=BULGARIAN_LANG_MODEL,
typical_positive_ratio=0.969392,
keep_ascii_letters=False,
alphabet='АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя')
WINDOWS_1251_BULGARIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 4645
Column: 1
WINDOWS_1251_BULGARIAN_MODEL = SingleByteCharSetModel(charset_name='windows-1251',
language='Bulgarian',
char_to_order_map=WINDOWS_1251_BULGARIAN_CHAR_TO_ORDER,
language_model=BULGARIAN_LANG_MODEL,
typical_positive_ratio=0.969392,
keep_ascii_letters=False,
alphabet='АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя')
Reported by Pylint.
Line: 4649
Column: 1
language_model=BULGARIAN_LANG_MODEL,
typical_positive_ratio=0.969392,
keep_ascii_letters=False,
alphabet='АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя')
Reported by Pylint.
Line: 4650
Column: 1
typical_positive_ratio=0.969392,
keep_ascii_letters=False,
alphabet='АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЬЮЯабвгдежзийклмнопрстуфхцчшщъьюя')
Reported by Pylint.
pipenv/patched/notpip/_vendor/html5lib/treeadapters/sax.py
8 issues
Line: 5
Column: 1
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
prefix_mapping[prefix] = namespace
Reported by Pylint.
Line: 22
Column: 9
"""
handler.startDocument()
for prefix, namespace in prefix_mapping.items():
handler.startPrefixMapping(prefix, namespace)
for token in walker:
type = token["type"]
if type == "Doctype":
Reported by Pylint.
Line: 22
Column: 17
"""
handler.startDocument()
for prefix, namespace in prefix_mapping.items():
handler.startPrefixMapping(prefix, namespace)
for token in walker:
type = token["type"]
if type == "Doctype":
Reported by Pylint.
Line: 26
Column: 9
handler.startPrefixMapping(prefix, namespace)
for token in walker:
type = token["type"]
if type == "Doctype":
continue
elif type in ("StartTag", "EmptyTag"):
attrs = AttributesNSImpl(token["data"],
unadjustForeignAttributes)
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
Reported by Pylint.
Line: 3
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b406-import-xml-sax
from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
Reported by Bandit.
Line: 27
Column: 9
for token in walker:
type = token["type"]
if type == "Doctype":
continue
elif type in ("StartTag", "EmptyTag"):
attrs = AttributesNSImpl(token["data"],
unadjustForeignAttributes)
handler.startElementNS((token["namespace"], token["name"]),
Reported by Pylint.
Line: 46
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
elif type == "Comment":
pass
else:
assert False, "Unknown token type"
for prefix, namespace in prefix_mapping.items():
handler.endPrefixMapping(prefix)
handler.endDocument()
Reported by Bandit.