flying-circus / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

makedir call signature mismatch #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in revision 748, fs/expose/fuse/__init__.py line 232, in the definition of 
FSOperations.mkdir:

mkdir at the fuse level takes a path and a mode. the first thing pyfilesystem 
tries to do (after decoding the path) is pass the path *and* the mode up to the 
filesystem that subclasses fs.base.FS's makedir method. so here, the expected 
signature of fs.base.FS.makedir is

  def makedir(self, path, mode=None)

however, the makedir signature is advertised as

  def makedir(self, path, recursive=False, allow_recreate=False)

i don't know enough to know which signature should be right, but i expect the 
fuse expose layer needs to be fixed. to match this. maybe some combination?

  def makedir(self, path, recursive=False, allow_recreate=False, mode=None) ?

right now the variable 'recursive' is getting the mode, which is not the right 
thing.

Original issue reported on code.google.com by jtolds on 24 Jan 2012 at 7:04

GoogleCodeExporter commented 9 years ago
PyFilesystem doesn't have any notion of permissions since its not in the common 
subset of functionality.

However, it may be worthwhile just passing that mode parameter through so an 
implementation could use it if it wishes.

Original comment by willmcgugan on 24 Jan 2012 at 7:51

GoogleCodeExporter commented 9 years ago
well, i think it's an okay solution to not pass it through at all, but right 
now it is passing it through in the wrong argument position. either way, and 
thanks

Original comment by jtolds on 24 Jan 2012 at 8:07

GoogleCodeExporter commented 9 years ago
Fixed in trunk. Will leave the ticket open as a reminder to re-think the 
signature.

Original comment by willmcgugan on 24 Jan 2012 at 8:16

GoogleCodeExporter commented 9 years ago

Original comment by willmcgugan on 10 Sep 2013 at 8:55