host python/python3: conditionally disable unicodedata
authorThomas De Schampheleire <patrickdepinguin@gmail.com>
Fri, 7 Feb 2014 10:16:05 +0000 (11:16 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 18 Feb 2014 22:09:05 +0000 (23:09 +0100)
The host python always had --disable-unicodedata, regardless of the
corresponding configuration option BR2_PACKAGE_PYTHON_UNICODEDATA.
Since the host python is used to byte-compile python modules, this meant
that such modules could not contain unicode strings. For example, following
statement in a python module:
    print u"\N{SOLIDUS}"

would cause the byte-compilation to fail with message:
    SyntaxError: ("(unicode error) \\N escapes not supported (can't load
    unicodedata module)",

Instead, conditionally disable unicodedata based on
BR2_PACKAGE_PYTHON_UNICODEDATA, also for the host python.

This fixes bug #6542 (https://bugs.busybox.net/show_bug.cgi?id=6542)

Reported-by: Gernot Vormayr <gvormayr@gmail.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/python/python.mk
package/python3/python3.mk

index 6187d66e7dbf1ff837c29e90d013f566adedd7e1..163e6f579b9974660cb6cd57aa7c369f55f3e7ec 100644 (file)
@@ -26,7 +26,6 @@ HOST_PYTHON_CONF_OPT +=       \
        --disable-curses        \
        --disable-codecs-cjk    \
        --disable-nis           \
-       --disable-unicodedata   \
        --disable-dbm           \
        --disable-gdbm          \
        --disable-bsddb         \
@@ -100,6 +99,7 @@ endif
 
 ifneq ($(BR2_PACKAGE_PYTHON_UNICODEDATA),y)
 PYTHON_CONF_OPT += --disable-unicodedata
+HOST_PYTHON_CONF_OPT += --disable-unicodedata
 endif
 
 # Default is UCS2 w/o a conf opt
index b5e9689324e373d011bcba9371fd917185044eca..b032d15f45c94b65c8d9ac144458525287f0ea36 100644 (file)
@@ -23,7 +23,6 @@ HOST_PYTHON3_CONF_OPT +=      \
        --disable-curses        \
        --disable-codecs-cjk    \
        --disable-nis           \
-       --disable-unicodedata   \
        --disable-test-modules  \
        --disable-idle3
 
@@ -88,6 +87,7 @@ endif
 
 ifneq ($(BR2_PACKAGE_PYTHON3_UNICODEDATA),y)
 PYTHON3_CONF_OPT += --disable-unicodedata
+HOST_PYTHON3_CONF_OPT += --disable-unicodedata
 endif
 
 ifeq ($(BR2_PACKAGE_PYTHON3_BZIP2),y)