RE: [xml] Release of libxml2-2.5.3



make[2]: Leaving directory `/data/src/xml/libxml2-2.5.3/example'
Making all in python
make[2]: Entering directory `/data/src/xml/libxml2-2.5.3/python'
Making all in .
make[3]: Entering directory `/data/src/xml/libxml2-2.5.3/python'
cd . && /usr/bin/python generator.py
Found 1132 functions in libxml2-api.xml
Found 45 functions in libxml2-python-api.xml
Generated 700 wrapper functions, 293 failed, 184 skipped

Missing type converters: 
xmlGenericErrorFunc *:1  xlinkType:1
...
Traceback (most recent call last):
  File "generator.py", line 1134, in ?
    buildWrappers()
  File "generator.py", line 1092, in buildWrappers
    if pref[0] == ref[0]:
UnboundLocalError: local variable 'ref' referenced before assignment
make[3]: *** [gen_prog] Error 1
make[3]: Leaving directory `/data/src/xml/libxml2-2.5.3/python'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/data/src/xml/libxml2-2.5.3/python'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/src/xml/libxml2-2.5.3'
make: *** [all-recursive-am] Error 2

I think the problem is due to the addition of relaxNgValidCtxt
to the reference_keepers list. That reveals a bug that
was there before: as suggested in a previous post, ref is
not in scope at that place.

With python 2.1 it (now?) raises an exception, and with
python 2.2 it seems it reuses the ref variable previously used
in a for loop... but in that case, the generated result
is wrong. In previous releases, it was correct because there
was only one item in reference_keepers (???).

To me, the strangest in that story is python's behaviour...

Here's the patch I suggest.

Index: generator.py
===================================================================
RCS file: /cvs/gnome/gnome-xml/python/generator.py,v
retrieving revision 1.39
diff -r1.39 generator.py
1092c1092
<                               if pref[0] == ref[0]:
---
                              if pref[0] == classname:

-sbi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]