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

traceback on inconsistent journal object type and content #27

Open
quozl opened this issue Sep 17, 2018 · 0 comments
Open

traceback on inconsistent journal object type and content #27

quozl opened this issue Sep 17, 2018 · 0 comments

Comments

@quozl
Copy link
Contributor

quozl commented Sep 17, 2018

When a journal object with MIME-type set to application/pdf actually contains text/plain, Read reports this log;

1536845187.043496 ERROR read-activity: Can not load document:
  ev-document-error-quark: File type plain text document (text/plain) is not supported (0)

Traceback (most recent call last):
  File "/usr/bin/sugar-activity", line 219, in <module>
    main()
  File "/usr/bin/sugar-activity", line 214, in main
    instance = create_activity_instance(activity_constructor, activity_handle)
  File "/usr/bin/sugar-activity", line 48, in create_activity_instance
    activity = constructor(handle)
  File "/home/ibiam/Activities/read-activity/readactivity.py", line 366, in __init__
    self.read_file(self._jobject.file_path)
  File "/home/ibiam/Activities/read-activity/readactivity.py", line 731, in read_file
    self._load_document('file://' + tempfile)
  File "/home/ibiam/Activities/read-activity/readactivity.py", line 1033, in _load_document
    self._update_toc()
  File "/home/ibiam/Activities/read-activity/readactivity.py", line 611, in _update_toc
    if self._view.update_toc(self):
  File "/home/ibiam/Activities/read-activity/evinceadapter.py", line 278, in update_toc
    if not doc.has_document_links():
AttributeError: 'NoneType' object has no attribute 'has_document_links'

Reported by @chimosky.

Workaround; delete the journal object, it is corrupt. If the journal object can be created by any activity, then that other activity should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant