Numbertext / libnumbertext

Number to number name and money text conversion libraries in C++, Java, JavaScript and Python & LibreOffice Calc Extension
BSD 3-Clause "New" or "Revised" License
67 stars 46 forks source link

FutureWarning: Possible nested set at position X #61

Closed reneengelhard closed 2 years ago

reneengelhard commented 4 years ago

Hi,

when running a numbertext with python3 (as for LibreOffice - here built against system-python which is 3.7.3 currently - and the LO extension installed) I get

/usr/lib/libreoffice/share/extensions/numbertext/pythonpath/org/Numbertext/Soros.py:44: FutureWarning: Possible nested set at position 26
  prg = re.sub(r"(^|[\n;])([^\n;#]*#[^\n]*[[]:[^\n:\]]*:][^\n]*)", r"\1#\2", prg)
/usr/lib/libreoffice/share/extensions/numbertext/pythonpath/org/Numbertext/Soros.py:45: FutureWarning: Possible nested set at position 27
  prg = re.sub(r"(^|[\n;])#([^\n;#]*#[^\n]*[[]:" + lang.replace("_", "-") + r":][^\n]*)", r"\1\2", prg)
/usr/lib/libreoffice/share/extensions/numbertext/pythonpath/org/Numbertext/Soros.py:73: FutureWarning: Possible nested set at position 1
  s2 = re.sub(r"[[]\$(\d\d?|\([^\)]+\))",u"$(\uE00A\uE00A|$\\1\uE00A", s2)
/usr/lib/libreoffice/share/extensions/numbertext/pythonpath/org/Numbertext/Soros.py:74: FutureWarning: Possible nested set at position 1
  s2 = re.sub(r"[[]([^\$[\\]*)\$(\d\d?|\([^\)]+\))",u"$(\uE00A\\1\uE00A$\\2\uE00A", s2)

printed on the console, which doesn't really sound very well. A trivial test (=NUMBERTEXT(10)) works, but..

The same happens if you patch the numbertext makefiles to use python3, and thus it it printed during the tests, see for example https://buildd.debian.org/status/fetch.php?pkg=libnumbertext&arch=amd64&ver=1.0.5-3&stamp=1567490482&raw=0

Regards,

Rene

reneengelhard commented 4 years ago

still in 1.0.6

laszlonemeth commented 2 years ago

Hi Rene,

Fixed in https://github.com/Numbertext/libnumbertext/commit/8810ddf61fdb830911fe85caaf9beceffe5fc26a

Thanks for the bug report!

Best regards, László