Mystery glitch in new pythonpath system under Python 2.6 in testsuite

Bug #562734 reported by Max Bowsher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
William Grant

Bug Description

I'm seeing weird behaviour from the testsuite when running under Python 2.6. Reproduce as follows:

bzr branch lp:~launchpad-committers/launchpad/python2.6
make check VERBOSITY=--list-tests #evilhack to just do the preparation for testing

Now run just the unit tests:
bin/test -vv -u

The following tests fail:
    make_test_tarball_2 (canonical.launchpad.tests.test_helpers)
    test_script (lp.translations.scripts.tests.test_validate_translations_file.TestValidateTranslationsFile)
    lib/lp/translations/tests/../doc/remove-upstream-translations-script.txt

The first is unrelated, the other two are failing due to RuntimeError: The wrong site.py is imported. Scripts should usually be started with Launchpad's bin/py, or with a Python invoked with the -S flag.

Now here's the really weird bit. Run exactly the same test run, but omit test_all_scripts:
bin/test -vv -u -t '!test_all_scripts'

When you do this, the two tests mentioned no longer fail. (Nor do they fail if run individually.)

Revision history for this message
Max Bowsher (maxb) wrote :

(
This bug was filed out of a #launchpad-foundations IRC conversation:
14:15 < maxb> gary_poster: Hello. I have a buildoutish conundrum for you :-) Under python 2.6, a couple of rosetta scripts throw the "bin/py or -S" RuntimeError during a `bin/test -u` but NOT if run individually or as `bin/test -u
              -t!test_all_scripts`. I don't expect you'll have a magical solution, but I thought I'd mention it nonetheless
14:19 < gary_poster> maxb, hm. I probably can tweak it one way or another. Would you mind making a foundations bug with the details for me?
14:20 < maxb> sure
)

tags: added: python-upgrade
Changed in launchpad-foundations:
assignee: nobody → Gary Poster (gary)
Revision history for this message
William Grant (wgrant) wrote :

Fixed in devel r10711. run_script was accidentally popping PYTHONPATH out of os.environ. Before Python 2.6, this didn't actually unset the variable in the current environment.

Changed in launchpad-foundations:
assignee: Gary Poster (gary) → William Grant (wgrant)
status: New → Fix Committed
Gary Poster (gary)
Changed in launchpad-foundations:
milestone: none → 10.04
William Grant (wgrant)
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.