The bug
When trying to use /op, /deop, /ban or /pardon with @s (note that @p works), the following error is shown:
Only players may be affected by this command, but the provided selector includes entities
How to reproduce
Start a server
Try to run the following command
/op @s
20w29a and all versions after 1.15 pre2 as well (even current 1.16)
To fix, this command would instead have to check while running the OP function if the entity is a player or not instead of only throwing errors when the selector is able to target a non-player entity.
Would be great if fixed for functions on data packs to control OPing players on servers which also do other things to the player/show messages in chat.