Page MenuHomePhabricator

isbn library and isbn.py is very outdated
Closed, ResolvedPublic

Description

The current libraries doesn't recognize the right group numbers therefore isbn_test fails:

16:45:18 
16:45:18 ======================================================================
16:45:18 FAIL: Test ISBN.
16:45:18 ----------------------------------------------------------------------
16:45:18 Traceback (most recent call last):
16:45:18   File "/mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/tests/isbn_tests.py", line 55, in test_valid_isbn
16:45:18     self.assertEqual(text, ' ISBN 978-3-95539-063-1 ')
16:45:18 AssertionError: u' ISBN 978-3-9553906-3-1 ' != u' ISBN 978-3-95539-063-1 '
16:45:18 -  ISBN 978-3-9553906-3-1 
16:45:18 ?                    -
16:45:18 +  ISBN 978-3-95539-063-1 
16:45:18 ?                  +
16:45:18 
16:45:18 -------------------- >> begin captured logging << --------------------
16:45:18 vcr.cassette: DEBUG: Entering context for cassette at test_valid_isbn (tests.isbn_tests.TestCosmeticChangesISBN).yaml.
16:45:18 py.warnings: WARNING: /mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/pywikibot/cosmetic_changes.py:157: ImportWarning: package stdnum.isbn not found; using scripts.isbn
16:45:18 py.warnings: WARNING: /mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/pywikibot/cosmetic_changes.py:157: ImportWarning: package stdnum.isbn not found; using scripts.isbn
16:45:18 py.warnings: WARNING: /mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/pywikibot/cosmetic_changes.py:157: ImportWarning: package stdnum.isbn not found; using scripts.isbn
16:45:18 --------------------- >> end captured logging << ---------------------
16:45:18 
16:45:18 ======================================================================
16:45:18 FAIL: Test things that apply both to ISBN10 and ISBN13.
16:45:18 ----------------------------------------------------------------------
16:45:18 Traceback (most recent call last):
16:45:18   File "/mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/tests/isbn_tests.py", line 148, in test_general
16:45:18     'ISBN 979-10-91447-08-9')
16:45:18 AssertionError: u'ISBN 979-1-09-144708-9' != u'ISBN 979-10-91447-08-9'
16:45:18 - ISBN 979-1-09-144708-9
16:45:18 ?            - -
16:45:18 + ISBN 979-10-91447-08-9
16:45:18 ?           +      +
16:45:18 
16:45:18 -------------------- >> begin captured logging << --------------------
16:45:18 vcr.cassette: DEBUG: Entering context for cassette at test_general (tests.isbn_tests.TestIsbn).yaml.
16:45:18 --------------------- >> end captured logging << ---------------------
16:45:18 
16:45:18 ======================================================================
16:45:18 FAIL: Test ISBN13 with prefix 979.
16:45:18 ----------------------------------------------------------------------
16:45:18 Traceback (most recent call last):
16:45:18   File "/mnt/jenkins-workspace/workspace/pywikibot-core-tox-nose/tests/isbn_tests.py", line 130, in test_isbn13_979
16:45:18     self.assertEqual(isbn.code, '979-10-91447-08-9')
16:45:18 AssertionError: u'979-1-09-144708-9' != u'979-10-91447-08-9'
16:45:18 - 979-1-09-144708-9
16:45:18 ?       - -
16:45:18 + 979-10-91447-08-9
16:45:18 ?      +      +
16:45:18 
16:45:18 -------------------- >> begin captured logging << --------------------
16:45:18 vcr.cassette: DEBUG: Entering context for cassette at test_isbn13_979 (tests.isbn_tests.TestIsbn).yaml.
16:45:18 --------------------- >> end captured logging << ---------------------
16:45:18

Event Timeline

Xqt created this task.Aug 30 2016, 4:57 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptAug 30 2016, 4:57 PM
Xqt triaged this task as High priority.Aug 30 2016, 4:57 PM
Xqt removed a project: Pywikibot-i18n.

Change 209176 had a related patch set uploaded (by Xqt):
[bugfix] Use RangeMessage map xml file from International ISBN Agency

https://gerrit.wikimedia.org/r/209176

Change 313795 had a related patch set uploaded (by Xqt):
[bugfix] Temporary deactivate isbn formatting inside cosmetic changes

https://gerrit.wikimedia.org/r/313795

Change 313795 merged by jenkins-bot:
[bugfix] Temporary deactivate isbn formatting inside cosmetic changes

https://gerrit.wikimedia.org/r/313795

Change 209176 abandoned by Multichill:
[bugfix] Use RangeMessage map xml file from International ISBN Agency

Reason:
No response. This can always be re-opened if you plan to work on it again.

https://gerrit.wikimedia.org/r/209176

D3r1ck01 moved this task from Backlog to Needs Review on the Pywikibot board.Nov 5 2018, 11:30 AM

Change 565784 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Remove isbn library of isbn.py in favour of stdnum

https://gerrit.wikimedia.org/r/565784

Change 565784 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Remove isbn library of isbn.py in favour of stdnum

https://gerrit.wikimedia.org/r/565784

Xqt closed this task as Resolved.Jan 30 2020, 2:11 PM
Xqt removed a project: Patch-For-Review.