[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2394: ftp "ls" command is broken
Tahoe-LAFS
trac at tahoe-lafs.org
Thu Mar 26 01:03:28 UTC 2015
#2394: ftp "ls" command is broken
-------------------------------------+-------------------------------------
Reporter: warner | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.10.1
Component: code-frontend-ftp- | Version: 1.10.0
sftp | Keywords: ftpd regression blocks-
Resolution: | release
Launchpad Bug: |
-------------------------------------+-------------------------------------
Comment (by warner):
Yeah, I think that's it. Twisted-14.0.2 expected an int, Twisted-15.0.0
expects a `Permissions` (and the docstring is still out of date:
https://twistedmatrix.com/trac/ticket/7833).
I don't see any clean way to test which version of Twisted is calling us,
so I think I'm going to use an ugly hack. The old Twisted uses this
function to render the integer mode value
(https://github.com/twisted/twisted/blob/twisted-14.0.2/twisted/protocols/ftp.py#L428):
{{{
def formatMode(mode):
return ''.join([mode & (256 >> n) and 'rwx'[n % 3] or '-' for n in
range(9)])
}}}
and the new Twisted uses this
(https://github.com/twisted/twisted/blob/twisted-15.0.0/twisted/protocols/ftp.py#L464)
{{{
'permissions': permissions.shorthand(),
}}}
So I'm thinking we create a subclass of `Permissions` that overrides the
`__and__` operator to return an int for the first form, but has a
`.shorthand()` for the second form.
Evil! :-)
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2394#comment:3>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list