Repository navigation
Commit d951177
authored
16 of the 24 dict-based crawlers' `process(self, data)` ignored the `data`
argument and read the module-level `DATA` literal instead: `ipv4/qs_function`,
`tos_del`, `tos_ecn`, `tos_pre`, `tos_rel`, `tos_thr`, `ts_flag`;
`ipv6/option_action`, `qs_function`, `smf_dpd_mode`; `mh/binding_error`,
`lla_code`; and `pcapng/filter_type`, `hash_algorithm`, `secrets_type`,
`verdict_type`. 8 siblings, such as `ipv4/classification_level`, already use
`data` correctly.
Harmless today, since every real call site passes `request()`'s own
`DATA`-returning value, so `data is DATA` always held in practice -- but a
caller passing different data, such as a test fixture or a future
`LINK`-based fetch (the open TODO in `pcapng/filter_type.py` already points
that direction), got the module's table back regardless, with no error.
`pcapkit-vendor` regenerates `pcapkit/const/`, not `pcapkit/vendor/` itself:
these dict-based crawlers are hand-written, so no template needed the same
fix and no `const/` regeneration follows from it.
New test drives each crawler's `count()` and `process()` on a fabricated
registry sharing none of the module's names, proving the rendered output now
reflects the argument rather than the module global; confirmed to fail
against the unfixed crawlers first.
Closes #2429.
1 parent cfbe5dc commit d951177
19 files changed
Lines changed: 183 additions & 16 deletions
File tree
- docs/source/changelog
- pcapkit/vendor
- ipv4
- ipv6
- mh
- pcapng
- tests/vendor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
460 | 461 | | |
461 | 462 | | |
462 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3350 | 3350 | | |
3351 | 3351 | | |
3352 | 3352 | | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
3353 | 3365 | | |
3354 | 3366 | | |
3355 | 3367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments