On Thu, May 29, 2008 at 2:53 PM, Thomas Heller <[EMAIL PROTECTED]> wrote: > Suraj Barkale schrieb: >> Hi, >> I have been using a script which extracts data from a word >> document. However, the script suddenly stopped working. Following >> sequence of command reproduces the problem I am facing. Once I get the >> "ValueError" exception, any further operations on Find object result >> in a segfault. I do not know what all has changed on my machine since >> I ran the script in the past. I tried reinstalling comtypes & python >> to no avail. I am using comtypes version 0.4.2. Can somebody give my >> any advice on finding out root cause of the problem? > > I can repro the behaviour, but it seems that *any* operation on the > Find object fails - either with a ValueError similar to what you get (the > number of bytes in excess is different), with an AccessViolation, or > even with a Python fatal error.
Yes I am getting the same behavior. > > Can you do any sucessfull operations on the Find object? > > I have no idea if it worked better in the past, there is no unittest using > the Find object, and I don't use word via COM myself. I was using Find object in a script written 3/4 months ago without any problems. In fact one of my co-workers *is* using the script without any problems. Last week I was trying to add some functionality when the script when I noticed that it no longer worked on my machine. > The behaviour looks like the generated code would be wrong (there was > such an issue in the past), but at first inspection I cannot find what's > wrong. > Can you try out if any older comtypes version works better? > > Thanks, > Thomas > My co-worker is using comtypes 0.4.1 however, I still get the same errors if I downgrade. We are currently geographically separated so I can not just walk over & check his PC. I got the generated code from the working installation but there is no difference between Find.__method__ of working & non working code. I thought that the problem was with my installation of Word but win32com has no problem using the Find object. Is there a way to debug the call to Content.Find? I could not debug it using WinPdb. Thanks & Regards, Suraj ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users