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

Issue #104 resolved
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. 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.

  2. Log in to comment