_pyrepl.input.KeymapTranslator
tests for non-existent Unicode category
#123682
Labels
_pyrepl.input.KeymapTranslator
tests for non-existent Unicode category
#123682
Bug report
Bug description:
The implementation of
_pyrepl.input.KeymapTranslator
has a check for input with Unicode category"C"
. This code has been present since the initial commit of the new REPL in #111567. However, no such category is ever returned byunicodedata
because there is no"C"
entry in the list of category names¹I'm not familiar enough with
_pyrepl
to know what the implications of this always-false predicate are, but I do know that the block in question is effectively dead code because of it.I think this is meant to be a
.startswith()
check for theOther
category identified by UAX #44, i.e. the union ofCc | Cf | Cs | Co | Cn
, in line with other usage in_pyrepl.reader
. I'll open a PR for that.¹ the list of category names is hardcoded in
makeunicodedata.py
rather than derived from UCD, which does defineC = Cc | Cf | Cs | Co | Cn
inPropertyValueAliases.txt
. I don't think there's any version of theunicodedata
API that would support returning"C"
here, though. Just being a little obsessive.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: