- Package:
- python3-wikitrans
- Source:
- python3-wikitrans
- Submitter:
- Luca Capello
- Date:
- 2024-07-11 10:39:04 UTC
- Severity:
- normal
Hi there,
after the dicod's `load python`[1] and `M4 quoting`[2], querying the
WikiMedia databases gives no match and the following errors in `dicod`:
```
root@harlock:~# /usr/bin/dicod --stderr -f
dicod: Info: dicod (GNU dico) 2.11 started
dicod: Info: Client info: "GNU dico 2.11"
dicod: Info: Client info: "GNU dico 2.11"
dicod: Debug: 57843 exited successfully
dicod: Info: Client info: "GNU dico 2.11"
dicod: Error: Traceback (most recent call last):
dicod: Error: File "/usr/share/dico/python/mediawiki.py", line 98, in define_word
dicod: Error: wikiparser = TextWiktionaryMarkup (text=data)
dicod: Error: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dicod: Error: File "/usr/lib/python3/dist-packages/wikitrans/wiki2text.py", line 278, in __init__
dicod: Error: super(TextWikiMarkup, self).__init__(*args, **keywords)
dicod: Error: File "/usr/lib/python3/dist-packages/wikitrans/wikimarkup.py", line 1028, in __init__
dicod: Error: self.text = keywords[kw].decode('utf-8').split("\n")
dicod: Error: ^^^^^^^^^^^^^^^^^^^
dicod: Error: AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
dicod: Debug: 57846 exited successfully
dicod: Debug: 57847 exited successfully
^Cdicod: Info: dicod (GNU dico) 2.11 terminating
root@harlock:~#
```
[1] <https://bugs.debian.org/1028487>
[2] <https://bugs.debian.org/1056351>
I am not a Python expert, the problem obviously disappears (and the
query succeeds) if I remove the conditional case at line 1027, which
seems bad to me since AFAIK only from Python3 `str` contains by
default UTF-8/Unicode characters[3] (and anyway user input could not
be in UTF-8):
```
elif kw == 'text':
if sys.version_info[0] > 2:
self.text = keywords[kw].decode('utf-8').split("\n")
else:
self.text = keywords[kw].split("\n")
```
[3] <https://docs.python.org/3/howto/unicode.html>
Thx, bye,
Gismo / Luca
We believe that the bug you reported is fixed in the latest version of wikitrans, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 1056360@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Marc Dequènes (Duck) <Duck@DuckCorp.org> (supplier of updated wikitrans package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org) Format: 1.8 Date: Mon, 08 Jul 2024 18:36:53 +0200 Source: wikitrans Architecture: source Version: 1.4-1 Distribution: unstable Urgency: medium Maintainer: Debian Python Team <team+python@tracker.debian.org> Changed-By: Marc Dequènes (Duck) <Duck@DuckCorp.org> Closes: 1056360 Changes: wikitrans (1.4-1) unstable; urgency=medium . * New upstream version 1.4 (Closes: #1056360) * Add d/gitlab-ci.yml * d/u/metadata: remove Homepage field * d/watch: update watch file standard * d/control: update standards version to 4.6.2 * d/control: Add Rules-Requires-Root: no * d/copyright: update copyright years Checksums-Sha1: 0b54b09ff8007096de25a67aac93ae06cf51c67f 2076 wikitrans_1.4-1.dsc 46137ce08ad232734cebfd50be15a05a7dd52573 67678 wikitrans_1.4.orig.tar.gz 4661a4600fe90fda504a7aaf2c69299aedf606f7 3116 wikitrans_1.4-1.debian.tar.xz 981a06958789d7c85455b02aed727205488f29b4 6772 wikitrans_1.4-1_amd64.buildinfo Checksums-Sha256: 26dc088fa1f65c8340036e149d8767e8fe186ce2dd65bfc1ccd18ea842e09ded 2076 wikitrans_1.4-1.dsc 99579ef820f476c287fc4fa27917560eef32dfb565ab9cc779c76ade71f8123f 67678 wikitrans_1.4.orig.tar.gz 15e3a558118766affa2ac6aac83b55d3870074994bd0fbd750059ed176f727b6 3116 wikitrans_1.4-1.debian.tar.xz 6db445d2ec7b9a6ff1bd414e05915975b9f20c48cd715d964452a40e8c47d0a5 6772 wikitrans_1.4-1_amd64.buildinfo Files: 531e2cb7f92be500b4894b32fc6a4ec3 2076 python optional wikitrans_1.4-1.dsc 69fe164c60637fbf77344df122261cae 67678 python optional wikitrans_1.4.orig.tar.gz a9a6e83d7f226614742bb1838a9853d4 3116 python optional wikitrans_1.4-1.debian.tar.xz e76b06398a7dc816dddbca1ef2c6a8e9 6772 python optional wikitrans_1.4-1_amd64.buildinfo -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcpcqg+UmRT3yiF+BVen596wcRD8FAmaPsckACgkQVen596wc RD86ZA//b6MDL4xstaN6E+1bgwg5vheojDq9Oi+klhKzxO1B+nlaN8D9bGdV4jM4 QPPAsx5c5ADNsuqbP4xI8upN4ny6G0aq/sC2k2MV0mgEJzsMsNIQXGyZ31UNLA9e z2/Zh6JCdwTpcUuDT/o4fbU0fumgjVIIAvRAzGk7jEhGcY8iT+9XqHPvERWGOZZM Ht5ClqNwwV0AiLTcz0UrB2WaOXq9qDnXAnxvhgATYIFhitxPUlbRYids3ePJ2VIm VnkjIUklqI/zAguBpKYsH0IeDwjtVOPl2imVtrxJtbMWDAEa3pn435haAx4ZC0g4 /AfEIkQ3GtwutUkgmXsvfwnDgIDBmKaVslxphycp70cXbe0/mM00yp5jy+ObZEsY Ir6rFCu1ylxRVfZErowG5BsfC87hGwLvFFSypH6xuIDfiJ0q5F29spaJ5xlHYQwM +ZtctrfWd+C6O+h9SpLWaNRKs2sTdsCejkao1u6sBlaIDyGybWk9IEd/1FyW9eoI 4TPXidZoCEpRwklAeY+CGFhjlEjEDWjjt0jcYDgWH0s2p83fPFVt/CbqRNjM9RBF pi56yof8kxixY8U+EZ8LiCzeUVwF+vwZDFd4xAQ9TBfv4w0KEcm88VYfBeCS5LB+ 2uzExJkvHxZvCeuU09ff2RFOvICTLUl0Q2yPzT4cFeQYFJs7GZg= =L30F -----END PGP SIGNATURE-----