Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISBNNotConsistentError #142

Open
VBobCat opened this issue May 25, 2024 · 0 comments
Open

ISBNNotConsistentError #142

VBobCat opened this issue May 25, 2024 · 0 comments
Labels

Comments

@VBobCat
Copy link

VBobCat commented May 25, 2024

Code that raises the exception:

import isbnlib

data = isbnlib.meta('9780521614030', 'goob')

Exception traceback:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2023.2\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "F:\.venv\Lib\site-packages\isbnlib\_ext.py", line 25, in meta
    return query(isbn, service) if isbn else {}
           ^^^^^^^^^^^^^^^^^^^^
  File "F:\.venv\Lib\site-packages\isbnlib\dev\_decorators.py", line 27, in memoized_func
    value = func(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^
  File "F:\.venv\Lib\site-packages\isbnlib\_metadata.py", line 33, in query
    meta = services[service](isbn)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\.venv\Lib\site-packages\isbnlib\_goob.py", line 79, in query
    return _records(isbn, data)
           ^^^^^^^^^^^^^^^^^^^^
  File "F:\.venv\Lib\site-packages\isbnlib\_goob.py", line 60, in _records
    raise ISBNNotConsistentError('{0} not in {1}'.format(
isbnlib.dev._exceptions.ISBNNotConsistentError: isbn request != isbn response (9780521614030 not in [{'type': 'ISBN_10', 'identifier': '0521693764'}, {'type': 'ISBN_13', 'identifier': '9780521693769'}])

Data returned from google books (got it in breakpoint):

{
    "title": "Advanced grammar in use",
    "subtitle": "a self-study reference and practice book for advanced students of English : with answers",
    "authors": [
        "Martin Hewings"
    ],
    "publisher": "Cambridge University Press",
    "publishedDate": "2005",
    "description": "\"The book provides coverage of those language areas advanced-level students will find most rewarding to study. ... Two-page units present grammar explanation and examples, including typical student mistakes. ... A study guide helps students find those areas most appropriate for their study. Grammar areas are cross-referenced throughout the book. There are useful appendices dealing with verb forms, and a glossary and all answers are given at the back of the book. ... Extra practice is available on a new interactive CD-ROM to accompany the book.\"--Publisher.",
    "industryIdentifiers": [
        {
            "type": "ISBN_10",
            "identifier": "0521693764"
        },
        {
            "type": "ISBN_13",
            "identifier": "9780521693769"
        }
    ],
    "imageLinks": {
        "smallThumbnail": "http://books.google.com/books/content?id=8wOOE1CeXyYC&printsec=frontcover&img=1&zoom=5&edge=curl&source=gbs_api",
        "thumbnail": "http://books.google.com/books/content?id=8wOOE1CeXyYC&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api"
    },
    "language": "en"
}
@VBobCat VBobCat added the bug label May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant