classification
Title: buildbot: test_httpservers failure (No module named operator)
Type: Stage:
Components: Library (Lib), Tests Versions: Python 3.1
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: janssen, mark.dickinson, pitrou, ronaldoussoren, tarek, vstinner
Priority: normal Keywords: buildbot, patch

Created on 2010-04-18 22:23 by vstinner, last changed 2010-08-03 21:34 by mark.dickinson. This issue is now closed.

Files
File name Uploaded Description Edit
issue8447.patch mark.dickinson, 2010-08-03 21:01
Messages (10)
msg103540 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-04-18 22:23
http://www.python.org/dev/buildbot/builders/x86 Tiger 3.1/builds/16/steps/test/logs/stdio

test_httpservers
[28139 refs]
[28139 refs]
[28139 refs]
Traceback (most recent call last):
  File "/private/tmp/tmpqYIZuO/cgi-bin/file2.py", line 2, in <module>
    import cgi
  File "/Users/db3l/buildarea/3.1.bolen-tiger/build/Lib/cgi.py", line 34, in <module>
    from operator import attrgetter
ImportError: No module named operator
[28142 refs]
Warning: os.environ was modified by test_httpservers
test test_httpservers failed -- Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.1.bolen-tiger/build/Lib/test/test_httpservers.py", line 380, in test_post
    self.assertEquals(res.read(), b'1, python, 123456\n')
AssertionError: b'' != b'1, python, 123456\n'
msg103756 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-04-20 20:55
The test passes just fine on my machine.
msg103762 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-04-20 21:05
There's probably something wrong in the way test_httpservers sets up its own environment (can it impact the import mechanism?). The operator module exists and imports correctly in other conditions, e.g. test_operator passes on that buildbot.
msg108767 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2010-06-27 01:18
Failing on my PPC Tiger OS X buildbot, with 2.6, too.
msg108791 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-06-27 14:30
Bill: can you do some debugging on the buildbot itself? I cannot reproduce the problem locally.
msg112659 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-03 19:49
I can reproduce this locally;  it appears to have something to do with distutils and symlinks:

If I do:

ln -s /Users/dickinsm/python/svn/release26-maint/python.exe /Users/dickinsm/Documents/python.exe

and then try to execute the symlink, I get:


newton:~ dickinsm$ ~/Documents/python.exe
'import site' failed; use -v for traceback
Python 2.6.5+ (release26-maint:83685M, Aug  3 2010, 19:48:56) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

The '-v' output includes:

# /Users/dickinsm/python/svn/release26-maint/Lib/distutils/text_file.pyc matches /Users/dickinsm/python/svn/release26-maint/Lib/distutils/text_file.py
import distutils.text_file # precompiled from /Users/dickinsm/python/svn/release26-maint/Lib/distutils/text_file.pyc
'import site' failed; traceback:
Traceback (most recent call last):
  File "/Users/dickinsm/python/svn/release26-maint/Lib/site.py", line 525, in <module>
    main()
  File "/Users/dickinsm/python/svn/release26-maint/Lib/site.py", line 504, in main
    addbuilddir()
  File "/Users/dickinsm/python/svn/release26-maint/Lib/site.py", line 115, in addbuilddir
    s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
  File "/Users/dickinsm/python/svn/release26-maint/Lib/distutils/util.py", line 98, in get_platform
    cfgvars = get_config_vars()
  File "/Users/dickinsm/python/svn/release26-maint/Lib/distutils/sysconfig.py", line 525, in get_config_vars
    func()
  File "/Users/dickinsm/python/svn/release26-maint/Lib/distutils/sysconfig.py", line 382, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/local/lib/python2.6/config/Makefile (No such file or directory)
msg112675 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-03 20:47
It looks as though the failure is due to r79297:  the fix for issue 7668 introduced symlinks for the python executable, and these symlinks are causing the 'import site' to blow up.
msg112681 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-03 21:01
Here's a patch (against the release26-maint branch) which fixes the test failures for me.

I wouldn't feel happy about committing this without Tarek looking at it first, though.

Tarek?
msg112688 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-03 21:20
Fixed in r83688 for release26-maint.  The fix still needs to be ported to release31-maint.
msg112691 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-08-03 21:34
Fix ported to release31-maint in r83689.

Thanks Tarek for reviewing (on IRC).
History
Date User Action Args
2010-08-03 21:34:21mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg112691
2010-08-03 21:20:18mark.dickinsonsetmessages: + msg112688
versions: - Python 2.6
2010-08-03 21:01:12mark.dickinsonsetfiles: + issue8447.patch
keywords: + patch
messages: + msg112681
2010-08-03 20:47:23mark.dickinsonsetmessages: + msg112675
2010-08-03 19:49:33mark.dickinsonsetnosy: + tarek, mark.dickinson
messages: + msg112659
2010-06-27 14:30:59ronaldoussorensetmessages: + msg108791
2010-06-27 01:18:22janssensetnosy: + janssen

messages: + msg108767
versions: + Python 2.6
2010-04-20 21:05:07pitrousetnosy: + pitrou
messages: + msg103762
2010-04-20 20:55:55ronaldoussorensetmessages: + msg103756
2010-04-18 22:38:28vstinnersetnosy: ronaldoussoren, vstinner
components: + Library (Lib), Tests, - macOS
2010-04-18 22:30:41pitrousetassignee: ronaldoussoren

components: + macOS
nosy: + ronaldoussoren
2010-04-18 22:23:08vstinnercreate