Issue #169 wontfix

pyGame crashing on joystick reconnect -> Python 3.3

LORDofDOOM avatarLORDofDOOM created an issue

If tried this with official pygame-1.9.2a0.win32-py3.3.msi and with trunk version from today (https://bitbucket.org/pygame/pygame/commits/23f848d95c8ba98ee3590eb2a40e6a48a446068f)

pyGame will crash on disconnect/reconnect a gamepad (or if batterys needs a replacement). I've tried this with XBox 360 Wireless Controller. This problem does not exist in Python 2.7.

Sys specs are Windows 7 x64, Python 3.3 and any compatible pyGame version incl. a02 and self compiled trunk (with prebuild)

The crash will not always - in my test every 3-5x reconnects.

Here is a sample code to reproduce the problem:

#########################################################
# pyGame Crashing -> Python 3
#
# 1. Connect a Gamepad (I use XBox 360 Wireless Gamepad)
# 2. Start the script
# 3. Disconnect the Gamepad (e.g. take out Batteries)
# 4. Reconnect the Gamepad
# -> Program is crashing (if not repeat this steps 3 and 4)
#########################################################

import pygame
import time

class crashTest():

    def init(self):
        pygame.init()

    def run(self):
        while True:
            pygame.joystick.quit()
            pygame.joystick.init()
            time.sleep(0.5) 
            print (pygame.joystick.get_count())           

if __name__ == "__main__":
    program = crashTest()
    program.init()
    program.run()

Comments (5)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.