[tahoe-lafs-trac-stream] [tahoe-lafs] #1634: TypeError due to "size" being None in pyfilesystem+dokan

tahoe-lafs trac at tahoe-lafs.org
Fri Dec 21 01:00:07 UTC 2012


#1634: TypeError due to "size" being None in pyfilesystem+dokan
-------------------------+-------------------------------------------------
     Reporter:  zooko    |      Owner:  somebody
         Type:  defect   |     Status:  new
     Priority:  major    |  Milestone:  1.11.0
    Component:  code-    |    Version:  1.9.0
  frontend-web           |   Keywords:  pyfilesystem dokan error webapi
   Resolution:           |  docs mutable test-needed
Launchpad Bug:           |
-------------------------+-------------------------------------------------
Changes (by davidsarah):

 * keywords:  pyfilesystem dokan error wui => pyfilesystem dokan error
     webapi docs mutable test-needed
 * component:  code => code-frontend-web
 * milestone:  undecided => 1.11.0


Comment:

 The '?' in the WUI is intended behaviour. It is too inefficient to
 calculate the size for every mutable file in a directory listing; it would
 require querying each file individually. Similarly, it's intended that the
 JSON output not include the actual file size. Representing the lack of a
 known file size by {{{"size": null}}} is dubious, though (even though it
 is valid JSON). We normally represent unknown information by omitting a
 field (which the pyFilesystem Tahoe-LAFS backend would be able to handle,
 using {{{info.get("size",0)}}}). For example, that's what we do for the
 {{{"mutable"}}} field on unknown nodes.

 [source:docs/frontends/webapi.rst at 05d0b8b5#getting-information-about-a
 -file-or-directory-as-json webapi.rst] fails to document how an unknown
 file size is represented.
 [source:git/src/allmydata/scripts/tahoe_ls.py at bbed5220#L112 tahoe_ls.py]
 appears to assume that an unknown size is represented by omitting the
 {{{"size"}}} field. (So, I'm not sure why {{{tahoe ls}}} correctly prints
 "?" rather than "null" for mutable files. Perhaps {{{"size": null}}} is
 only included sometimes?)

 In any case, the bug in the description doesn't seem to be related to the
 WUI. If we decide that omitting the {{{"size"}}} field is correct, then
 it's a bug in the web-API with JSON output; if we decide that {{{"size":
 null}}} is correct, it's a bug in the pyFilesystem Tahoe-LAFS backend.
 Either way, webapi.rst also needs to be clarified.

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1634#comment:4>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list