Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend bytes error handling #1574

Open
stevesmoot opened this issue Oct 17, 2023 · 1 comment
Open

extend bytes error handling #1574

stevesmoot opened this issue Oct 17, 2023 · 1 comment

Comments

@stevesmoot
Copy link
Collaborator

in bytes::[lower|upper] can fail in undocumented ways #1251
(note it also applied to decode)

we ended up copying the Python method, or at least some of them.
Totally can work with those, but in fact would prefer a new one that may be more spicy-relevent
I'd call it QUIT, basically as soon as something doesnt work, return b""
The reason, is that this comes up in handling keywords in parsing (at least for me it does...) and if I have non-printable data then I know somethings wrong, I no longer care about matching it, and just seeing empty would be fine, it wont match a keyword.

So, if you think this makes sense, happy to try and add it as an option sometime.

@rsmmr
Copy link
Member

rsmmr commented Oct 18, 2023

Yeah, I can see that being useful, give it a try. Not quite sure about the name, could maybe see ABORT instead of QUIT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants