Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Questionable Code Example

      xml module

      import xml.etree.ElementTree as ElTree
      
      
      def search(data, xpath):
          root_node = ElTree.fromstring(data)
      
          root_node.findall(xpath)  # Questionable
          root_node.find(xpath)  # Questionable
      
          hardcoded_xpath = '.'
          root_node.findall(hardcoded_xpath)  # Ok
          root_node.find(hardcoded_xpath)  # Ok
      

      lxml library

      from lxml import etree
      
      def search(data, xpath):
          root_node = etree.parse(data)
      
          print(root_node.xpath(xpath))  # Questionable
      
          hardcoded_xpath = '.'
          root_node.xpath(hardcoded_xpath)  # Ok
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nicolas.harraudeau Nicolas Harraudeau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: