Open alexhuth opened 6 years ago
Yeah, the behavior of ls()
lsdir()
and glob()
are a bit all over the place unfortunately.
For what you're trying to do, lsdir()
works perfectly fine. I agree ls()
should also behave without args or with ls('/')
.
ah but with whateverthefuck version of boto/botocore i'm on, lsdir is lame:
In [41]: cci.lsdir()
Out[41]: <map at 0x7f311a943f28>
although, fortunately:
In [45]: list(cci.lsdir())
Out[45]: ['stuff.tar.gz', 'script.py']
and cci.glob works as expected.
oh that's annoying.
we can add a little isinstance
check to the return object of lsdir()
as a temporary hack.
they bigger issue of the ls()
behavior remains. i probably won't get to this anytime soon though.
ok the behavior of lsdir
is now to convert to list (see f1cacda1). the remaining issue is behavior of ls()
which is issue #37.
gonna leave this open so that we remember to fix the root path behavior.
I'm having trouble ls'ing the root of a bucket. might be a boto/botocore issue. the problem is that
os.path.normpath
turns '' into '.', and then botocore barfs.for ref, boto is version 2.42.0, botocore is version 1.7.43. python 3.
also, related, running cci.ls with no arguments, which seems like it should ls the bucket root, just barfs because the decorator expects an argument:
if that's intended behavior, fine.