@@ -235,10 +235,10 @@ class DbfilenameShelf(Shelf):
235235 See the module's __doc__ string for an overview of the interface.
236236 """
237237
238- def __init__ (self , filename , flag = 'c' , protocol = None , writeback = False , * ,
239- serializer = None , deserializer = None ):
238+ def __init__ (self , filename , flag = 'c' , protocol = None , writeback = False ,
239+ mode = 0o666 , * , serializer = None , deserializer = None ):
240240 import dbm
241- Shelf .__init__ (self , dbm .open (filename , flag ), protocol , writeback ,
241+ Shelf .__init__ (self , dbm .open (filename , flag , mode ), protocol , writeback ,
242242 serializer = serializer , deserializer = deserializer )
243243
244244 def clear (self ):
@@ -248,19 +248,21 @@ def clear(self):
248248 self .cache .clear ()
249249 self .dict .clear ()
250250
251- def open (filename , flag = 'c' , protocol = None , writeback = False , * ,
252- serializer = None , deserializer = None ):
251+ def open (filename , flag = 'c' , protocol = None , writeback = False ,
252+ mode = 0o666 , * , serializer = None , deserializer = None ):
253253 """Open a persistent dictionary for reading and writing.
254254
255255 The filename parameter is the base filename for the underlying
256256 database. As a side-effect, an extension may be added to the
257257 filename and more than one file may be created. The optional flag
258258 parameter has the same interpretation as the flag parameter of
259259 dbm.open(). The optional protocol parameter specifies the
260- version of the pickle protocol.
260+ version of the pickle protocol. The optional mode parameter is
261+ passed to dbm.open() and controls the file mode when creating a
262+ new shelf, set to 0666 by default.
261263
262264 See the module's __doc__ string for an overview of the interface.
263265 """
264266
265- return DbfilenameShelf (filename , flag , protocol , writeback ,
267+ return DbfilenameShelf (filename , flag , protocol , writeback , mode ,
266268 serializer = serializer , deserializer = deserializer )
0 commit comments