Discussion:
Exception TypeError: "'NoneType' object is not callable" with Python 2.6.1+
(too old to reply)
Francesco Montorsi
2009-03-16 16:37:49 UTC
Permalink
Raw Message
Hi,
I'm using Ubuntu Jaunty which ships with Python 2.6.1+ and everytime I run
bakefile_gen I see

Exception TypeError: "'NoneType' object is not callable" in ignored

printed right after a call to bakefile.
I managed to bisect the problem down to (apparently) updateTargets() in
bakefile_gen.py.

With the attached patch I see:


***@ubuntu:~/work/bakefile/tests$ bakefile_gen --verbose -f msvc -b
headers/headers.bkl
loading task description from /home/frm/work/bakefile/tests/Bakefiles.bkgen...

scanning directories for bakefiles...

building rules...

determining which makefiles are out of date...

...1 out of 1 will be updated

starting

[1/1] generating msvc from headers/headers.bkl

/usr/bin/python /usr/local/lib/bakefile/bakefile.py -fmsvc
-DFORMAT_HAS_MAKE_INSTALL=1 --output-deps=/tmp/bakefile9BTwgU
--output-changes=/tmp/bakefileQQonn1 --xml-cache=/tmp/bakefile2tHcS1/xmlcache0
headers/headers.bkl

checking


endchecking


... lots of checking/endchecking ...
starting
checking
endchecking
writing headers/makefile.vc
starting
checking
endchecking
Exception TypeError: "'NoneType' object is not callable" in ignored
starting
checking
endchecking
1 files modified

so it looks like it's something in the while line (432) ?

Running bakefile separately (but without --xml-cache doesn't trigger the
exception). Also if the makefile is already updated I get no exception just:

loading task description from /home/frm/work/bakefile/tests/Bakefiles.bkgen...
scanning directories for bakefiles...
building rules...
determining which makefiles are out of date...
...0 out of 1 will be updated
0 files modified

I should mention that this is not _critical_ (makefiles are still generated) but
very annoying (gets repeated tons of times).

Francesco
Vaclav Slavik
2009-03-17 05:45:46 UTC
Permalink
Raw Message
Hi,
Post by Francesco Montorsi
so it looks like it's something in the while line (432) ?
That's obviously impossible, so one can reasonably assume there's
Post by Francesco Montorsi
Running bakefile separately (but without --xml-cache doesn't trigger the
exception).
That it works without --xml-cache doesn't imply that it works *with*
--xml-cache and the bug must be in bakefile_gen. What it does suggest is
that the bug is either in bakefile_gen *or* in bakefile's --xml-cache
handling. And indeed, it was:

http://www.bakefile.org/changeset/1296

To be fair, I had a great advantage: there used to be a similar bug with
Python 2.5 and I half-remembered that it was related to dbhash module
and the message was printed during Python shutdown.

Thanks!
Vaclav

Loading...