-
Notifications
You must be signed in to change notification settings - Fork 102
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
If emoji is present in News Article Title, then python script crashes due to a ZeroDivisionError #463
Comments
Do you know which team’s news feed lead to the headline appearing? |
I'm finding a play button |
I'm also seeing the play buttons on the cubs feed though. I'm testing the feed on my board now and haven't experienced a crash yet |
The code that crashed is only in the emulator, not the actual board (I wrote it, I’m pretty sure) so I think it would need to be a different error |
Not seeing a crash on board. Just saw the Game Story article and it ended with a play icon and then a ? symbol (like it didn't understand the character) |
Can you give the emulator version? It's possible this is an issue with
RGBME and not this project.
Tyler Porter
…On Thu, Apr 20, 2023, 7:41 PM swemoney ***@***.***> wrote:
I'm finding a play button
|
@ty-porter how do I find the emulator version? |
I am pretty new to programming, so I am not sure if this is the best way to fix the issue, but I did resolve it by removing emojis from headlines. I did so by adding the following to the scrollingtext.py in the renderers folder:
And then at line 28: |
@WardBrian it was the Braves headlines that were causing the issue. It was the same thing that @swemoney described with the Astro's: it had the play emoji (" |
|
I can reproduce this in emulator v0.8.3 Steps to trigger the bug:
For this specific trigger that would mean the string needs an emoji as the first character of a string that's large enough to scroll. The error will happen when the scrolling goes offscreen I will fix this upstream in RGBME, however the fix there will be to gracefully handle 0 width characters. Missing characters will still show a |
Resolved in #465. |
This issue is a
Hardware Configuration
Software Configuration v6.3.0
Expected behavior
Ticker should rotate properly to the next screen
Actual behavior
If emoji is present in an MLB Article, it appears it causes the script to crash (at least in emulation mode). The following error occurs:
Emulator/graphics/init.py", line 19, in DrawText
adjustment = abs(x + first_char_width) // first_char_width
ZeroDivisionError: integer division or modulo by zero
Additional Information
Please note that this issue has ONLY been tested in emulation mode! I do not have a Raspberry Pi yet to test on a physical setup. It appears the best solution would be to automatically remove emojis from MLB News Headline Names.
The text was updated successfully, but these errors were encountered: