Scons and Dill

Albert Arquer <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <CAESUZKP92v+2FfbSDtcicL9bn962QnbA5_AJVdQXnTFp4oaHpA@mail.gmail.com>
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
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.