[Scons-users] Issue with dill

Bill Deegan bill at baddogconsulting.com
Thu Nov 24 23:09:20 EST 2016


Importing SConstructs/SConscripts into a normal python shell and executing
them is not a supported usage.

Perhaps you can explain why you need to use dill and we can help you find a
less complicated solution.

-Bill

On Thu, Nov 24, 2016 at 4:08 PM, Albert Arquer <albert.arquer at gmail.com>
wrote:

> Hello again,
>
> I wrote to dill developers and they pointed out the fact that apparently
> scons renames the pickle module to cPickle, and apparently dill needs
> pickle to be named as-is (sounds reasonable to me).
>
> If you look in SCons.compat you can see how the module is renamed for some
> reason.
>
> I figured a way to get around it by adding "import dill" in the scons
> launcher script, since everything seems to work as soon as dill is imported
> before SCons itself.
> However I don't really like having to go around touching scons sources...
> and what if I want to source my sconstruct scripts from a normal python
> shell??
>
> Does anybody know why scons does this? is there any other "cleaner" way
> around this?
>
> 2016-11-24 20:51 GMT+01:00 Dirk Bächle <tshortik at gmx.de>:
>
>> Hi Albert,
>>
>> On 24.11.2016 17:24, Albert Arquer wrote:
>>
>>> Hello,
>>>
>>> I have been trying to do some tricky stuff with scons in order to be
>>> able to detect subtle changes that where not original picked up
>>> by scons. Long story short, I think I found a way with the dill package.
>>>
>>> I have installed dill and while I can import it into a normal python
>>> shell or include it in a normal python script, when I import it
>>> from my sconstruct I get:
>>>
>>> scons: Reading SConscript files ...
>>> AttributeError: 'builtin_function_or_method' object has no attribute
>>> 'dispatch':
>>>   File ".../SConstruct_new", line 2:
>>>     from GenericModule import *
>>>   File ".../GenericModule.py", line 20:
>>>     import dill
>>>   File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/__init__.py",
>>> line 26:
>>>     from .dill import dump, dumps, load, loads, dump_session,
>>> load_session, \
>>>   File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py",
>>> line 371:
>>>     class Pickler(StockPickler):
>>>   File ".../python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py",
>>> line 373:
>>>     dispatch = MetaCatchingDict(StockPickler.dispatch.copy())
>>>
>>>
>>> I have read somewhere about an environment variable called
>>> SCONS_HORRIBLE_REGRESSION_TEST_HACK, while I have no idea what that
>>> does,
>>> I have tried it and it still fails...
>>>
>>> I really need dill... what can I do?
>>>
>>>
>> for a start, you could show us the full (and verbatim) contents of your
>> "SConstruct_new" and "GenericModule.py" files. It's important to see which
>> other modules you try to import...SCons is doing some wrapping around
>> cPickle where needed, and the exact order in which things are initialized
>> will probably make a difference.
>>
>> I guess you already found
>>
>>   http://scons-users.scons.narkive.com/vqa4FUWi/scons-not-play
>> ing-well-with-scipy
>>
>> while "searching the web"? Is that where you have the variable name
>> SCONS_HORRIBLE_REGRESSION_TEST_HACK from?
>>
>> Best regards,
>>
>> Dirk
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161124/6cb4474b/attachment.html>


More information about the Scons-users mailing list