Hi Braddock,<br><br><div class="gmail_quote">On 6 July 2013 21:47, Braddock <span dir="ltr"><<a href="mailto:braddock@braddock.com" target="_blank">braddock@braddock.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi guys,<br>
Working on Internet-in-a-Box integration with OLPC School Server CE.<br>
<br>
There are multiple problems caused by the python optimization setting<br>
in OLPC OS 13.1.0.<br>
<br>
PYTHONOPTIMIZE=2 is set in /etc/profile.d/zzz_olpc.sh<br>
<br></blockquote><div><br>That is a olpc customization, and can be changed.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It causes Python to generate lightly optimized .pyo files instead of<br>
.pyc files.<br>
<br>
This breaks virtualenv and building python packages into RPMs.  Both<br>
these problems go away with an 'unset PYTHONOPTIMIZE'<br>
<br>
$ virtualenv v<br>
New python executable in v/bin/python<br>
ImportError: Bad magic number in /tmp/v/lib/python2.7/site.pyo<br>
ERROR: The executable v/bin/python is not functioning<br>
ERROR: It thinks sys.prefix is u'/tmp' (should be u'/tmp/v')<br>
ERROR: virtualenv is not compatible with this system or executable<br>
<br>
<br>
This also breaks building of Python packages into RPMs.  For a failing<br>
example:<br>
<br>
wget<br>
<a href="https://pypi.python.org/packages/source/b/backports.lzma/backports.lzma-0.0.2.tar.gz" target="_blank">https://pypi.python.org/packages/source/b/backports.lzma/backports.lzma-0.0.2.tar.gz</a><br>
tar xzf backports.lzma-0.0.2.tar.gz<br>
(cd backports.lzma-0.0.2; python setup.py bdist_rpm)<br>
<br></blockquote><div><br>Does this affect the running of the code or just the building of the rpms?<br><br>Jerry<br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Thunderbird - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
<br>
iQEcBAEBAgAGBQJR2Na1AAoJEHWLR/DQzlZuhfAH/3Um5xAQAirjt6FHyswa/KLg<br>
ZfN2Sf1LVZRIXPIjZ8av4BqOJqOnYD3giqrX1tTymWQcaL9sjb5MOXRyWGcd44w8<br>
ZUYgdEJBa6LBTssNukIZL6+DKtaGFNYuJfRB8OnZzrCmaIQL36UBfNTKL65MxUJI<br>
z7+c3b90PQgJ063AM6gOcpu8dsfFZZbvep9PG7neechee23Rx2FH3MItY9wSNHoM<br>
I2sUjrRiATdX8wXWyvo1Yu70wHLFJ2Ndv9kov/OICJCjIH+odXFPfq8DjJUlAZV/<br>
IY4w2GWsBJMzbyRR1LMQ/Pql6BYqPX12N+15fGe5Txmyo9JkAIRm3A6IGKWAy2o=<br>
=7X6D<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br>