- Add missing parentheses for print()
- Writing strings to the data file requires encode()
- Replace "map.has_key(key)" with "key in map"
Details
- Reviewers
lbeltrame - Group Reviewers
Frameworks - Commits
- R236:0a70dc9bb0f2: [KCharSelect] Port generate-datafile.py to Python 3
Tested with Unicode 11.0 data.
Diff Detail
- Repository
- R236 KWidgetsAddons
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
len() of UTF-8 encoded bytearray is different than len(str).
Account for the difference when accumulating sizes.
Unicode Names are always ASCII, so here len(bytearray) == len(str), and no change needed.
I did an accept to undo my earlier "Changes required" because Phab messed up the lines I commented on, and because I realized I wasn't commenting on your specific changes. Sorry about that.
src/kcharselect-generate-datafile.py | ||
---|---|---|
432 | Perhaps the diff view is wrong.. but the return size here (at this level of nesting) wouldn't make the downstream code de facto unreachable in this function? | |
607 | Unrelated to this patch, but this could be changed to for char in self.unihan (perhaps in a separate revision). | |
624 | Same here wrt position of return. Now I notice that they're not related to your changes, so I wonder if it's phab showing something off, or there is a problem of tab vs spaces.... |