dwooqfuuguserssourceforgenet revision 3165 httpspambayessvnsourceforgenetspambayesrev3165viewrev author montanaro date 20071021 194247 0700 sun 21 oct 2007 log message isolate code safely write pickles used elsewhere system dave abrahams sf patch 1816240 modified paths trunkspambayesspambayesstoragepy modified trunkspambayesspambayesstoragepy trunkspambayesspambayesstoragepy 20071022 022903 utc rev 3164 trunkspambayesspambayesstoragepy 20071022 024247 utc rev 3165 856 8536 no_updateprobs false probabilities autoupdated training updateprobs true probabilities autoupdated training def safe_picklefilename value protocol0 store value pickle without creating corruption defensive possible always keep safe copy tmp filename tmp fp none try fp opentmp wb pickledumpvalue fp protocol fpclose except ioerror e optionsglobals verbose print sysstderr failed update stre fp none osremovetmp raise try nix rename long permissions correct old file vanish win32 wont work python help says may way atomic replace rename old one put new one delete old one something goes wrong least copy old one osrenametmp filename except oserror osrenamefilename filename bak osrenametmp filename osremovefilename bak class pickledclassifierclassifierclassifier classifier object persisted pickle 14131 1717 optionsglobals verbose print sysstderr persistingselfdb_nameas pickle defensive possible keep always safe copy tmp selfdb_name tmp try fp opentmp wb pickledumpself fp pickle_type fpclose except ioerror e optionsglobals verbose print sysstderr failed update stre fp none osremovetmp raise try nix rename long permissions correct old file vanish win32 wont work python help says may way atomic replace rename old one put new one delete old one something goes wrong least copy old one osrenametmp selfdb_name except oserror osrenameselfdb_name selfdb_name bak osrenametmp selfdb_name osremoveselfdb_name bak safe_pickleselfdb_name self pickle_type def closeself keep resources open nothing sent sourceforgenet collaborative development platform worlds largest open source development site _______________________________________________ spambayescheckins mailing list pnperxdpvsarswdlppythonorg httpmailpythonorgmailmanlistinfospambayescheckins tue 05 aug 2008 191223 0700 spambayescheckins sfnet svn spambayes 3165 trunkspambayesspambayesstoragepy