| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| "found {}".format(value)) | ||
| digits = '' | ||
| while value and value[0].isdigit(): | ||
| while value and '0' <= value[0] <= '9': |
There was a problem hiding this comment.
| while value and '0' <= value[0] <= '9': | |
| while value and ('0' <= value[0] <= '9'): |
It will a bit clearer. Or you can still use a separate function to make it even cleareer. The bottleneck won't be the function call IMO.
Sorry, something went wrong.
There was a problem hiding this comment.
I did that, but not the separate function. It was my understanding that @StanFromIreland was leaning towards not having an inner function
Sorry, something went wrong.
There was a problem hiding this comment.
This is fine, I was against the function to check if it is in a dictionary.
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you! Just moved it to a separate function for extra-clarity
Sorry, something went wrong.
|
Could you also test with, for example, ߅ (NKO DIGIT FIVE), which int accepts? |
Sorry, something went wrong.
Thank you for looking into this. In my understanding, those are the possible scenarios:
|
Sorry, something went wrong.
IMO, they should be accepted and raise a defect. |
Sorry, something went wrong.
Thank you, I agree. This is now implemented. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
I think that what we should to do here is change the incorrect isdigit to isdecimal and add as_ew_allowed=False to MIMEVersion. If I'm reading rfc 6532 correctly (though it is quite possible I'm not) then non-ascii decimal digits are not a defect unless you are serializing to ascii. (They should already show up as non-ascii defects when parsing with utf8=False.) If we make those changes that should eliminate the exception, and the new code proposed in #122540 should raise an error if the header is serialized with utf8=False. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 90 days with no activity. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
With those changes, the MIME parameter parser discards parameters with an invalid section number that uses a digit not convertible to integer such as super-script "²" or "𐩃" (Kharosthi number).
For backwards compatibility, keep accepting non-ASCII digits that can be converted to integers, such as NKO digits.
Before:
After: