bytter at gmail.com
Wed Jan 31 15:47:12 CET 2007
I'm banging my head over this one... sometimes it just works... *argh*
Here's a snip of my problem:
engine = win32com.client.Dispatch("DAO.DBEngine.36")
table = 'STUFFTODELETE'
dstFilename = 'in.mdb'
workingfile = 'work.mdb'
print 'Sleeping 5 after copy...'
dstDb = engine.OpenDatabase(workingfile)
print 'Sleeping 5 after open...'
dstDb.Execute('DELETE FROM ' + table)
At at *exactly* this line, I get the error:
com_error: (-2147352567, 'Exception occurred.', (0, 'DAO.Database', 'Not a
valid bookmark.', 'jeterr40.chm', 5003159, -2146825129), None)
Sometimes... Yes, the database is a %"#$"# MSAccess. This script is running
On 1/31/07, Hugo Ferreira <bytter at gmail.com> wrote:
> Well.. Thx for the answers.
> The only way I had to make it work was to use a time.sleep(10) after the
> shutil.copyfile(). Since this is a night-run script, I can waste 10
> seconds, but it still knocks me out "why" it happens...
> Hugo Ferreira
> On 30 Jan 2007 18:06:15 +0000 (GMT), Matthew Woodcraft <mattheww at chiark.greenend.org.uk>
> > Hugo Ferreira < bytter at gmail.com> wrote:
> > > I have a problem. I'm using calling shutil.copyfile() followed by
> > > open(). The thing is that most of the times open() is called before
> > > the actual file is copied. I don't have this problem when doing a
> > > step-by-step debug, since I give enough time for the OS to copy the
> > > file, but at run-time, it throws an exception.
> > >
> > > Is there anyway to force a sync copy of the file (make python wait for
> > > the completion)?
> > shutil.copyfile() closes both files before it returns, so I suspect
> > this is an OS-level bug.
> > The most likely culprits are buggy network filesystems and buggy
> > on-access virus scanners.
> > -M-
> > --
> > http://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list