Opened 6 years ago

Closed 3 years ago

#4711 defect closed fixed (fixed)

Remove usage of FilePath.statinfo in twisted

Reported by: Ying Li Owned by: Ying Li
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/remove-statinfo-in-ftp-4711
branch-diff, diff-cov, branch-cov, buildbot
Author: cyli


FilePath.statinfo should be deprecated (see #4450) and thus it should no longer be used in Twisted.

It is still used in twisted.protocols.ftp, and twisted.web2.static

Change History (14)

comment:1 Changed 6 years ago by Ying Li

Author: cyli
Branch: branches/remove-usages-of-filepath-statinfo-4711

(In [30173]) Branching to 'remove-usages-of-filepath-statinfo-4711'

comment:2 Changed 6 years ago by Ying Li

Usage of FilePath.statinfo cannot be removed yet because FilePath does not provide accessors for some of the fields. So this ticket is on hold until #4712 is resolved.

comment:3 Changed 6 years ago by Ying Li

Branch: branches/remove-usages-of-filepath-statinfo-4711branches/begin-convert-usages-of-filepath-statinfo-4711

(In [30516]) Branching to 'begin-convert-usages-of-filepath-statinfo-4711'

comment:4 Changed 6 years ago by Ying Li

(In [30517]) Added a test to ensure that the new accessors for statinfo will work in place of statinfo in twisted/web2/

refs #4711

comment:5 Changed 6 years ago by Ying Li

(In [30537]) Changed FTP to (mostly) use the new accessor methods in t.p.filepath. However, an accessor for permissions is missing.

refs #4711

comment:6 Changed 6 years ago by Ying Li

Filed ticket #4813 for filepath to provide the permissions

comment:7 Changed 6 years ago by Ying Li

Owner: changed from Glyph to Ying Li
Status: newassigned

comment:8 Changed 6 years ago by <automation>

Owner: Ying Li deleted

comment:9 Changed 4 years ago by Itamar Turner-Trauring

Can this ticket be finished now that #4813 is closed?

comment:10 Changed 3 years ago by Ying Li

Branch: branches/begin-convert-usages-of-filepath-statinfo-4711branches/remove-statinfo-in-ftp-4711

(In [42358]) Branching to remove-statinfo-in-ftp-4711.

comment:11 Changed 3 years ago by Ying Li

Keywords: review added
Status: assignednew

Sorry for not getting back to this in a while. So, getUserID(), getGroupID(), and getNumberOfHardLinks() are not implemented for windows in filepath, so this changes the behavior of FTP a bit, because it just returns hardlinks: 0, user: "0", group: "0" in windows, since that's probably the previous behavior (stat in windows seems to set those values to 0 anyway:

comment:12 Changed 3 years ago by Adi Roiban

Looks good to merge. Thanks!

comment:13 Changed 3 years ago by Glyph

Keywords: review removed
Owner: set to Ying Li
Type: enhancementdefect

I concur with Adi's analysis. Thanks for eliminating this unpleasant implementation detail from ftp.

comment:14 Changed 3 years ago by Ying Li

Resolution: fixed
Status: newclosed

(In [42473]) Merge remove-statinfo-in-ftp-4711

Author: cyli Reviewer: adiroiban, glyph Fixes: #4711

Removes the final usage of twisted.python.filepath.FilePath.statinfo from the Twisted codebase

Note: See TracTickets for help on using tickets.