Errors in h2def.py and override.php
| From: | Mike Dransfield | Date: | Mon, 26 Jan 2004 05:24:45 +0000 |
| Subject: | Errors in h2def.py and override.php | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-612@lists.php.net to get a copy of this message | ||
I have been trying to make some bindings for MozEmbed recently and have found some problems with h2def.py and generator/overrides.php.
Firstly, h2def.py on line 231 has
args=arg_split_pat.split(args,', ')
but the python manual says that this is incorrect for a compiled re object, the second parameter should be a limit integer. The expression is already compiled at line 215 with
arg_split_pat = re.compile("\s*,\s*")
Therefore line 231 should only be
args=arg_split_pat.split(args)
Which works for me, the original error that was produced was
Traceback (most recent call last):
File "../generator/h2def.py", line 345, in ?
write_def(filename,None)File "../generator/h2def.py", line 301, in write_def
buf = define_func(buf, fp)File "../generator/h2def.py", line 231, in define_func
args=arg_split_pat.split(args, ', ')TypeError: an integer is required Next, overrides.php has an error on line 117. Currently, it has problems if the $glob variable has any preg special characters, the line should be if (preg_match('!' . str_replace(array('*', '(', ')', '!'), array('.*', '\(', '\)', '\!'), $glob) . '!', $name)) instead of if (preg_match('!' . str_replace('*', '.*'), $glob) . '!', $name)) The current code produces errors with the output from the corrected code above. I am using the gtkmozembed.h file from the 1.3.1 mozilla distribution, I can send the file if you like. Regards Mike