[PATCH] UIDMaps: prevent from leaving a truncated map file

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed Dec 21 12:41:37 GMT 2016


On Wed, Dec 21, 2016 at 10:50:27AM +0000, Łukasz Żarnowiecki wrote:

> Hi Nicolas,

Hi Łukasz,

> On Mon, Oct 24, 2016 at 03:26:15AM +0200, Nicolas Sebrecht wrote:
> >      def _loadmaps(self):
> > -        with self.maplock:
> > -            mapfilename = self._getmapfilename()
> > +        mapfilename = self._getmapfilename()
> > +        mapfilenametmp = "%s.tmp"% mapfilename
> > +        mapfilenamelock = "%s.lock"% mapfilename

> Maybe it is better to use format function.  It is recommended for use in
> Python 3.

I don't have strong opinion about that.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list