QSWAT Worked Fine Yesterday, Fails to Start Editor with XML Parsing Error Today

37 views
Skip to first unread message

刘涛

unread,
May 11, 2025, 3:13:13 AM5/11/25
to SWAT-MODFLOW

Body:

Hello everyone,

I’m encountering an issue with the QSWAT plugin: it was working fine yesterday, but today when I tried to start the editor, I got the following XML parsing error:

2025-05-11T14:52:14     WARNING    Traceback (most recent call last):
  File "C:\Users\90747\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QSWAT\QSWAT\qswat.py", line 727, in startEditor
    self._gv.setSWATEditorParams()
  File "C:\Users\90747\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QSWAT\QSWAT\globals.py", line 524, in setSWATEditorParams
    tree = ET.parse(path)
    ^^^^^^^^^^^^^^
  File "C:\PROGRA~1\QGIS33~1.11\apps\Python312\Lib\xml\etree\ElementTree.py", line 1204, in parse
    tree.parse(source, parser)
  File "C:\PROGRA~1\QGIS33~1.11\apps\Python312\Lib\xml\etree\ElementTree.py", line 569, in parse
    self._root = parser._parse_whole(source)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 7, column 53

Environment Information:

  • QGIS Version: [ 3.34.11]
  • QSWAT Version: [2.01]
  • Operating System: Windows 11
  • SWAT Editor Installation Path: C:\SWAT\SWATEditor (confirmed installed)

Background:

  • QSWAT was running normally yesterday, and no manual changes were made to the software or configuration files today.
  • The error occurs when starting the QSWAT editor, possibly due to a corrupted or malformed XML configuration file.

Steps Already Tried:

  1. Checked the QSWAT plugin directory (C:\Users\90747\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QSWAT), but couldn’t locate the specific XML file.
  2. Reviewed the qswat.py file’s setSWATEditorParams method, confirmed the error is related to XML parsing, but couldn’t identify the file path.
  3. Verified whether QGIS or QSWAT had been updated, confirmed no version upgrades were performed.

Questions: Has anyone encountered a similar issue? Could this be caused by a corrupted or misconfigured XML file? How can I locate and fix this XML file? Is reinstalling QSWAT necessary? Thank you very much for your help!


Tamene Tadele

unread,
May 11, 2025, 6:40:36 AM5/11/25
to 刘涛, SWAT-MODFLOW

You  can easily fix it by reinstalling the SWAT Editor located in C, NOT QSWAT.


--
You received this message because you are subscribed to the Google Groups "SWAT-MODFLOW" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swat-modflow...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/swat-modflow/d7c15d55-a7f7-4fce-b111-078138507254n%40googlegroups.com.

lalalallaalla

unread,
May 11, 2025, 9:23:12 AM5/11/25
to Tamene Tadele, SWAT-MODFLOW

Thank you so much for your kind help! Thanks to your suggestion, I reinstalled SWAT Editor and successfully resolved the QSWAT XML parsing error. Your timely response and expert guidance made the fix process smooth, and I’m truly grateful. Heartfelt thanks for your support—please continue to guide me if I encounter any issues in the future!


 


------------------ 原始邮件 ------------------
发件人: "Tamene Tadele" <tamene...@gmail.com>;
发送时间: 2025年5月11日(星期天) 晚上6:40
收件人: "lalalallaalla"<9074...@qq.com>;
抄送: "SWAT-MODFLOW"<swat-m...@googlegroups.com>;
主题: Re: QSWAT Worked Fine Yesterday, Fails to Start Editor with XML Parsing Error Today

Tamene Tadele

unread,
May 11, 2025, 9:26:11 AM5/11/25
to lalalallaalla, SWAT-MODFLOW

Take it easy. You're not alone in the 🌎


Reply all
Reply to author
Forward
0 new messages