Zim

Empty links forbid page display

Bug #1067001 reported by Rui Nibau
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Fix Released
Undecided
Unassigned

Bug Description

A page with empty links, i.e. without url ("[[text|]]"), forbid page display.

Here's a Traceback :

----

This is zim 0.57
Python version is sys.version_info(major=2, minor=7, micro=3,
releaselevel='final', serial=0)
Gtk version is (2, 24, 11)
Pygtk version is (2, 24, 0)
Platform is posix
No bzr version-info found

======= Traceback =======
File "/[PATH]/zim/zim/gui/pageview.py", line 4649, in set_page
self.set_parsetree(tree, bool(template))
File "/[PATH]/zim/zim/gui/pageview.py", line 4740, in set_parsetree
buffer.set_parsetree(tree)
File "/[PATH]/zim/zim/gui/pageview.py", line 603, in set_parsetree
self.insert_parsetree_at_cursor(tree)
File "/[PATH]/zim/zim/gui/pageview.py", line 670, in insert_parsetree_at_cursor
self._insert_element_children(root, raw=raw)
File "/[PATH]/zim/zim/gui/pageview.py", line 743, in _insert_element_children
self._insert_element_children(element, list_level=list_level, raw=raw) # recurs
File "/[PATH]/zim/zim/gui/pageview.py", line 784, in _insert_element_children
self.insert_link_at_cursor(element.text, **element.attrib)
File "/[PATH]/zim/zim/gui/pageview.py", line 841, in insert_link_at_cursor
self.insert_at_cursor(text)
TypeError: GtkTextBuffer.insert_at_cursor() argument 1 must be string or read-only buffer, not None

----

Removing the empty links resolve the problem.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Will commit fix + test case in rev 608

Changed in zim:
status: New → Fix Committed
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fix released in zim 0.58

Changed in zim:
status: Fix Committed → Fix Released
Revision history for this message
Geoffroy Ménard (geoffmen) wrote :

Fixed in 0.58? Then is this a different bug?

This is zim 0.58
Python version is sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
Gtk version is (2, 24, 10)
Pygtk version is (2, 24, 0)
Platform is nt
Zim revision is:
  branch: pyzim
  revision: 631 <email address hidden>
  date: 2012-12-15 18:54:31 +0100

======= Traceback =======
  File "zim\gui\pageview.pyo", line 4654, in set_page
  File "zim\gui\pageview.pyo", line 4745, in set_parsetree
  File "zim\gui\pageview.pyo", line 605, in set_parsetree
  File "zim\gui\pageview.pyo", line 672, in insert_parsetree_at_cursor
  File "zim\gui\pageview.pyo", line 778, in _insert_element_children
  File "zim\gui\pageview.pyo", line 789, in _insert_element_children
  File "zim\gui\pageview.pyo", line 932, in insert_tag_at_cursor
TypeError: GtkTextBuffer.insert_at_cursor() argument 1 must be string or read-only buffer, not None

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 1067001] Re: Empty links forbid page display

Yes it is a different bug, this error pops up from the "insert_tag"
method, not "insert_link" so I expect it is related to a malformed tag
in the page. Please open a new bug report and add example text that
causes this.

Thanks,

Jaap

Revision history for this message
Geoffroy Ménard (geoffmen) wrote :

I'll open a new bug report but there aren't any tags in the page...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.