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

Random struct.error exceptions thrown sometimes #3

Open
abdnh opened this issue Sep 28, 2022 · 1 comment
Open

Random struct.error exceptions thrown sometimes #3

abdnh opened this issue Sep 28, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@abdnh
Copy link
Owner

abdnh commented Sep 28, 2022

Probably an issue in ZIMply/ZIMply-core. Reported in kimbauters/ZIMply#31

Currently, the pop-up dictionary is simply swallowing up the errors, as it doesn't seem to visibly affect resource loading as far as I can tell.

@abdnh abdnh added the bug Something isn't working label Sep 28, 2022
@abdnh
Copy link
Owner Author

abdnh commented Sep 29, 2022

A random issue with ValueError exceptions being thrown was also reported:

Traceback (most recent call last):
  File "flask.app", line 2073, in wsgi_app
  File "flask.app", line 1518, in full_dispatch_request
  File "flask.app", line 1516, in full_dispatch_request
  File "flask.app", line 1502, in dispatch_request
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\server.py", line 90, in handle_request
    article = zim_server.dictionary.zim_client.get_article(path)
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\vendor\zimply_core\zim_core.py", line 1244, in get_article
    article = self._zim_file.get_article_by_url(namespace, url, follow_redirect=follow_redirect)
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\vendor\zimply_core\zim_core.py", line 685, in get_article_by_url
    return self._get_article_by_index(idx, follow_redirect=follow_redirect)
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\vendor\zimply_core\zim_core.py", line 627, in _get_article_by_index
    result = self._read_blob(entry["clusterNumber"], entry["blobNumber"], return_offset)
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\vendor\zimply_core\zim_core.py", line 603, in _read_blob
    return cluster_data.read_blob(blob_index, return_offset=return_offset)
  File "C:\Users\Abdo\AppData\Roaming\Anki2\addons21\zim_reader\vendor\zimply_core\zim_core.py", line 374, in read_blob
    return data_buffer.read(blob_size) if not return_offset else data_buffer.tell()
ValueError: read length must be non-negative or -1

I've not been able to reproduce it yet and not sure if it's related.

abdnh added a commit that referenced this issue Oct 5, 2022
This should fix #7
I'm not sure yet if this is the sole cause of #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant