No preview if page has links (some database error)

28 views
Skip to first unread message

Bjorn

unread,
Nov 9, 2019, 5:51:34 AM11/9/19
to wikidpad-devel
Hi, I run wikidpad from source on python 3.7.0 and wxpython 4.0.4 on linux mint. I get an error I don't understand
when trying to either use the preview *or* export to html. If the page does NOT have links to other pages or images
the preview works. Normal file links in the page works as well. I can run the exact same setup on windows and everything works.
The traceback below suggests some failure connected to the database.

Help appreciated as I recently found it very useful to use the preview! 

Thanks, björn

Traceback (most recent call last):
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/PersonalWikiFrame.py", line 1614, in <lambda>
    lambda evt: self.setDocPagePresenterSubControl(None),  "tb_switch ed prev",
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/PersonalWikiFrame.py", line 5153, in setDocPagePresenterSubControl
    presenter)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/MainAreaPanel.py", line 577, in switchDocPagePresenterTabEditorPreview
    presenter.switchSubControl("preview", gainFocus=True)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/DocPagePresenter.py", line 421, in switchSubControl
    subControl.setLayerVisible(True)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/WikiHtmlView.py", line 186, in setLayerVisible
    self.refresh()
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/WikiHtmlView.py", line 281, in refresh
    html = self.exporterInstance.exportWikiPageToHtmlString(wikiPage)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/extensions/HtmlExporter.py", line 1085, in exportWikiPageToHtmlString
    formattedContent = self.formatContent(wikiPage)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/extensions/HtmlExporter.py", line 1500, in formatContent
    self.processAst(content, self.basePageAst)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/extensions/HtmlExporter.py", line 2526, in processAst
    if not self.processAstNode(node, content, pageAst):
  File "/home/bjorn/python_packages/WikidPad/WikidPad/extensions/HtmlExporter.py", line 2670, in processAstNode
    self._processWikiWord(node, content)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/extensions/HtmlExporter.py", line 2252, in _processWikiWord
    self.wikiDocument.getWikiPageNameForLinkTerm(wikiWord)):
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/WikiDocument.py", line 2363, in getWikiPageNameForLinkTerm
    return self.getWikiData().getWikiPageNameForLinkTerm(word)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/WikiDocument.py", line 259, in __call__
    return self.callFunction(*args, **kwargs)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/WikiData.py", line 1898, in getWikiPageNameForLinkTerm
    return self._getCachedWikiPageLinkTermDict().get(alias, None)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/WikiData.py", line 1215, in get
    value = self._lookup(key)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/WikiData.py", line 1229, in _lookup
    if self.outer.isDefinedWikiPageName(key):
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/WikiData.py", line 1116, in isDefinedWikiPageName
    "select 1 from wikiwords where word = ?", (word,)))
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/DbStructure.py", line 97, in execSqlQuerySingleItem
    self.dbCursor.execute(sql, params)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/sqlite3api.py", line 335, in execute
    self.stmt[0].bind_auto_multi(parameters, fctfinder=bindfct)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/SqliteThin3.py", line 447, in bind_auto_multi
    self.bind_auto(i, datas[i-1], fctfinder)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/SqliteThin3.py", line 434, in bind_auto
    fctfinder(self, parno, data)(self, parno, data)
TypeError: 'NoneType' object is not callable



Michael Butscher

unread,
Nov 10, 2019, 4:32:12 AM11/10/19
to wikidpa...@googlegroups.com
On 09.11.2019 11:51, Bjorn wrote:
> Hi, I run wikidpad from source on python 3.7.0 and wxpython 4.0.4 on linux
> mint. I get an error I don't understand
> when trying to either use the preview *or* export to html. If the page does
> NOT have links to other pages or images
> the preview works. Normal file links in the page works as well. I can run
> the exact same setup on windows and everything works.
> The traceback below suggests some failure connected to the database.
>
> Help appreciated as I recently found it very useful to use the preview!

I attached a temporary replacement for the file
"WikidPad/lib/pwiki/SqliteThin3.py".

Unfortunately it will not fix the bug but should at least produce a more helpful
error message at the end of the traceback.



Michael


SqliteThin3.py

Bjorn

unread,
Nov 11, 2019, 12:12:47 PM11/11/19
to wikidpad-devel
Thanks! I will try it out.

Bjorn

unread,
Nov 11, 2019, 12:18:00 PM11/11/19
to wikidpad-devel
With the new SqliteThin3.py, the error message is this:

  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/wikidata/original_sqlite/DbStructure.py", line 98, in execSqlQuerySingleItem
    self.dbCursor.execute(sql, params)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/sqlite3api.py", line 335, in execute
    self.stmt[0].bind_auto_multi(parameters, fctfinder=bindfct)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/SqliteThin3.py", line 453, in bind_auto_multi
    self.bind_auto(i, datas[i-1], fctfinder)
  File "/home/bjorn/python_packages/WikidPad/WikidPad/lib/pwiki/SqliteThin3.py", line 437, in bind_auto
    raise TypeError("SqliteThin3: bind_auto: Type {} of parameter {} (content: {}) can't be bound: No bindfct".format(repr(type(data)), parno, repr(data)))
TypeError: SqliteThin3: bind_auto: Type <class 'WikidPad.lib.pwiki.WikiPyparsing.NonTerminalNode'> of parameter 1 (content: NonTerminalNode(88, 2, 'wikiWord', [TerminalNode(88, 2, 'word', 'TE')], {'_calcedStrLength': 2, 'wikiWord': 'TE', 'linkPath': _WikiLinkPath(upwardCount=1, components=['TE']), 'formatType': 'cc', 'titleNode': None, 'fragmentNode': None, 'searchFragment': None, 'anchorLink': None})) can't be bound: No bindfct







On Sunday, November 10, 2019 at 9:32:12 AM UTC, Michael Butscher wrote:

Bjorn

unread,
Nov 11, 2019, 12:30:44 PM11/11/19
to wikidpad-devel
Seems like my custom wikidpadparser has rotted! Ill update it and see if it works!



On Sunday, November 10, 2019 at 9:32:12 AM UTC, Michael Butscher wrote:

Bjorn

unread,
Nov 12, 2019, 1:22:12 AM11/12/19
to wikidpad-devel
Seems like the offending line in my wikidpadparser was 

from WikidPad.lib.pwiki.WikiPyparsing import *

When changed to 

from pwiki.WikiPyparsing import *

I works again!
Reply all
Reply to author
Forward
0 new messages