[Scons-dev] Scons and Dill

Bill Deegan bill at baddogconsulting.com
Fri Nov 25 22:59:41 EST 2016


Albert,

This email should go to the users mailing list as it's about using SCons
not about developing it.
Please bring your query there.
CC'ing the list.

-Bill

On Fri, Nov 25, 2016 at 2:32 AM, Albert Arquer <albert.arquer at gmail.com>
wrote:

> Hello,
>
> I seem to be having problems using dill inside my sconscripts. The case
> is that when I import SCons packages and after I import dill python crashes
> with:
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/p/common/python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/__init__.py", line 26, in <module>
>     from .dill import dump, dumps, load, loads, dump_session, load_session, \
>   File "/p/common/python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py", line 371, in <module>
>     class Pickler(StockPickler):
>   File "/p/common/python/2.7.8/lib/python2.7/site-packages/dill-0.2.5-py2.7.egg/dill/dill.py", line 373, in Pickler
>     dispatch = MetaCatchingDict(StockPickler.dispatch.copy())
> AttributeError: 'builtin_function_or_method' object has no attribute 'dispatch'
>
>
> To replicate run:
>
> from SCons.Builder import Builder
> from SCons.Builder import is_a_Builder
> from SCons.Defaults import Copy
> from SCons.Script import AddOption, GetOption, Main, Help
> from SCons.Variables import *
> from datetime import timedelta
> import dill
>
> I am running:
>
> Python: 2.7.8
> Scons: 2.5
> Dill: 0.2.5
>
>
> I have been looking around and the problem seems to be that scons renames
> the cPickle to pickle.. Why does scons do that? I also tried running scons
> 2.5.1 with same luck.
> I also tried to comment out the line where scons does the renaming and got
> a different error:
>
> scons: *** [<target_path>] PicklingError : Can't pickle <class 'SCons.Scanner.LaTeX.LaTeXScanCheck'>: it's not found as SCons.Scanner.LaTeX.LaTeXScanCheck
> scons: building terminated because of errors.
>
>
> I have also seen scons use to check an environment variable called
> SCONS_HORRIBLE_REGRESSION_TEST_HACK  to decide to do the renaming or not,
> this was in version 2.3.0, however I see no such variable in 2.5/2.5.1...
>
> What could I do to be able to use dill in my sconscripts? I really need it
> :(
>
> Thanks
>
>
> _______________________________________________
> 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/20161125/f9658e83/attachment-0001.html>


More information about the Scons-dev mailing list