Closed dgw closed 1 month ago
Hey, this one could easily go into Sopel 8.0.1 to me. Like a hotfix of something that should be done but isn't.
Like a hotfix of something that should be done but isn't.
Yeah, it is, isn't it? I will tweak the safe()
docstring though, as it really should mention NUL in the topline and also explain why the method exists at all.
Netlify still does branch previews of our docs (for now… they are still stuck on Python 3.8 with no apparent plans to upgrade) but including a preview screenshot of the updated docs for this function anyway didn't seem like a bad idea.
Note I also fixed the \x00
references in the docstring, which needs to use \\x00
for the text to display as intended.
Description
Fixes #2566.
In
test_irc_utils
suite, rewrotetest_safe
andtest_safe_bytes
to generate a bunch more permutations of invalid characters automatically rather than writing them all out. The horse is definitely beaten far past death at this point... but the tests sure are thorough(bred).Also renamed
test_safe_null
->test_safe_none
to avoid confusion;test_safe
andtest_safe_bytes
are the cases that check behavior with null characters/bytes. Python's docs technically do refer toNone
as the "null object" once or twice, but most of the docs (and most of us devs) simply call itNone
.Checklist
make qa
(runsmake lint
andmake test
)make lint
myself, and tried out the test runner integration in VS Code / Gitpod. Very slick; made iterating my updated tests much easier without always tabbing back to the terminal.Notes
This could go into 8.0.1, but I don't really want to mess around with hotfixes unless there's a major bug. I'm open to suggestions for improving the maintenance-branch workflow; since
master
is de facto for 8.1.0 dev now, the options are to keep the8.0.x
branch unprotected so I can push cherry-picks to it directly, or make @sopel-irc/rockstars review the same PR twice (once tomaster
, once to8.0.x
) for full CI coverage. I don't love either of those.