This branch uses a hacked version of zc.buildout to work around the problem described in https://bugs.edge.launchpad.net/launchpad-foundations/+bug/491705 . The diff for this branch is below. It essentially only adds the following line to the top of generated scripts, such as bin/run:
import encodings.utf_8 # Hack to fix sys.modules approach.
This is the change that LOSAs have made manually in past deployments. It is not the right fix, which I am working on in svn://svn.zope.org/repos/main/zc.buildout/branches/gary-4 , but it gives us more breathing room.
The branch with the changes below is svn://svn.zope.org/repos/main/zc.buildout/branches/gary-8-hack-fix .
This branch uses a hacked version of zc.buildout to work around the problem described in https:/ /bugs.edge. launchpad. net/launchpad- foundations/ +bug/491705 . The diff for this branch is below. It essentially only adds the following line to the top of generated scripts, such as bin/run:
import encodings.utf_8 # Hack to fix sys.modules approach.
This is the change that LOSAs have made manually in past deployments. It is not the right fix, which I am working on in svn://svn. zope.org/ repos/main/ zc.buildout/ branches/ gary-4 , but it gives us more breathing room.
The branch with the changes below is svn://svn. zope.org/ repos/main/ zc.buildout/ branches/ gary-8- hack-fix .
Thank you
Gary
Modified: zc.buildout/ branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. py ======= ======= ======= ======= ======= ======= ======= ======= ==== branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. py 2010-01-20 21:08:52 UTC (rev 108340) branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. py 2010-01-20 21:09:31 UTC (rev 108341)
=======
--- zc.buildout/
+++ zc.buildout/
@@ -1287,8 +1287,8 @@
else:
script_header = '#!%(python)s'
-script_template = script_header + '''\ paths_setup) s append( dest)
-
+script_template = script_header + '''
+import encodings.utf_8 # Hack to fix sys.modules approach.
%(relative_
import site
import sys
@@ -1365,8 +1365,8 @@
generated.
return generated
-py_script_template = script_header + '''\
-
+py_script_template = script_header + '''
+import encodings.utf_8 # Hack to fix sys.modules approach.
# Get a clean copy of globals before import or variable definition.
globs = globals().copy()
Modified: zc.buildout/ branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. txt ======= ======= ======= ======= ======= ======= ======= ======= ==== branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. txt 2010-01-20 21:08:52 UTC (rev 108340) branches/ gary-8- hack-fix/ src/zc/ buildout/ easy_install. txt 2010-01-20 21:09:31 UTC (rev 108341)
=======
--- zc.buildout/
+++ zc.buildout/
@@ -649,6 +649,7 @@
cat(bin, 'demo') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -721,6 +722,7 @@
cat(bin, 'demo') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -799,6 +801,7 @@
cat(bin, 'py') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
# Get a clean copy of globals before import or variable definition.
globs = globals().copy()
<BLANKLINE>
@@ -969,6 +972,7 @@
cat(bin, 'run') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -1097,6 +1101,7 @@
cat(bin, 'run') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -1152,6 +1157,7 @@
cat(bin, 'run') # doctest: +NORMALIZE_ WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -1224,6 +1230,7 @@
cat(bo, 'bin', 'run') # doctest: +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import os
<BLANKLINE>
@@ -1287,6 +1294,7 @@
cat(bo, 'bin', 'py') # doctest: +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
# Get a clean copy of globals before import or variable definition.
globs = globals().copy()
<BLANKLINE>
Modified: zc.buildout/ branches/ gary-8- hack-fix/ src/zc/ buildout/ update. txt ======= ======= ======= ======= ======= ======= ======= ======= ==== branches/ gary-8- hack-fix/ src/zc/ buildout/ update. txt 2010-01-20 21:08:52 UTC (rev 108340) branches/ gary-8- hack-fix/ src/zc/ buildout/ update. txt 2010-01-20 21:09:31 UTC (rev 108341)
=======
--- zc.buildout/
+++ zc.buildout/
@@ -82,6 +82,7 @@
cat(sample_ buildout, 'bin', 'buildout') # doctest: +ELLIPSIS usr/local/ bin/python2. 4
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
Modified: zc.buildout/ branches/ gary-8- hack-fix/ zc.recipe. egg_/src/ zc/recipe/ egg/README. txt ======= ======= ======= ======= ======= ======= ======= ======= ==== branches/ gary-8- hack-fix/ zc.recipe. egg_/src/ zc/recipe/ egg/README. txt 2010-01-20 21:08:52 UTC (rev 108340) branches/ gary-8- hack-fix/ zc.recipe. egg_/src/ zc/recipe/ egg/README. txt 2010-01-20 21:09:31 UTC (rev 108341) buildout, 'bin', 'foo') WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4 buildout, 'bin', 'foo') WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4 buildout, 'bin', 'foo') WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4 buildout, 'bin', 'foo') WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4 buildout, 'bin', 'other') WHITESPACE +ELLIPSIS usr/local/ bin/python2. 4
=======
--- zc.buildout/
+++ zc.buildout/
@@ -375,6 +375,7 @@
cat(sample_
... # doctest: +NORMALIZE_
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -454,6 +455,7 @@
cat(sample_
... # doctest: +NORMALIZE_
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import os
<BLANKLINE>
@@ -533,6 +535,7 @@
cat(sample_
... # doctest: +NORMALIZE_
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import os
<BLANKLINE>
@@ -617,6 +620,7 @@
cat(sample_
... # doctest: +NORMALIZE_
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys
@@ -707,6 +711,7 @@
cat(sample_
... # doctest: +NORMALIZE_
#!/
+ import encodings.utf_8 # Hack to fix sys.modules approach.
<BLANKLINE>
import site
import sys