Package Details: python-num2words 0.5.10-2

Git Clone URL: (read-only, click to copy)
Package Base: python-num2words
Description: Python modules to convert numbers to words.
Upstream URL:
Licenses: LGPL
Submitter: ImNtReal
Maintainer: Rogach
Last Packager: Rogach
Votes: 3
Popularity: 0.000042
First Submitted: 2017-07-31 17:29
Last Updated: 2020-12-30 17:09

Latest Comments

1 2 Next › Last »

Rogach commented on 2020-12-30 16:18

I've split python2 version into a separate package, it's still here if somebody needs it:

Rogach commented on 2020-09-16 08:50

@a.kudelin I usually take the approach of "don't break it if it's not broken". It works for now, and I do not have any package download statistics that can be used to justify removal of the feature.

a.kudelin commented on 2020-09-16 08:25

Maybe it's worth to remove python2 dependency? Arch Linux is in the course to get away from it.

Rogach commented on 2020-09-07 17:09

@genofire Are you sure? I don't see any references to wheel in the repository, and we use directly (we do not download the pre-built binary package).

genofire commented on 2020-09-07 15:31

Missing dependency: python-wheel

greyltc commented on 2019-09-26 17:55

Why not just stop building this for python2? 2 is dead anyway

Rogach commented on 2019-09-06 21:20

Test failures happen mostly because cli test runner refers to executable simply as python, regardless of what version it was invoked with. So when running python2 test environment and dependencies are set up for Python 2, but the Python 3 interpreter is invoked instead and the dependency resolution fails.

Also there seems to be an issue with Unicode output when using Python 2.

Below is the patch that fixes both problems and allows the package to build successfully for both python versions.

diff -ruN num2words-0.5.10.orig/bin/num2words num2words-0.5.10/bin/num2words
--- num2words-0.5.10.orig/bin/num2words 2019-09-07 00:06:15.933230111 +0300
+++ num2words-0.5.10/bin/num2words  2019-09-07 00:08:57.515532720 +0300
@@ -82,7 +82,7 @@
         words = num2words.num2words(args['<number>'], lang=args['--lang'], to=args['--to'])
-        sys.stdout.write(words+os.linesep)
+        sys.stdout.write((words.encode("utf-8") if sys.version_info[0] == 2 else words) + os.linesep)
     except Exception as err:
diff -ruN num2words-0.5.10.orig/tests/ num2words-0.5.10/tests/
--- num2words-0.5.10.orig/tests/ 2019-09-07 00:06:15.939896873 +0300
+++ num2words-0.5.10/tests/  2019-09-07 00:06:40.363578331 +0300
@@ -20,6 +20,7 @@

 import os
 import unittest
+import sys

 import delegator

@@ -31,7 +32,7 @@
     def __init__(self):
         self.cmd = os.path.realpath(os.path.join(os.path.dirname(__file__),
                                     "..", "bin", "num2words"))
-        self.cmd_list = ["python", self.cmd]
+        self.cmd_list = [sys.executable, self.cmd]

     def run_cmd(self, *args):
         cmd_list = self.cmd_list + [str(arg) for arg in args]

AbysmalBiscuit commented on 2019-08-29 06:41

I'm also getting test failures, but only with python2. Hence a possible workaround is to only build the python3 variant, if you don't need the python2 one.

ngoonee commented on 2019-08-05 03:39

Anyone getting test failures on this? I get 6 failures seemingly related to default language.

ImNtReal commented on 2019-05-23 13:18

@aucunhenac, I've changed the package, so that the binary for python2 gets renamed to num2words2. That should prevent the error.