FYI, I didn't review this in any way, but I entered it as
http://code.google.com/p/pyglet/issues/detail?id=492 so it's not lost.

- Bruce Smith

On Mon, Aug 30, 2010 at 3:10 PM, mdg583 <[email protected]> wrote:

> bug:
>
> If a file in a resource path is in a directory, it isn't found.
>
> in resource.py, there is a line like this:
> dirpath = '/'.join(os.path.split(dirpath))
>
> Normally, this only puts forward slashes between the path elements.
> However, if the directory path is only one layer (e.g. dirpath has no
> '/'), then os.path.split still splits it into a list of size 2, with
> the first element empty (http://docs.python.org/library/
> os.path.html#os.path.split). As a result, '/'.join puts a / at the
> beginning of the path, which keeps resources from being found.
>
> I did this to fix it:
>
> plist = os.path.split(dirpath)
> if len(plist) == 2 and len(plist[0]) == 0:
>        plist = plist[1:]
> dirpath = '/'.join(plist)
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to