Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

test-xmp-broken.test.test_no_verbatim: AssertionError: 'XMP metadata error: XMP Toolkit error 201: Error in XMLValidator\n' != … #149

Closed
Kamilcuk opened this issue Nov 18, 2021 · 3 comments
Assignees

Comments

@Kamilcuk
Copy link

Kamilcuk commented Nov 18, 2021

I am using archlinux with /usr/lib/libexiv2.so.27 $ pacman -Q exiv2 -> exiv2 0.27.5-1. The issue also affects other people: https://aur.archlinux.org/packages/pdf2djvu/ .

I get the following error when running tests:

$ pdf2djvu=../pdf2djvu LC_ALL=C PYTHON=2 nosetests2 -v test-xmp-broken.py
test-xmp-broken.test.test_no_verbatim ... FAIL
test-xmp-broken.test.test_verbatim ... ok

======================================================================
FAIL: test-xmp-broken.test.test_no_verbatim
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.py", line 30, in test_no_verbatim
    r.assert_(stderr='XMP metadata error: XMP Toolkit error 201: XML parsing failure\n')
  File "/home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/tools.py", line 98, in assert_
    assert_multi_line_equal(self.stderr, stderr)
AssertionError: 'XMP metadata error: XMP Toolkit error 201: Error in XMLValidator\n' != 'XMP metadata error: XMP Toolkit error 201: XML parsing failure\n'
- XMP metadata error: XMP Toolkit error 201: Error in XMLValidator
?                                            ---------   ^  ^^^^^
+ XMP metadata error: XMP Toolkit error 201: XML parsing failure
?                                               ^^ +++++++++ ^ +

-------------------- >> begin captured stdout << ---------------------
$ ../pdf2djvu -q /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.pdf -o /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.djvu --version
$ ../pdf2djvu -q /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.pdf -o /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.djvu

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 2 tests in 0.335s

FAILED (failures=1)

The error happens on exiv2 side, and wasn't there before:

$ ,gdbbatchrun ../pdf2djvu -q /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.pdf -o /home/kamil/.cache/yay/pdf2djvu/src/pdf2djvu-0.9.18.1/tests/test-xmp-broken.djvu
....
#2  0x00005555555686f4 in error_handler(int, char const*) ()
#3  0x00007ffff7605253 in Exiv2::LogMsg::~LogMsg() () from /usr/lib/libexiv2.so.27
#4  0x00007ffff7533e2f in ?? () from /usr/lib/libexiv2.so.27
#5  0x00005555555945a5 in xmp::transform(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, pdf::Metadata const&) ()
#6  0x000055555557eb43 in xmain(int, char* const*) [clone .isra.0] ()
#7  0x0000555555568bf1 in main ()

Commit Exiv2/exiv2@b35cc5f changed error messages in exiv2 side. The test checks for wrong string - upstream changed. Is it possible to add regex in _assert or write two _assert? Or maybe choose the message depending on if ldd ../pdf2djvu | grep libexiv2 | sed 's/.*\.\([0-9]*\) =>.*/\1/' is greater than 26?

@edit Is it possible to add regex in _assert Well... so... so I added a pull request with the regex, it works on my part.

@jwilk jwilk changed the title Fix testcase with newer libexiv2 test-xmp-broken.test.test_no_verbatim: AssertionError: 'XMP metadata error: XMP Toolkit error 201: Error in XMLValidator\n' != … Nov 18, 2021
@jwilk jwilk self-assigned this Nov 18, 2021
jwilk added a commit that referenced this issue Nov 18, 2021
Fixes:

    ======================================================================
    FAIL: test-xmp-broken.test.test_no_verbatim
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
        self.test(*self.arg)
      File ".../pdf2djvu/tests/test-xmp-broken.py", line 30, in test_no_verbatim
        r.assert_(stderr='XMP metadata error: XMP Toolkit error 201: XML parsing failure\n')
      File ".../pdf2djvu/tests/tools.py", line 98, in assert_
        assert_multi_line_equal(self.stderr, stderr)
    AssertionError: 'XMP metadata error: XMP Toolkit error 201: Error in XMLValidator\n' != 'XMP metadata error: XMP Toolkit error 201: XML parsing failure\n'
    - XMP metadata error: XMP Toolkit error 201: Error in XMLValidator
    ?                                            ---------   ^  ^^^^^
    + XMP metadata error: XMP Toolkit error 201: XML parsing failure
    ?                                               ^^ +++++++++ ^ +

    -------------------- >> begin captured stdout << ---------------------
    $ ../pdf2djvu -q .../pdf2djvu/tests/test-xmp-broken.pdf -o .../pdf2djvu/tests/test-xmp-broken.djvu --version
    $ ../pdf2djvu -q .../pdf2djvu/tests/test-xmp-broken.pdf -o .../pdf2djvu/tests/test-xmp-broken.djvu

    --------------------- >> end captured stdout << ----------------------

with Exiv2 >= 0.27.5.

Exiv2/exiv2@411f1af067ca8e07
#149
@Kamilcuk
Copy link
Author

Kamilcuk commented Nov 18, 2021

Works fine. It's fixed.

@jwilk jwilk reopened this Nov 19, 2021
@jwilk
Copy link
Member

jwilk commented Nov 19, 2021

Let's keep the issue open until it's fixed in a release.

@jwilk
Copy link
Member

jwilk commented Nov 22, 2021

Fixed in 0.9.18.2.

@jwilk jwilk closed this as completed Nov 22, 2021
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Apr 3, 2022
Add poppler-22.03 compatibility patches from upstream.

pdf2djvu (0.9.18.2) unstable; urgency=low

  * Document minimum required Exiv2 version.
  * Fix build failure with upcoming Exiv2 1.0.
  * Remove spurious zero-width spaces from the Ukrainian manual page.
  * Improve the test suite:
    + Fix test failure with Exiv2 ≥ 0.27.5.
      Thanks to Kamil Cukrowski for the bug report and the initial patch.
      jwilk-archive/pdf2djvu#149

 -- Jakub Wilk <jwilk@jwilk.net>  Mon, 22 Nov 2021 18:38:23 +0100

pdf2djvu (0.9.18.1) unstable; urgency=low

  * Fix build failure with Poppler ≥ 21.10.
  * Windows: don't hardcode Poppler data path in the library.

 -- Jakub Wilk <jwilk@jwilk.net>  Wed, 13 Oct 2021 14:48:56 +0200

pdf2djvu (0.9.18) unstable; urgency=low

  [ Ilia Gobjila ]
  * Fix typo in the Russian documentation.

  [ Atri Bhattacharya ]
  * Fix configure check for Poppler ≥ 20.12.
    Thanks to Evangelos Foutras for the bug report.
    jwilk-archive/pdf2djvu#144

  [ Jakub Wilk ]
  * Fix build failure with GCC 11.
    jwilk-archive/pdf2djvu#146
  * Upgrade libraries bundled with the Windows package:
    - Poppler to 21.06;
    - poppler-data to 0.4.10;
    - DjVuLibre to 3.5.28;
    - GraphicsMagick to 1.3.36;
    - Expat to 2.4.1;
    - Exiv2 to 0.27.3;
    - FreeType to 2.10.4;
    - OpenJPEG to 2.4.0.
  * Drop support for Python 2.6.

 -- Jakub Wilk <jwilk@jwilk.net>  Mon, 07 Jun 2021 20:04:15 +0200
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants