[Python-modules-team] Bug#991917: python3-wikitrans: Wiki 2 html conversion errors

Erich Schubert erich at debian.org
Thu Aug 5 12:51:43 BST 2021


Package: python3-wikitrans
Version: 1.3-1
Severity: important
Tags: upstream
X-Debbugs-Cc: gray at gnu.org

Unfortunately, the wikitrans package fails to convert wiki to html quite 
often.

Here are some errors I noticed when processing the Simpsons fandom wiki:

1. This upstream patch should be included in the package:

https://git.gnu.org.ua/wikitrans.git/commit/?id=c785e3ad767b12a13ae75a3513ec88a4d1144210

2. A wrong variable name is used here:
File "/usr/lib/python3/dist-packages/wikitrans/wikimarkup.py", line 662, in
parse_ref
list.append(self.parse_tag(tok))
TypeError: descriptor 'append' for 'list' objects doesn't apply to a
'HtmlTagNode' object

Here, `list` is the standard class, the instance apparently was renamed to
`seq` in some places. Looks like a copy and paste error to me, as in other
location the local variable is named `list`.

https://git.gnu.org.ua/wikitrans.git/tree/wikitrans/wikimarkup.py?id=c785e3ad767b12a13ae75a3513ec88a4d1144210#n662

3. WikiDelimNodes (generated by wikimarkup: ''Example'') cause raw JSON 
to be
inserted in the HTML:

{"content": "''", "type": "DELIM", "wikinode": "WikiDelimNode"}

A simple workaround (but not a proper solution) is to override the __str__
method as follows:

wikitrans.wiki2html.WikiDelimNode.__str__ = lambda self: ""

Alternatively, one could return `self.content`, but a proper solution 
would be
to generate opening and closing em and bold tags I guess; but I am only
interested in the text, so this hotfix works for me.

-- System Information:
Debian Release: 11.0
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: 
LC_ALL
set to de_DE.utf-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-wikitrans depends on:
ii python3 3.9.2-3

python3-wikitrans recommends no packages.

python3-wikitrans suggests no packages.



More information about the Python-modules-team mailing list