Hello World example fails while loading resources (sdl2.ext.Resources)

Issue #104 resolved
PaoloBB4 created an issue

Good day :)
Got this error running the Hello World example from the tutorial:

$ python pysdl2helloWorld.py 
Traceback (most recent call last):
  File "pysdl2helloWorld.py", line 5, in <module>
    RESOURCES = sdl2.ext.Resources(__file__, "resources")
  File "/usr/lib/python3.6/site-packages/sdl2/ext/resources.py", line 139, in __init__
    self.scan(path, subdir, excludepattern)
  File "/usr/lib/python3.6/site-packages/sdl2/ext/resources.py", line 313, in scan
    raise ValueError("invalid path '%s'" % path)
ValueError: invalid path 'pysdl2helloWorld.py'

No idea why it's getting confused about the path since it's doing it all by itself. I'm gessing it's a bug.

Just the first three lines are enough to recreate the error (copy-pasted from tutorial):

import sys
import sdl2.ext

RESOURCES = sdl2.ext.Resources(__file__, "resources")

I'm runing this script with python 3.6.2 on Arch linux.
pysdl2 was installed from AUR (link), all optionals included.

I know is not much to go by but is all I've got.

Comments (3)

  1. Marcus von Appen repo owner

    My guess is that your resources folder does not exist.

    And it looks like the Resources class prints the wrong path, if it cannot find the folder.

  2. PaoloBB4 reporter

    Right, it's looking for the "resources" folder relative to the script, now I get it. I noticed it's in the examples folder though so it's all right.

    Thanks for the quick responce.

  3. Log in to comment