Hello,
here you go. Sorry it took me so long to get back to you, I had to extend my git knowledge first and do some reading of the man pages for git-am and git-format-patch. And thanks for splitting the patch, I should have done so myself.
Regarding the bytes/string change: Some things are simply binary data (i.e. null padding) and there is not much which could be done differently. If we did not care about older distributions, then using a bytes literal (b"\0") instead of my as_bytes-replacement (as_bytes("\0")) would be nicer, but is only available starting with Python 2.6.
All the object dump parsing code in checkrom.py and layoutrom.py should only deal with ASCII input. Changing this to strings would probably slim down the patch considerably since most other changes which transform literals to bytes are caused by reading bytes and comparing them with these literals.
I'll take a look at this and send you a revised patch for the string/bytes change. The first 4 patches seem fine to me.
- Johannes
On 01/12/2014 05:49 PM, Kevin O'Connor wrote:
On Sun, Jan 12, 2014 at 11:51:01AM +0100, Johannes Krampf wrote:
Hello SeaBIOS developers,
I've created a new patch which allows me to build SeaBIOS successfully with both Python 2 and Python 3. (Tested with qemu)
Thanks. I broke up your patches to make them easier to discuss (see attached). Can you provide a "Signed-off-by" for them?
Aside from print statements/functions, str/bytes and integer division for Python 2/3 compatibility, I also did some small changes (removing semicolons) to the acpi_* files to reduce the noise from pylint output.
I'm uncomfortable with the as_bytes/as_str change. I wonder if there is a way to avoid all the conversions by changing all the symbols to strings up front, or by just reading/writing the files in ascii mode instead of binary mode.
I was careful not to break the code, but I could not test the readserial script lacking the necessary hardware and would appreciate if someone else could give it a try.
All of my changes should work with Python 2.4 and newer (version in RHEL 5, the oldest supported version). If you require compatibility with older Python versions, please tell me and I will revise the patch.
-Kevin