[Scons-dev] SCons option tests failing in Python3

Bill Deegan bill at baddogconsulting.com
Wed Mar 1 00:53:05 EST 2017


There seems to be some mess around Python3 importing the wrong module with
the same name.
It's breaking a bunch of things.

I think the "right" fix is to fix the way it's searching for the tools it's
loading.

I've punted on that for now, but will revisit tomorrow as it's looking
kinda complicated,and I wanted to get some of the low hang fruit.

most of the test/Interactive tests are all failing for the same reason and
I'm persuing that now.
But I'm turning into a pumpkin and it will have to wait for tomorrow..


On Tue, Feb 28, 2017 at 9:15 PM, William Blevins <wblevins001 at gmail.com>
wrote:

> I suppose the quick fix would be to rename the test file... unless someone
> has a better way?
>
> On Wed, Mar 1, 2017 at 12:02 AM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>> Krew,
>>
>> I figured out why test/options are failing under Python3, but I'm not
>> sure how to fix it right off so I'll post it here in case someone else has
>> worked with it lately. SCons.compat is renaming cProfile to profile which
>> in turn is causing test/option/profile.py to execute inside other tests. I
>> discovered that the "missing SConstruct error" was caused by duplicate
>> QMTest/TestCmd.tempdir calls making a second work directory after the files
>> were written.
>>
>> ./runtest.py test/option/debug-count.py
>>> 1/1 (100.00%) /usr/bin/python3 -tt test/option/debug-count.py
>>> None
>>>   File "test/option/debug-count.py", line 36, in <module>
>>>   File "/home/wblevins/SCons/scons/QMTest/TestSCons.py", line 264, in
>>> __init__
>>>     TestCommon.__init__(self, **kw)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCommon.py", line 237, in
>>> __init__
>>>     TestCmd.__init__(self, **kw)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 925, in
>>> __init__
>>>     self.workdir_set(workdir)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 1610, in
>>> workdir_set
>>>     path = self.tempdir(path)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 1533, in
>>> tempdir
>>>     traceback.print_stack()
>>> None
>>>   File "test/option/debug-count.py", line 36, in <module>
>>>   File "/home/wblevins/SCons/scons/QMTest/TestSCons.py", line 267, in
>>> __init__
>>>     import SCons.Node.FS
>>>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>>>   File "<frozen importlib._bootstrap>", line 944, in
>>> _find_and_load_unlocked
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>>>   File "<frozen importlib._bootstrap>", line 944, in
>>> _find_and_load_unlocked
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>>>   File "<frozen importlib._bootstrap>", line 958, in
>>> _find_and_load_unlocked
>>>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>>>   File "<frozen importlib._bootstrap_external>", line 673, in
>>> exec_module
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "/home/wblevins/SCons/scons/src/engine/SCons/__init__.py", line
>>> 43, in <module>
>>>     import SCons.compat
>>>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>>>   File "<frozen importlib._bootstrap>", line 958, in
>>> _find_and_load_unlocked
>>>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>>>   File "<frozen importlib._bootstrap_external>", line 673, in
>>> exec_module
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "/home/wblevins/SCons/scons/src/engine/SCons/compat/__init__.py",
>>> line 103, in <module>
>>>     rename_module('profile', 'cProfile')
>>>   File "/home/wblevins/SCons/scons/src/engine/SCons/compat/__init__.py",
>>> line 84, in rename_module
>>>     sys.modules[new] = imp.load_module(old, *imp.find_module(old))
>>>   File "/usr/lib/python3.5/imp.py", line 234, in load_module
>>>     return load_source(name, filename, file)
>>>   File "/usr/lib/python3.5/imp.py", line 172, in load_source
>>>     module = _load(spec)
>>>   File "<frozen importlib._bootstrap>", line 693, in _load
>>>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>>>   File "<frozen importlib._bootstrap_external>", line 673, in
>>> exec_module
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "/usr/lib/python3.5/cProfile.py", line 10, in <module>
>>>     import profile as _pyprofile
>>>   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
>>>   File "<frozen importlib._bootstrap>", line 958, in
>>> _find_and_load_unlocked
>>>   File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
>>>   File "<frozen importlib._bootstrap_external>", line 673, in
>>> exec_module
>>>   File "<frozen importlib._bootstrap>", line 222, in
>>> _call_with_frames_removed
>>>   File "/home/wblevins/SCons/scons/test/option/profile.py", line 39, in
>>> <module>
>>>     test = TestSCons.TestSCons()
>>>   File "/home/wblevins/SCons/scons/QMTest/TestSCons.py", line 264, in
>>> __init__
>>>     TestCommon.__init__(self, **kw)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCommon.py", line 237, in
>>> __init__
>>>     TestCmd.__init__(self, **kw)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 925, in
>>> __init__
>>>     self.workdir_set(workdir)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 1610, in
>>> workdir_set
>>>     path = self.tempdir(path)
>>>   File "/home/wblevins/SCons/scons/QMTest/TestCmd.py", line 1533, in
>>> tempdir
>>>     traceback.print_stack()
>>> Preserved directory /tmp/testcmd.10458.tezdkydu
>>>
>>> Preserved directory /tmp/testcmd.10458.qh69ifi9
>>>
>>> Preserved directory /tmp/testcmd.10458.tezdkydu
>>>
>>> Preserved directory /tmp/testcmd.10458.qh69ifi9
>>>
>>
>> Thoughts?
>> William
>>
>
>
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20170228/be7ef9ae/attachment.html>


More information about the Scons-dev mailing list