Fix reformat with template usage, try to catch IOError to have nice error message when file system is full

This commit is contained in:
dim 2007-11-28 16:07:11 +00:00
parent b85cc13d08
commit fb56f3fe00
2 changed files with 10 additions and 5 deletions

View File

@ -436,13 +436,15 @@ class PGLoader:
self._parse_fields('c_reformat', config.get(name, 'reformat'),
btype = True, argtype = 'string')
else:
self.c_reformat = self.reformat = None
# remember reformat could have been configured from template
if 'c_reformat' not in self.__dict__:
self.c_reformat = self.reformat = None
if DEBUG:
print 'reformat', self.c_reformat
# check the configure reformating is available
if self.c_reformat:
if not self.template and self.c_reformat:
import imp
self.reformat = []
@ -481,7 +483,7 @@ class PGLoader:
(r_module, r_function)
self.config_errors += 1
if DEBUG:
if DEBUG and not self.template:
print 'reformat', self.reformat
##

View File

@ -85,8 +85,11 @@ class Reject:
# now we close the two fds
for f in [fd_log, fd_data]:
f.flush()
f.close()
try:
f.flush()
f.close()
except IOError, e:
raise PGLoader_Error, e
self.errors += 1