Opened 4 years ago

Closed 4 months ago

#4711 defect closed fixed (fixed)

Remove usage of FilePath.statinfo in twisted

Reported by: cyli Owned by: cyli
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/remove-statinfo-in-ftp-4711
(diff, github, buildbot, log)
Author: cyli Launchpad Bug:

Description

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 4 years ago by cyli

  • Author set to cyli
  • Branch set to branches/remove-usages-of-filepath-statinfo-4711

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

comment:2 Changed 4 years ago by cyli

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 4 years ago by cyli

  • Branch changed from branches/remove-usages-of-filepath-statinfo-4711 to branches/begin-convert-usages-of-filepath-statinfo-4711

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

comment:4 Changed 4 years ago by cyli

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

refs #4711

comment:5 Changed 4 years ago by cyli

(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 4 years ago by cyli

Filed ticket #4813 for filepath to provide the permissions

comment:7 Changed 4 years ago by cyli

  • Owner changed from glyph to cyli
  • Status changed from new to assigned

comment:8 Changed 4 years ago by <automation>

  • Owner cyli deleted

comment:9 Changed 17 months ago by itamar

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

comment:10 Changed 4 months ago by cyli

  • Branch changed from branches/begin-convert-usages-of-filepath-statinfo-4711 to branches/remove-statinfo-in-ftp-4711

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

comment:11 Changed 4 months ago by cyli

  • Keywords review added
  • Status changed from assigned to new

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: http://stackoverflow.com/questions/5275731/os-stat-on-windows)

comment:12 Changed 4 months ago by adiroiban

Looks good to merge. Thanks!

comment:13 Changed 4 months ago by glyph

  • Keywords review removed
  • Owner set to cyli
  • Type changed from enhancement to defect

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

comment:14 Changed 4 months ago by cyli

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

(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.