[Scons-users] [Scons-dev] Scons and Dill
Albert Arquer
albert.arquer at gmail.com
Sat Nov 26 09:21:40 EST 2016
Well I thought my problem was fit for scons-dev mailing list since it
probably requires modifications to scons sources but Bill Deegan said
scons-users was better suited.
You can read about my issue below, also, about the reason why I need dill
you can see this thread on stackoverflow that I created. I basically need
to compute object hashes that change whenever the class definition changes,
and pickle.dumps seems to be inmune to those changes...
http://stackoverflow.com/questions/40640797/compute-class-and-instance-hash/40775525#40775525
I don't really get why scons needs to rename cPickle to pickle, if it needs
to use cPickle whynot call it directly instead of hidding it as if it were
pickle? Or if it is a compatibility issue as I suspect, where it needs to
use pickle or cPickle depending on the situation why not rename it to
something else that doesn't cause colisions like "GenericSerializer"?
El ds, 26 nov 2016 a les 4:59 Bill Deegan <bill at baddogconsulting.com> va
escriure:
> 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
>
>
> _______________________________________________
> 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/20161126/f8ef3e2b/attachment-0001.html>
More information about the Scons-users
mailing list