Hi All,
I'm currently using htmltmpl from python on a windows machine, and am having
an issue with it failing to unlock the precompiled template file.
A dump of the exception log is below:
Traceback (most recent call last):
File "D:\workspace\HitCounter\src\HTMLReport\Test.py", line 21, in
<module>
template = htmltmpl.TemplateManager().prepare("ip_report.tmpl")
File "C:\Python26\lib\site-packages\htmltmpl.py", line 204, in prepare
precompiled = self.load_precompiled(file)
File "C:\Python26\lib\site-packages\htmltmpl.py", line 341, in
load_precompiled
self.lock_file(file, LOCK_UN)
File "C:\Python26\lib\site-packages\htmltmpl.py", line 284, in lock_file
msvcrt.locking(fd, msvcrt.LK_UNLCK, 1)
IOError: [Errno 13] Permission denied
The program correctly generates the template file on its first run, but on
all subsequent runs it issues the above error messages. If I manually delete
the precompiled version, I can run the program once, but have the same issue
crop up.
I'm basically using htmltmpl as follows:
template = htmltmpl.TemplateManager().prepare("ip_report.tmpl")
proc = htmltmpl.TemplateProcessor()
proc.set("Datarows", rows)
proc.set("date", "2009/4/20")
print proc.process(template)
Thank you kindly,
Gregory Gelfond
|