I was hoping someone could tell me what I am doing wrong. I am running
a SVN checkout from this morning and all the pyfilesystem unit tests
pass on my system. I am using Python 2.7.2 and I have tried it on
Ubunutu 11.10 & OS X Lion.
I have the following code:
from fs.memoryfs import
MemoryFS
from fs import utils as
fs_utils
a =
MemoryFS()
b =
MemoryFS()
a.makedir("/
foo")
a.createfile("/foo/
bar.txt")
a.setcontents("/foo/bar.txt",
"hello")
print a.getcontents("/foo/
bar.txt")
fs_utils.movedir(a, b)
and when I run it I get the following output:
hello
Traceback (most recent call last):
File "main.py", line 9, in <module>
fs_utils.movedir(a, b)
File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site-
packages/fs-0.4.1-py2.7.egg/fs/utils.py", line 214, in movedir
chunk_size=chunk_size)
File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site-
packages/fs-0.4.1-py2.7.egg/fs/base.py", line 143, in acquire_lock
return func(self, *args, **kwargs)
File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site-
packages/fs-0.4.1-py2.7.egg/fs/mountfs.py", line 374, in movedir
super(MountFS,self).movedir(src,dst,**kwds)
File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site-
packages/fs-0.4.1-py2.7.egg/fs/base.py", line 1177, in movedir
raise DestinationExistsError(dst)
fs.errors.DestinationExistsError: Destination exists: dst
> I was hoping someone could tell me what I am doing wrong. I am running > a SVN checkout from this morning and all the pyfilesystem unit tests > pass on my system. I am using Python 2.7.2 and I have tried it on > Ubunutu 11.10 & OS X Lion.
> I have the following code:
> from fs.memoryfs import > MemoryFS > from fs import utils as > fs_utils > a = > MemoryFS() > b = > MemoryFS() > a.makedir("/ > foo") > a.createfile("/foo/ > bar.txt") > a.setcontents("/foo/bar.txt", > "hello") > print a.getcontents("/foo/ > bar.txt") > fs_utils.movedir(a, b)
> and when I run it I get the following output:
> hello > Traceback (most recent call last): > File "main.py", line 9, in <module> > fs_utils.movedir(a, b) > File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site- > packages/fs-0.4.1-py2.7.egg/fs/utils.py", line 214, in movedir > chunk_size=chunk_size) > File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site- > packages/fs-0.4.1-py2.7.egg/fs/base.py", line 143, in acquire_lock > return func(self, *args, **kwargs) > File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site- > packages/fs-0.4.1-py2.7.egg/fs/mountfs.py", line 374, in movedir > super(MountFS,self).movedir(src,dst,**kwds) > File "/home/jonathan/.virtualenvs/fstests/local/lib/python2.7/site- > packages/fs-0.4.1-py2.7.egg/fs/base.py", line 1177, in movedir > raise DestinationExistsError(dst) > fs.errors.DestinationExistsError: Destination exists: dst
Thanks for the quick response. Adding overwrite=True caused it to
raise a KeyError but when I changed it to use copydir instead (which
is what I really wanted when I thought about it) it worked fine.
Jonathan.
On Jan 11, 9:48 am, Will McGugan <willmcgu...@gmail.com> wrote:
> Yeah, spotted that one recently. Will fix soon. In the meantime, I think it
> will work if you add 'overwrite=True'.
> Will
> On Wed, Jan 11, 2012 at 9:45 AM, Jonathan <jonathan.harring...@gmail.com>wrote:
> > Hi,
> > I was hoping someone could tell me what I am doing wrong. I am running
> > a SVN checkout from this morning and all the pyfilesystem unit tests
> > pass on my system. I am using Python 2.7.2 and I have tried it on
> > Ubunutu 11.10 & OS X Lion.
> Thanks for the quick response. Adding overwrite=True caused it to > raise a KeyError but when I changed it to use copydir instead (which > is what I really wanted when I thought about it) it worked fine.
> Jonathan.
> On Jan 11, 9:48 am, Will McGugan <willmcgu...@gmail.com> wrote: > > Yeah, spotted that one recently. Will fix soon. In the meantime, I think > it > > will work if you add 'overwrite=True'.
> > Will
> > On Wed, Jan 11, 2012 at 9:45 AM, Jonathan <jonathan.harring...@gmail.com > >wrote:
> > > Hi,
> > > I was hoping someone could tell me what I am doing wrong. I am running > > > a SVN checkout from this morning and all the pyfilesystem unit tests > > > pass on my system. I am using Python 2.7.2 and I have tried it on > > > Ubunutu 11.10 & OS X Lion.