[Mailman-Developers] no such file config.pck updating to 2.1b1
Georg Koch
gorg@sun31.imbi.uni-freiburg.de
Fri, 05 Apr 2002 10:12:53 +0200
> GK> OSError: [Errno 2] No such file or directory:
> GK> '/h/mailman/lists/test/config.pck'
>
> GK> because the configuration is stored as config.db.
>
> GK> How do I convert the config.db to config.pck ?
>
> You don't. While the error message is misleading, your config.db file
> will be automatically updated to config.pck the first time you load
> your list (via web, qrunner, or command line script).
>
Hi Barry,
but I cannot, because MailList.py stops with an uncatched exception
first. __load is called from load like this:
for file in (pfile, plast, dfile, dlast):
dict, e = self.__load(file)
so in __load the mtime of non-existing config.pck is asked and yields
the exception which is not handled.
I am in no way a python developer, so I moved some lines in
the definition of __load in MailList.py (see below) and could see the web
page http://ourhost/mailman/listinfo without an error - but it was
empty! (The right thing would probably be to catch the exception).
Georg
if dbfile.endswith('.db') or dbfile.endswith('.db.last'):
loadfunc = marshal.load
elif dbfile.endswith('.pck') or dbfile.endswith('.pck.last'):
loadfunc = cPickle.load
else:
assert 0, 'Bad database file name'
# moved lines
# mtime = os.path.getmtime(dbfile)
# if mtime <= self.__timestamp:
# # File is not newer
# return None, None
try:
fp = open(dbfile)
except IOError, e:
if e.errno <> errno.ENOENT: raise
return None, e
# moved to here
mtime = os.path.getmtime(dbfile)
if mtime <= self.__timestamp:
# File is not newer
return None, None
--
--
Georg Koch (koch@cochrane.de) | Phone: +49 761 203 6710
German Cochrane Centre | Fax: +49 761 203 6712
Mail: Institute of Medical Biometry and Medical Informatics
Stefan-Meier-Strasse 26, D-79104 Freiburg, Germany
"All you need in this life is ignorance and confidence, and then
success is sure." (Mark Twain)
--
--
Georg Koch (koch@cochrane.de) | Phone: +49 761 203 6710
German Cochrane Centre | Fax: +49 761 203 6712
Mail: Institute of Medical Biometry and Medical Informatics
Stefan-Meier-Strasse 26, D-79104 Freiburg, Germany
"All you need in this life is ignorance and confidence, and then
success is sure." (Mark Twain)