Skip to contentSkip to conversation

host python/python3: conditionally disable unicodedata

PATCH New Thomas De Schampheleire 3 participants 6 messages Feb 7, 2014 – Feb 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

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)

---
 package/python/python.mk   |  2 +-
 package/python3/python3.mk |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/python/python.mk +1 -1
@@ -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
package/python3/python3.mk +1 -1
@@ -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)
#1 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

Dear Thomas De Schampheleire,

Quoted 11 lines · Thomas De Schampheleire

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)",

Quoted 7 lines

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)

For information, my upcoming patch series that bumps Python uses --enable-unicodedata unconditionally for the host python, because recent versions of python-setuptools need unicodedata.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

Hi Peter,

Quoted 17 lines · Thomas Petazzoni

Dear Thomas De Schampheleire,

Quoted 14 lines · Thomas De Schampheleire

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.

Quoted 9 lines
Quoted 4 lines

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

For information, my upcoming patch series that bumps Python uses --enable-unicodedata unconditionally for the host python, because recent versions of python-setuptools need unicodedata.

I think this patch should still be part of 2014.02.

Best regards,
Thomas

#3 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

Dear Thomas De Schampheleire,

Quoted 12 lines · Thomas De Schampheleire
Quoted 12 lines
Quoted 11 lines

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)

Quoted 6 lines
Quoted 4 lines

For information, my upcoming patch series that bumps Python uses --enable-unicodedata unconditionally for the host python, because recent versions of python-setuptools need unicodedata.

I think this patch should still be part of 2014.02.

I agree.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

Quoted 16 lines · Thomas Petazzoni

Dear Thomas De Schampheleire,

Quoted 12 lines · Thomas De Schampheleire
Quoted 12 lines
Quoted 11 lines

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)

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

For information, my upcoming patch series that bumps Python uses --enable-unicodedata unconditionally for the host python, because recent versions of python-setuptools need unicodedata.

I think this patch should still be part of 2014.02.

I agree.

Peter, now that I have your attention, this one should be applied too :) (if you agree, of course)

Thanks,
Thomas

#5 lore raw

PATCH 1/1 host python/python3: conditionally disable unicodedata

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

I think this patch should still be part of 2014.02.

I agree.

Peter, now that I have your attention, this one should be applied too :) (if you agree, of course)

Ok ;)

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard