You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(const): Command.get calls key.upper() on any key, so bytes mint and ints raise AttributeError #1824
Describe the bug Command.get (pcapkit/const/ftp/command.py:551, generated from pcapkit/vendor/ftp/command.py) is a staticmethod that calls key.upper() without checking the key's type. Measured on main:
Command.get(b'\x01') returns <Command.b'\x01': None>, a bogus unregistered member keyed by bytes.
Command.get(-1) raises AttributeError: 'int' object has no attribute 'upper', which is a builtin error rather than an in-library one, and default is ignored.
Method.get had the same shape. #908 fixed it: it became a classmethod that delegates to EnumLookup.get and rejects a non-str key with ValueError (see its versionchanged:: 1.5.0).
Expected behavior Command.get follows Method.get: a non-str key is rejected with the in-library error, and a str key keeps today's case-insensitive lookup and unregistered-member fallback. A test pins each case.
Additional context
Found by #1816's worker (#1823). Blocked until #1823 merges, because both change pcapkit/vendor/ftp/command.py and the const file it generates.
Activity
JarryShaw commentedon Oct 16, 2026
Blocked until #1823 merges, since both change
pcapkit/vendor/ftp/command.py.JarryShaw commentedon Oct 16, 2026
Unblocked: #1823 has merged. A worker is on it.
fix(const): make Command.get reject a non-str key as Method.get does (#…