Skip to content
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

Python < 3.11: TypeError: to_bytes() missing required argument 'byteorder' (pos 2) #698

Closed
mathoudebine opened this issue Feb 25, 2025 · 0 comments · Fixed by #701
Closed
Labels
bug Something isn't working

Comments

@mathoudebine
Copy link
Owner

I am using Ubuntu 22.04 and Python 3.10.12 with the 8.8" screen

Getting the following error:

(.venv) root@test:/home/kevin/turing-smart-screen-python# python main.py 
02/25/2025 03:06:36 AM [INFO] Loading theme AMD from res/themes/AMD/theme.yaml
02/25/2025 03:06:37 AM [DEBUG] HW revision: C
02/25/2025 03:06:37 AM [DEBUG] Auto detected COM port: /dev/ttyACM1
02/25/2025 03:06:37 AM [DEBUG] Using Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0]
02/25/2025 03:06:37 AM [WARNING] Tray icon is not supported on your platform
02/25/2025 03:06:37 AM [INFO] Initialize display
02/25/2025 03:06:37 AM [INFO] Display reset (COM port may change)...
02/25/2025 03:06:52 AM [DEBUG] Static COM port: /dev/ttyACM1
02/25/2025 03:06:52 AM [DEBUG] HW sub-revision returned: chs_88inch.dev1_rom1.90
02/25/2025 03:06:52 AM [INFO] Calling ScreenOn
02/25/2025 03:06:52 AM [DEBUG] Drawing Image: BACKGROUND
02/25/2025 03:06:52 AM [DEBUG] Bitmap /home/kevin/turing-smart-screen-python/res/themes/AMD/background.png is now loaded in the cache
Traceback (most recent call last):
  File "/home/kevin/turing-smart-screen-python/main.py", line 208, in <module>
    display.display_static_images()
  File "/home/kevin/turing-smart-screen-python/library/display.py", line 125, in display_static_images
    self.lcd.DisplayBitmap(
  File "/home/kevin/turing-smart-screen-python/library/lcd/lcd_comm.py", line 219, in DisplayBitmap
    self.DisplayPILImage(image, x, y, width, height)
  File "/home/kevin/turing-smart-screen-python/library/lcd/lcd_comm_rev_c.py", line 342, in DisplayPILImage
    payload=bytearray(int(self.display_width * self.display_width / 64).to_bytes(2)))
TypeError: to_bytes() missing required argument 'byteorder' (pos 2)

Originally posted by @pragmaticgeek in #691 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant