1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

parser: Make failure to load main document a warning

Revert the change that made failures to load the main document an error.

This fixes the --path option of xmllint and xsltproc.

Should fix #733.
This commit is contained in:
Nick Wellnhofer
2024-06-14 19:42:40 +02:00
parent 2f12809612
commit 2608baaf92
12 changed files with 35 additions and 35 deletions

View File

@@ -10,7 +10,7 @@ import libxml2
# Memory debug specific
libxml2.debugMemory(1)
expect='--> I/O --> error : --> failed to load "missing.xml": No such file or directory\n'
expect='--> I/O --> warning : --> failed to load "missing.xml": No such file or directory\n'
err=""
def callback(ctx, str):
global err

View File

@@ -90,7 +90,7 @@ run_test(desc="Loading entity without custom callback",
docpath=startURL, catalog=None,
exp_status="not loaded", exp_err=[
(-1, "I/O "),
(-1, "error : "),
(-1, "warning : "),
(-1, "failed to load \"py://strings/xml/sample.xml\": No such file or directory\n")
])
@@ -121,7 +121,7 @@ run_test(desc="Retry loading document after unregistering callback",
docpath=startURL, catalog=catURL,
exp_status="not loaded", exp_err=[
(-1, "I/O "),
(-1, "error : "),
(-1, "warning : "),
(-1, "failed to load \"py://strings/xml/sample.xml\": No such file or directory\n")
])
@@ -141,7 +141,7 @@ run_test(desc="Loading using standard i/o after unregistering all callbacks",
docpath="tst.xml", catalog=None,
exp_status="not loaded", exp_err=[
(-1, "I/O "),
(-1, "error : "),
(-1, "warning : "),
(-1, "failed to load \"tst.xml\": No such file or directory\n")
])

View File

@@ -60,7 +60,7 @@ class TestCase(unittest.TestCase):
domain=libxml2.XML_FROM_IO,
code=libxml2.XML_IO_ENOENT,
message='failed to load "dummy.xml": No such file or directory\n',
level=libxml2.XML_ERR_FATAL,
level=libxml2.XML_ERR_WARNING,
file=None,
line=0)