Skip to content

Fix KeyError/IndexError on negative ordinals in Hindi and Arabic#672

Open
santhreal wants to merge 1 commit into
savoirfairelinux:masterfrom
santhreal:fix/hi-ar-ordinal-reject-negative
Open

Fix KeyError/IndexError on negative ordinals in Hindi and Arabic#672
santhreal wants to merge 1 commit into
savoirfairelinux:masterfrom
santhreal:fix/hi-ar-ordinal-reject-negative

Conversation

@santhreal

Copy link
Copy Markdown

Arabic to_ordinal indexes arabicOrdinal with negatives, and Hindi to_ordinal_num KeyErrors on negatives/floats. Call verify_ordinal so both raise TypeError like other languages.

Hindi to_ordinal_num mapped str(value) through a digit-only table, so
negatives and floats raised KeyError on '-' or '.'. Arabic to_ordinal
indexed arabicOrdinal with negatives (returning the wrong ordinal) and
crashed on larger negatives in convert. Both now call verify_ordinal.
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

Successfully merging this pull request may close these issues.

1 participant