[sword-devel] python3 , StrongsGreek and unicodeDecodeError

pierre amadio amadio.pierre at gmail.com
Sun Jun 16 15:02:54 EDT 2019


Hi there !

Playing with the python3 Sword module I hit a problem that I did not
have with python2 when dealing with Strongs definition such as G1140
(daimonion). It looks like the 'æ' character is causing problem.

This example works with python2, but generate an error when ran wiht python3:

##########
import Sword
library = Sword.SWMgr()
target=library.getModule("StrongsGreek")
vk=Sword.SWKey("1140")
target.setKey(vk)
strongEntry=target.renderText().getRawData()
###########

  File "/usr/local/sword/python3/lib64/python3.4/site-packages/Sword.py",
line 128, in getRawData
    def getRawData(self): return _Sword.SWBuf_getRawData(self)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position
73: invalid continuation byte

Anyone knows how to be able to catch the content of this entry in a
python variable ?



More information about the sword-devel mailing list