pmbootstrap-meow/pmb/parse
Newbyte a6025ed42a
pmb.parse.version: Convert rest[0] to integer before storing it in value (MR 2514)
Previously, value would sometimes be a string despite the docstring
clearly stating that it should be an integer. This seems to have been a
consequence of literally copying the original C code without considering
that strings work differently between the languages, where the
original assigning a character in a string to an integer results in the
integer having the ASCII value of that character, in Python you just get
the string value of that character. As such, match the original
implementation by explicitly converting from a string to an integer
using ord(), which gives the Unicode code of the provided character.

It is not clear to me why this disparity didn't cause any issues beyond
type errors found by mypy.

See 5d796b5678/src/version.c (L101)
2024-12-20 14:39:46 +01:00
..
__init__.py core: add an Arch type (MR 2252) 2024-06-23 12:38:39 +02:00
_apkbuild.py Fix apkbuild parsing in edge cases (MR 2503) 2024-11-30 11:53:17 +03:00
apkindex.py parse: apkindex: don't require python 3.12 (MR 2455) 2024-10-27 16:42:49 +01:00
arguments.py pmb: Add more type hints (MR 2513) 2024-12-19 18:52:25 +01:00
binfmt_info.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
bootimg.py parse: bootimg: make it work again (MR 2477) 2024-11-08 01:57:26 +01:00
cpuinfo.py Run ruff check --fix (MR 2357) 2024-07-16 00:26:35 +02:00
depends.py pmb: Add lots of type hints (MR 2464) 2024-10-30 12:39:45 +01:00
deviceinfo.py pmb: Add more type hints (MR 2513) 2024-12-19 18:52:25 +01:00
kconfig.py pmb: Add more type hints (MR 2490) 2024-12-19 10:09:22 +00:00
kconfigcheck.py kconfig check: move rules to kconfigcheck.toml (MR 2333) 2024-06-30 18:04:31 +02:00
test_apkindex.py test: parse: apkindex: check that cache works (MR 2455) 2024-10-27 16:42:54 +01:00
test_bootimg.py test: parse: add tests for bootimg parsing (MR 2477) (MR 2483) 2024-11-29 16:50:04 +01:00
test_deviceinfo.py test: parse: add test_deviceinfo (MR 2453) 2024-10-30 23:14:01 +01:00
version.py pmb.parse.version: Convert rest[0] to integer before storing it in value (MR 2514) 2024-12-20 14:39:46 +01:00