[Scons-dev] SCons option tests failing in Python3

William Blevins wblevins001 at gmail.com
Wed Mar 1 00:15:46 EST 2017


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20170301/6909dac0/attachment-0001.html>


More information about the Scons-dev mailing list