-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure pretty_hex works under Python 2 and Python 3. #49
Conversation
Will merge if CI confirms the doctests are run and it goes green. |
* Run doctests under tox. * Add pretty_hex doctests for string, bytes and unicode types. Fixes tinyfpga#48
Should be flake8 clean again now.
FYI, we never did decide that we'd release 1.0.24 as a production release. The various requests for testing (eg, https://discourse.tinyfpga.com/t/tinyprog-1-0-24-testing/886 and #25 (comment)) didn't really get much response. AFAICR the only 1.0.24 issue found was someone who had trouble with the Given the various issues people have had, possibly we should consider what would be required to be happy to make a 1.0.24 actual (non- Also FWIW, my guess is that a bunch of these errors people are seeing -- #48, #18, #42, #43 -- are actually the result of shorter-than-expected reads, due to race conditions in the serial IO code, which seems to assume that a read of N bytes will either all happen or none of it will happen, but that's definitely not true on any unix/linux; unix/linux will happily supply 1-N bytes if it has some of them now. I suspect most of the issues reported are in the bootloader update simply because if it crashes out at the wrong point (stage 2 seems the worst), then it bricks the board to the point of needing a SPI programmer -- see https://discourse.tinyfpga.com/t/error-while-updating-bootloader-invalid-literal-for-int-with-base-10/484/3. But I still seem them periodically even with uploading regular code. (I don't think 1.0.24devNN is any worse for this than 1.0.23, perhaps better for it, hence this comment; but I do suspect that Python 3 might be somewhat worse for short reads than Python 2, possibly just due to being faster.) Ewen |
@mithro Re shorter than expected reads, see also #42 (comment), where someone modified their own version of tinyprog to handle short reads. They just retry the command, but in practice I suspect the low level Ewen PS: Feel free to, eg, move these comments to a new issue if you'd prefer. |
@mithro Also, in Python 3 TinyFPGA-Bootloader/programmer/tinyprog/__init__.py Lines 159 to 165 in 99f87a5
length = 0 case should explicitly return an empty bytearray ?
Ewen |
@mithro But AFAICT the code at TinyFPGA-Bootloader/programmer/tinyprog/__init__.py Lines 339 to 350 in 99f87a5
TinyFPGA-Bootloader/programmer/tinyprog/__init__.py Lines 297 to 304 in 99f87a5
Ewen PS: Sorry this all ended up in a merged pull request :-) It was how I found the references, and then started looking at the code and at the beginning it was just going to be a quick comment in passing.... |
Fixes #48.