Message172517
| Author |
kunkku |
| Recipients |
kunkku |
| Date |
2012年10月09日.20:09:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1349813384.06.0.615857426211.issue16182@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Tab completion in the readline module does not seem to work well with Unicode terminals. The get_line_buffer function converts the line buffer to the str type (which are Unicode strings in Python 3), but the indices returned by get_begidx and get_endidx are not adjusted with respect to possible wide characters in the buffer, and hence are not very useful. The documentation is a bit vague on the index functions, but I think they should be relative to code points, regardless of the encoding used by the C library. The suggested correction is attached.
My second point of complaint is related to the use of PyUnicode_FromString in the module. The strings returned by the readline library use the current locale encoding, which is not necessarily UTF-8. I wonder if PyUnicode_DecodeLocale should be used instead for more portable code. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年10月09日 20:09:44 | kunkku | set | recipients:
+ kunkku |
| 2012年10月09日 20:09:44 | kunkku | set | messageid: <1349813384.06.0.615857426211.issue16182@psf.upfronthosting.co.za> |
| 2012年10月09日 20:09:44 | kunkku | link | issue16182 messages |
| 2012年10月09日 20:09:43 | kunkku | create |
|