File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -187,10 +187,10 @@ def _open(
187187 parent = self ._parent (parent )
188188 if self .isfile (parent ):
189189 raise FileExistsError (parent )
190- if mode in ["rb" , "ab" , "r+b" ]:
190+ if mode in ["rb" , "ab" , "r+b" , "a+b" ]:
191191 if path in self .store :
192192 f = self .store [path ]
193- if mode == "ab" :
193+ if "a" in mode :
194194 # position at the end of file
195195 f .seek (0 , 2 )
196196 else :
@@ -199,8 +199,8 @@ def _open(
199199 return f
200200 else :
201201 raise FileNotFoundError (path )
202- elif mode in {"wb" , "xb " }:
203- if mode == "xb" and self .exists (path ):
202+ elif mode in {"wb" , "w+b" , "xb" , "x+b " }:
203+ if "x" in mode and self .exists (path ):
204204 raise FileExistsError
205205 m = MemoryFile (self , path , kwargs .get ("data" ))
206206 if not self ._intrans :
You can’t perform that action at this time.
0 commit comments