#457 closed defect (duplicate)

tahoe ls fails if you list a file

Reported by: robk Owned by: robk
Priority: minor Milestone: eventually
Component: code-frontend-cli Version: 1.0.0
Keywords: news-done Cc:
Launchpad Bug:

Description (last modified by zooko)

in experimenting with 'tahoe ls' I found that directories display, but that there's no '-l' or even '-F' indication of what's a file and what's a directory

furthermore, if you 'tahoe ls' a file, tahoe explodes

Traceback (most recent call last):
  File "/Users/robk/trees/tahoe/support/bin/tahoe", line 7, in ?
    sys.exit(
  File "/Users/robk/trees/tahoe/src/allmydata/scripts/runner.py", line 77, in run
    rc = runner(sys.argv[1:])
  File "/Users/robk/trees/tahoe/src/allmydata/scripts/runner.py", line 66, in runner
    rc = cli.dispatch[command](so, stdout, stderr)
  File "/Users/robk/trees/tahoe/src/allmydata/scripts/cli.py", line 235, in list
    stdout, stderr)
  File "/Users/robk/trees/tahoe/src/allmydata/scripts/tahoe_ls.py", line 55, in list
    childtype = child[0]
KeyError: 0

when it tries to unpack the json packed structure of the 'specified directory' i.e. tahoe ls assumes only directories will be named, and fails if a file is named, but provides no indication either way.

Change History (4)

comment:1 Changed at 2008-06-11T07:04:56Z by robk

  • Owner set to robk
  • Priority changed from major to minor

duh. ls has -l and -F. missed that.

so simply a little cleanup in the handling of ls of files

comment:2 Changed at 2009-06-30T18:08:13Z by zooko

  • Description modified (diff)
  • Milestone changed from 1.5.0 to eventually

comment:3 Changed at 2009-11-20T19:22:37Z by warner

  • Resolution set to duplicate
  • Status changed from new to closed

#771 covers the same problem and has more information (and a patch!). So I'm closing this one as a duplicate, even though it's older.

comment:4 Changed at 2010-02-02T05:51:54Z by davidsarah

  • Keywords news-done added
Note: See TracTickets for help on using tickets.