Closed steve-mavens closed 1 year ago
Hi, would you want to create a PR with the fix and a test for this?
Sure, I can do. It won't be today, though.
Also the terms of my employer's copyright waiver for open source contributions are such that it's best if I use my personal laptop to make the change, and that in turn means I'll be logged in using a different github user name (this is my work account because I found the issue while working, and I don't use work accounts on personal devices). Sorry for any confusion, it's just technically if I use work resources to write the code, they own the copyright on 10 lines of your project. I don't even know the internal process I have to go through to release those lines under an open source license, so it's best if I own them.
All contributions and contributors are mentioned in the release notes, and anyone can track them through PRs/commits. With that said, any contribution to this package is under the BSD3 license - so you can't "own" lines of code.
I think your company should go through the process of identifying open-source packages it uses and whether it wants to support/contribute to open-source projects or not. It is ok if not, though it will not encourage me to prioritize this bug.
They're not intentionally obstructing me, they just don't have a general policy. It makes sense for them not to authorise me to release their entire codebase under BSD, not so much for them not to authorise me to write and release one test. I agree that ideally the lawyers should do the work to produce a policy, but as things stand I'd have to get case-by-case approval for the company to contribute code to open source projects. It's hassle, so I'd rather just make absolutely sure of the difference between stuff they own that I can't give away, and stuff I own that I can.
Describe the bug
In fakeredis/_msgs.py, the message XGROUP_GROUP_NOT_FOUND_MSG uses
%s
for substitution placeholders. But that's not the right syntax for.format
, which uses curly braces. The %s don't get replaced:I would say that the fix is
XGROUP_GROUP_NOT_FOUND_MSG = "NOGROUP No such consumer group '{1}' for key name '{0}'"
, and do a pull request but with that change:It's still not quite right because the objects passed to the formatter are
bytes
, notstr
.Anyway you might not like my quick fix: maybe you want to pass the parameters in the order they appear in the message, so that it's
{} {}
rather than{1} {0}
, or maybe you want to name them. There are no other messages in that file with substitution placeholders in "the wrong order" for me to copy the style.To Reproduce
Traceback probably isn't very relevant, but since the template asks for it...
Expected behavior
or similar.
Desktop (please complete the following information):