Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135861

QXmlStreamWriter continues writing data after an error is raised

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5, 6.8, 6.9
    • None

    Description

      Currently, QXmlStreamWriter continues to write data to the output device even after an error has been detected and hasError() returns true.
      If invalid data is written (such as an invalid XML character), the writer correctly raises an encoding error, but still continues to write buffered data to the underlying device, resulting in malformed XML output. Current documentation states that writes may be ignored after an error, but in practice, data is still written.

      Expected output of the reproducer:
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root></root>"

      Actual output:
      "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>Invalid character</root>\n"

      Attachments

        1. main.cpp
          0.4 kB
          Magdalena Stojek
        For Gerrit Dashboard: QTBUG-135861
        # Subject Branch Project Status CR V

        Activity

          People

            magdalenas Magdalena Stojek
            magdalenas Magdalena Stojek
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change