Repository navigation
fix(ftp): place FTP_DATA in the application layer, in its own module - #2357
Conversation
|
Review: NEEDS CHANGES at
|
4bd130c to
ee70b4f
Compare
|
Amended |
|
Coverage: 91.68% (unit tier, Python 3.15,
Per-file detail: the |
|
Ready to merge at
|
|
should we move |
|
My recommendation: keep it in |
|
Correction to my last comment: checked closer, and the precedent doesn't actually hold. Without it, I don't have a clean house-convention answer either way — this is a genuine judgment call rather than something existing code settles. Your call on whether to split it out. |
|
iirc, FTP and FTP_DATA are registered under different AppType/port. so better still separate. |
|
Splitting |
…2285) FTP_DATA derived from Raw alone, so its __layer__ was None, though ext.rst lists it under the application layer and the layer-placement convention puts the layer base first. A layer='application' extraction never stopped at it, and extract(layer=FTP_DATA) resolved to 'none'. Declare it class FTP_DATA(Application, Raw). Raw still does the parsing and rebuild; __index__ is Application's, raising IntError. FTP and FTP_DATA are reached under different AppType port entries, unlike RARP/DRARP's single shared destination, so FTP_DATA moves to its own module (ftp_data.py) rather than staying a sibling in ftp.py -- a pure move, since it needed nothing ftp.py's other imports carry. The old path keeps nothing behind it (#1744's no-re-exports rule); a versionremoved note on both the docstring and the docs page records where it shipped (v1.4.0-v1.4.1). Tests: FTP_DATA's bases, layer, Raw behaviour and layer-limited extraction in the layer-placement tests; the pcapkit.all grouping check no longer excuses an unset __layer__; the move is pinned by the #1744 no-re-export ledger and the #1739 module-identity sweep.
ee70b4f to
800a6ec
Compare
|
Review: GOOD TO GO at |
make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix — bug fixDescription
Closes #2285.
FTP_DATAnow subclassesApplicationas well asRaw(class FTP_DATA(Application, Raw)), so it has an__layer__andlayer='application'/layer=FTP_DATAextraction stops at it.__index__now raisesIntError(aTypeError) rather thanUnsupportedCall, matching FTP. Noted with aversionchanged.AppType/port entries (unlike RARP/DRARP, which share one registry code), soFTP_DATAmoves out offtp.pyinto a newftp_data.pyrather than staying a sibling there. It needed nothing elseftp.pyimports — a pure move. The old path keeps nothing behind it (refactor!: remove every surviving re-export of a moved name or module #1744's no-re-exports rule); aversionremovednote onftp.pyand its docs page records where it shipped.origin/main. Passing on the rebased head (53 passed, 229 subtests).