Python pyexpat.error() Examples
The following are 30
code examples of pyexpat.error().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pyexpat
, or try the search function
.
Example #1
Source File: ElementTree.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #2
Source File: ElementTree.py From CTFCrackTools with GNU General Public License v3.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #3
Source File: ElementTree.py From ironpython2 with Apache License 2.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #4
Source File: ElementTree.py From canape with GNU General Public License v3.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #5
Source File: ElementTree.py From BinderFilter with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #6
Source File: domish.py From python-for-android with Apache License 2.0 | 6 votes |
def __init__(self): import pyexpat self.DocumentStartEvent = None self.ElementEvent = None self.DocumentEndEvent = None self.error = pyexpat.error self.parser = pyexpat.ParserCreate("UTF-8", " ") self.parser.StartElementHandler = self._onStartElement self.parser.EndElementHandler = self._onEndElement self.parser.CharacterDataHandler = self._onCdata self.parser.StartNamespaceDeclHandler = self._onStartNamespace self.parser.EndNamespaceDeclHandler = self._onEndNamespace self.currElem = None self.defaultNsStack = [''] self.documentStarted = 0 self.localPrefixes = {}
Example #7
Source File: ElementTree.py From meddle with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #8
Source File: ElementTree.py From Computable with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #9
Source File: domish.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
def __init__(self): import pyexpat self.DocumentStartEvent = None self.ElementEvent = None self.DocumentEndEvent = None self.error = pyexpat.error self.parser = pyexpat.ParserCreate("UTF-8", " ") self.parser.StartElementHandler = self._onStartElement self.parser.EndElementHandler = self._onEndElement self.parser.CharacterDataHandler = self._onCdata self.parser.StartNamespaceDeclHandler = self._onStartNamespace self.parser.EndNamespaceDeclHandler = self._onEndNamespace self.currElem = None self.defaultNsStack = [''] self.documentStarted = 0 self.localPrefixes = {}
Example #10
Source File: ElementTree.py From oss-ftp with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #11
Source File: ElementTree.py From Splunking-Crime with GNU Affero General Public License v3.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #12
Source File: domish.py From Safejumper-for-Desktop with GNU General Public License v2.0 | 6 votes |
def __init__(self): import pyexpat self.DocumentStartEvent = None self.ElementEvent = None self.DocumentEndEvent = None self.error = pyexpat.error self.parser = pyexpat.ParserCreate("UTF-8", " ") self.parser.StartElementHandler = self._onStartElement self.parser.EndElementHandler = self._onEndElement self.parser.CharacterDataHandler = self._onCdata self.parser.StartNamespaceDeclHandler = self._onStartNamespace self.parser.EndNamespaceDeclHandler = self._onEndNamespace self.currElem = None self.defaultNsStack = [''] self.documentStarted = 0 self.localPrefixes = {}
Example #13
Source File: ElementTree.py From pmatic with GNU General Public License v2.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #14
Source File: ElementTree.py From unity-python with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #15
Source File: ElementTree.py From xbmc-addons-chinese with GNU General Public License v2.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #16
Source File: ElementTree.py From PokemonGo-DesktopMap with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #17
Source File: domish.py From learn_python3_spider with MIT License | 6 votes |
def __init__(self): import pyexpat self.DocumentStartEvent = None self.ElementEvent = None self.DocumentEndEvent = None self.error = pyexpat.error self.parser = pyexpat.ParserCreate("UTF-8", " ") self.parser.StartElementHandler = self._onStartElement self.parser.EndElementHandler = self._onEndElement self.parser.CharacterDataHandler = self._onCdata self.parser.StartNamespaceDeclHandler = self._onStartNamespace self.parser.EndNamespaceDeclHandler = self._onEndNamespace self.currElem = None self.defaultNsStack = [''] self.documentStarted = 0 self.localPrefixes = {}
Example #18
Source File: ElementTree.py From RevitBatchProcessor with GNU General Public License v3.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #19
Source File: ElementTree.py From jawfish with MIT License | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #20
Source File: ElementTree.py From insights-core with Apache License 2.0 | 6 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = [] ## # Adds text to the current element. # # @param data A string. This should be either an 8-bit string # containing ASCII text, or a Unicode string.
Example #21
Source File: ElementTree.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def __init__(self, html=0, target=None, encoding=None): try: from xml.parsers import expat except ImportError: try: import pyexpat as expat except ImportError: raise ImportError( "No module named expat; use SimpleXMLTreeBuilder instead" ) parser = expat.ParserCreate(encoding, "}") if target is None: target = TreeBuilder() # underscored names are provided for compatibility only self.parser = self._parser = parser self.target = self._target = target self._error = expat.error self._names = {} # name memo cache # main callbacks parser.DefaultHandlerExpand = self._default if hasattr(target, 'start'): parser.StartElementHandler = self._start if hasattr(target, 'end'): parser.EndElementHandler = self._end if hasattr(target, 'data'): parser.CharacterDataHandler = target.data # miscellaneous callbacks if hasattr(target, 'comment'): parser.CommentHandler = target.comment if hasattr(target, 'pi'): parser.ProcessingInstructionHandler = target.pi # Configure pyexpat: buffering, new-style attribute handling. parser.buffer_text = 1 parser.ordered_attributes = 1 parser.specified_attributes = 1 self._doctype = None self.entity = {} try: self.version = "Expat %d.%d.%d" % expat.version_info except AttributeError: pass # unknown
Example #22
Source File: domish.py From Safejumper-for-Desktop with GNU General Public License v2.0 | 5 votes |
def parse(self, buffer): try: self.parser.Parse(buffer) except self.error as e: raise ParserError(str(e))
Example #23
Source File: domish.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def parse(self, buffer): try: self.parser.Parse(buffer) except self.error, e: raise ParserError, str(e)
Example #24
Source File: ElementTree.py From android_universal with MIT License | 5 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = []
Example #25
Source File: ElementTree.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = []
Example #26
Source File: domish.py From learn_python3_spider with MIT License | 5 votes |
def parse(self, buffer): try: self.parser.Parse(buffer) except self.error as e: raise ParserError(str(e))
Example #27
Source File: ElementTree.py From ironpython3 with Apache License 2.0 | 5 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = []
Example #28
Source File: ElementTree.py From ironpython3 with Apache License 2.0 | 5 votes |
def __init__(self, html=0, target=None, encoding=None): try: from xml.parsers import expat except ImportError: try: import pyexpat as expat except ImportError: raise ImportError( "No module named expat; use SimpleXMLTreeBuilder instead" ) parser = expat.ParserCreate(encoding, "}") if target is None: target = TreeBuilder() # underscored names are provided for compatibility only self.parser = self._parser = parser self.target = self._target = target self._error = expat.error self._names = {} # name memo cache # main callbacks parser.DefaultHandlerExpand = self._default if hasattr(target, 'start'): parser.StartElementHandler = self._start if hasattr(target, 'end'): parser.EndElementHandler = self._end if hasattr(target, 'data'): parser.CharacterDataHandler = target.data # miscellaneous callbacks if hasattr(target, 'comment'): parser.CommentHandler = target.comment if hasattr(target, 'pi'): parser.ProcessingInstructionHandler = target.pi # Configure pyexpat: buffering, new-style attribute handling. parser.buffer_text = 1 parser.ordered_attributes = 1 parser.specified_attributes = 1 self._doctype = None self.entity = {} try: self.version = "Expat %d.%d.%d" % expat.version_info except AttributeError: pass # unknown
Example #29
Source File: ElementTree.py From git2jss with MIT License | 5 votes |
def _flush(self): if self._data: if self._last is not None: text = "".join(self._data) if self._tail: assert self._last.tail is None, "internal error (tail)" self._last.tail = text else: assert self._last.text is None, "internal error (text)" self._last.text = text self._data = []
Example #30
Source File: ElementTree.py From git2jss with MIT License | 5 votes |
def __init__(self, html=0, target=None, encoding=None): try: from xml.parsers import expat except ImportError: try: import pyexpat as expat except ImportError: raise ImportError( "No module named expat; use SimpleXMLTreeBuilder instead" ) parser = expat.ParserCreate(encoding, "}") if target is None: target = TreeBuilder() # underscored names are provided for compatibility only self.parser = self._parser = parser self.target = self._target = target self._error = expat.error self._names = {} # name memo cache # main callbacks parser.DefaultHandlerExpand = self._default if hasattr(target, 'start'): parser.StartElementHandler = self._start if hasattr(target, 'end'): parser.EndElementHandler = self._end if hasattr(target, 'data'): parser.CharacterDataHandler = target.data # miscellaneous callbacks if hasattr(target, 'comment'): parser.CommentHandler = target.comment if hasattr(target, 'pi'): parser.ProcessingInstructionHandler = target.pi # Configure pyexpat: buffering, new-style attribute handling. parser.buffer_text = 1 parser.ordered_attributes = 1 parser.specified_attributes = 1 self._doctype = None self.entity = {} try: self.version = "Expat %d.%d.%d" % expat.version_info except AttributeError: pass # unknown