mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
SFTP: report unknown sizes as "0" instead of "?", to satisfy some clients. fixes #1337
This commit is contained in:
parent
d318122cd2
commit
ed67df866c
@ -142,7 +142,10 @@ def _lsLine(name, attrs):
|
||||
st_gid = "tahoe"
|
||||
st_mtime = attrs.get("mtime", 0)
|
||||
st_mode = attrs["permissions"]
|
||||
st_size = attrs.get("size", "?")
|
||||
|
||||
# Some clients won't tolerate '?' in the size field (#1337).
|
||||
st_size = attrs.get("size", 0)
|
||||
|
||||
# We don't know how many links there really are to this object.
|
||||
st_nlink = 1
|
||||
|
||||
|
@ -293,17 +293,17 @@ class Handler(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, unittest.TestCas
|
||||
|
||||
gross = u"gro\u00DF".encode("utf-8")
|
||||
expected_root = [
|
||||
('empty_lit_dir', r'dr-xr-xr-x .* \? .* empty_lit_dir$', {'permissions': S_IFDIR | 0555}),
|
||||
('empty_lit_dir', r'dr-xr-xr-x .* 0 .* empty_lit_dir$', {'permissions': S_IFDIR | 0555}),
|
||||
(gross, r'-rw-rw-rw- .* 1010 .* '+gross+'$', {'permissions': S_IFREG | 0666, 'size': 1010}),
|
||||
# The fall of the Berlin wall may have been on 9th or 10th November 1989 depending on the gateway's timezone.
|
||||
#('loop', r'drwxrwxrwx .* \? Nov (09|10) 1989 loop$', {'permissions': S_IFDIR | 0777}),
|
||||
('loop', r'drwxrwxrwx .* \? .* loop$', {'permissions': S_IFDIR | 0777}),
|
||||
('mutable', r'-rw-rw-rw- .* \? .* mutable$', {'permissions': S_IFREG | 0666}),
|
||||
('readonly', r'-r--r--r-- .* \? .* readonly$', {'permissions': S_IFREG | 0444}),
|
||||
#('loop', r'drwxrwxrwx .* 0 Nov (09|10) 1989 loop$', {'permissions': S_IFDIR | 0777}),
|
||||
('loop', r'drwxrwxrwx .* 0 .* loop$', {'permissions': S_IFDIR | 0777}),
|
||||
('mutable', r'-rw-rw-rw- .* 0 .* mutable$', {'permissions': S_IFREG | 0666}),
|
||||
('readonly', r'-r--r--r-- .* 0 .* readonly$', {'permissions': S_IFREG | 0444}),
|
||||
('small', r'-rw-rw-rw- .* 10 .* small$', {'permissions': S_IFREG | 0666, 'size': 10}),
|
||||
('small2', r'-rw-rw-rw- .* 26 .* small2$', {'permissions': S_IFREG | 0666, 'size': 26}),
|
||||
('tiny_lit_dir', r'dr-xr-xr-x .* \? .* tiny_lit_dir$', {'permissions': S_IFDIR | 0555}),
|
||||
('unknown', r'\?--------- .* \? .* unknown$', {'permissions': 0}),
|
||||
('tiny_lit_dir', r'dr-xr-xr-x .* 0 .* tiny_lit_dir$', {'permissions': S_IFDIR | 0555}),
|
||||
('unknown', r'\?--------- .* 0 .* unknown$', {'permissions': 0}),
|
||||
]
|
||||
|
||||
d.addCallback(lambda ign: self.handler.openDirectory(""))
|
||||
|
Loading…
Reference in New Issue
Block a user