Merge lp:~gary/launchpad/bug-491705-hack into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Francis J. Lacoste
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~gary/launchpad/bug-491705-hack
Merge into: lp:launchpad
Diff against target: 12 lines (+1/-1)
1 file modified
versions.cfg (+1/-1)
To merge this branch: bzr merge lp:~gary/launchpad/bug-491705-hack
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) Approve
Review via email: mp+17788@code.launchpad.net

Commit message

Work around the problem described in bug 491705. This is a temporary fix.

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :
Download full text (6.0 KiB)

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
===================================================================
--- zc.buildout/branches/gary-8-hack-fix/src/zc/buildout/easy_install.py 2010-01-20 21:08:52 UTC (rev 108340)
+++ zc.buildout/branches/gary-8-hack-fix/src/zc/buildout/easy_install.py 2010-01-20 21:09:31 UTC (rev 108341)
@@ -1287,8 +1287,8 @@
else:
    script_header = '#!%(python)s'

-script_template = script_header + '''\
-
+script_template = script_header + '''
+import encodings.utf_8 # Hack to fix sys.modules approach.
%(relative_paths_setup)s
import site
import sys
@@ -1365,8 +1365,8 @@
    generated.append(dest)
    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
===================================================================
--- zc.buildout/branches/gary-8-hack-fix/src/zc/buildout/easy_install.txt 2010-01-20 21:08:52 UTC (rev 108340)
+++ zc.buildout/branches/gary-8-hack-fix/src/zc/buildout/easy_install.txt 2010-01-20 21:09:31 UTC (rev 108341)
@@ -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 @@
...

Read more...

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

On January 20, 2010, Gary Poster wrote:
> Gary Poster has proposed merging lp:~gary/launchpad/bug-491705-hack into
> lp:launchpad/devel.
>
> Requested reviews:
> Canonical Launchpad Engineering (launchpad)
>
>
> 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.
>

Thanks for this safety.

 review approve
 status approved

--
Francis J. Lacoste
<email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'versions.cfg'
2--- versions.cfg 2010-01-13 21:49:36 +0000
3+++ versions.cfg 2010-01-20 22:27:14 +0000
4@@ -105,7 +105,7 @@
5 z3c.viewlet = 1.0.0
6 z3c.viewtemplate = 0.3.2
7 z3c.zrtresource = 1.0.1
8-zc.buildout = 1.5.0dev-gary-r105072
9+zc.buildout = 1.5.0dev-gary-r108342
10 zc.catalog = 1.2.0
11 zc.datetimewidget = 0.5.2
12 zc.i18n = 0.5.2