Tiny Core Base > TCB Bugs
fix for crash in pygame.display.set_mode()
(1/1)
tim33:
steps to reproduce (on an old thinkpad x220; also reproduces with the x86_64 release):
1. download & install http://tinycorelinux.net/12.x/x86/release/CorePlus-current.iso
2. tce-load -wi python3.9
3. python3 -m ensurepip
4. pip3 install pygame
5. python3 -c "import pygame; pygame.init(); pygame.display.init(); pygame.display.set_mode()"
6. => crash in X11_Xinput2UngrabTouch (SDL_x11input2.c:385) that looks like a call to a NULL pointer
fix:
1. tce-load -wi libXi # install missing python/pygame/SDL dependency
Rich:
Hi tim33
Welcome to the forum.
I just ran ldd on both SDL and SDL2 from the TC12 x86 repository and neither showed a dependency on libXi.
Is it possible the the dependency came from pygame ?
tim33:
indeed, libXi is *not* declared as a dependency. however, unless it's installed, SDL's X11_Xinput2UngrabTouch() function crashes when pygame.display.init() calls it (at least on my thinkpad; haven't tested it on other computers).
so it feels that libXi should be part of the python3.9.tcz.tree. or something, i'm not exactly sure, sorry :)
ETA: checked all libraries under /usr/local/lib/python3.9/ (including pygame) with ldd -- did not find libXi dependency there either. so it seems a more nuanced problem than simply a missing dependency..
Oliviyamaya:
I've had this error happen a few times. It was caused by a call to set_mode on a display that was already set to another mode. Follow these steps to fix it: 1) Close all programs that are using Python and Pygame. 2) Bring up a command prompt (Start -> Run -> cmd or Windows key + R -> cmd). 3) cd to the folder with your Python file. 4) Run one of the following commands for whichever mode you are trying to change to: >pygame.display.set_mode((800,600)) >pygame.display.set_mode(800,600) >pygame.display.set_mode(800 600) In my case it was 800x600, but in step 3 I had to type out the mode name. 5) Open the .py file, and run it through Python. It should run fine, and there should be no error related to setting the display mode.
Navigation
[0] Message Index
Go to full version