<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>614</bug_id>
          
          <creation_ts>2010-12-23 00:50:16 +0000</creation_ts>
          <short_desc>LSB: Change of default encoding of python cause python-runtime test failure(test_builtin.py, test_getargs.py)</short_desc>
          <delta_ts>2011-02-16 00:58:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.0 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jingdong Lu">jingdong.lu</reporter>
          <assigned_to name="Jingdong Lu">jingdong.lu</assigned_to>
          <cc>jingdong.lu</cc>
    
    <cc>ke.yu</cc>
    
    <cc>kevin.tian</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11302</commentid>
    <comment_count>0</comment_count>
    <who name="Jingdong Lu">jingdong.lu</who>
    <bug_when>2010-12-23 00:50:16 +0000</bug_when>
    <thetext>A part of python-runtime test report
...
&lt;09:28:08&gt; test_builtin
&lt;09:28:11&gt; test test_builtin failed -- errors occurred; run in verbose mode for details
...
&lt;09:34:58&gt; test test_getargs crashed -- &lt;type &apos;exceptions.ValueError&apos;&gt;: bad marshal data

Using command line to try to get more information:
eg. test_getargs.py
Failure result is like this,
&gt;&gt;&gt; import marshal
&gt;&gt;&gt; marshal.loads(u&apos;\x92&apos;)
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
ValueError: bad marshal data
&gt;&gt;&gt;

Correct result should be:
&gt;&gt;&gt; import marshal
&gt;&gt;&gt; marshal.loads(u&apos;\x92&apos;)
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
UnicodeEncodeError: &apos;ascii&apos; codec can&apos;t encode character u&apos;\x92&apos; in position 0: ordinal not in range(128)
&gt;&gt;&gt; 

I recompiled python without -O2/-O3 option and debug it using gdb. I found that the default encoding has been changed at beginning.
site.py
|-- execsitecustomize() 
    |-- import sitecustomize
sitecustomize.py
|-- sys.setdefaultencoding( &quot;utf8&quot; )

So, because of setting default encoding from &quot;ascii&quot; to &quot;utf8&quot; and LSB require the default encoding is &quot;ascii&quot;, the test failed. I delete &quot;sitecustomize.py&quot; or make relevant lines and we can get the above two tests passed.

I find this file &quot;sitecustomize.py&quot; in OE recipe and I wonder whether it is possible to delete it.

Any suggestion?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11815</commentid>
    <comment_count>1</comment_count>
    <who name="Jingdong Lu">jingdong.lu</who>
    <bug_when>2011-02-16 00:58:42 +0000</bug_when>
    <thetext>Remove sitecustomize.py for lsb image.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>