[oe-commits] Magnus Olsson : python: add python-codecs runtime dependency for python-json

git at git.openembedded.org git at git.openembedded.org
Thu Dec 11 11:31:53 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 90fd48144f146f455b18372a9b061314ab3a3857
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=90fd48144f146f455b18372a9b061314ab3a3857

Author: Magnus Olsson <magnus at minimum.se>
Date:   Fri Dec  5 11:03:46 2014 +0100

python: add python-codecs runtime dependency for python-json

A piece of JSON initialization code that runs when you "import json"
tries to use the hex-decoder, thus breaks if you do not have
python-codecs installed. Example:

    >>> import json
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.7/json/__init__.py", line 108, in <module>
        from .decoder import JSONDecoder
      File "/usr/lib/python2.7/json/decoder.py", line 24, in <module>
        NaN, PosInf, NegInf = _floatconstants()
      File "/usr/lib/python2.7/json/decoder.py", line 18, in _floatconstants
        _BYTES = '7FF80000000000007FF0000000000000'.decode('hex')
    LookupError: no codec search functions registered: can't find encoding

This patch adds a runtime dependency on python-codecs for python-json and
re-generates the python manifests for Python v2.7. Solves [YOCTO #7020].

Signed-off-by: Magnus Olsson <magnus at minimum.se>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/recipes-devtools/python/python-2.7-manifest.inc | 2 +-
 scripts/contrib/python/generate-manifest-2.7.py      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/python/python-2.7-manifest.inc b/meta/recipes-devtools/python/python-2.7-manifest.inc
index 9a514b1..5c2629e 100644
--- a/meta/recipes-devtools/python/python-2.7-manifest.inc
+++ b/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -126,7 +126,7 @@ RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient"
 FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* "
 
 SUMMARY_${PN}-json="Python JSON support"
-RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs"
 FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so "
 
 SUMMARY_${PN}-lang="Python low-level language support"
diff --git a/scripts/contrib/python/generate-manifest-2.7.py b/scripts/contrib/python/generate-manifest-2.7.py
index 21b874f..68c42b0 100755
--- a/scripts/contrib/python/generate-manifest-2.7.py
+++ b/scripts/contrib/python/generate-manifest-2.7.py
@@ -279,7 +279,7 @@ if __name__ == "__main__":
     "lib-dynload/_socket.so lib-dynload/_io.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so " +
     "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" )
 
-    m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re",
+    m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re ${PN}-codecs",
     "json lib-dynload/_json.so" ) # package
 
     m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core",



More information about the Openembedded-commits mailing list