Issue 354 in pyglet: resource path separator bug

6 views
Skip to first unread message

codesite...@google.com

unread,
Oct 10, 2008, 2:49:06 AM10/10/08
to pyglet...@googlegroups.com
Issue 354: resource path separator bug
http://code.google.com/p/pyglet/issues/detail?id=354

New issue report by nwhitehe:
In pyglet-1.1.2 in Linux, with file 'test/image.png' existing:

import pyglet
pyglet.resource.image('test/image.png')

Result:

Traceback (most recent call last):
File "engine.py", line 2, in <module>
pyglet.resource.image('test/image.png')
File "/usr/lib/python2.5/site-packages/pyglet/resource.py", line 478, in
ima
identity = self._cached_images[name] = self._alloc_image(name)
File "/usr/lib/python2.5/site-packages/pyglet/resource.py", line 422, in
_al
c_image
file = self.file(name)
File "/usr/lib/python2.5/site-packages/pyglet/resource.py", line 380, in
fil
raise ResourceNotFoundException(name)
pyglet.resource.ResourceNotFoundException: Resource "test/image.png" was
not f
nd on the path. Ensure that the filename has the correct captialisation.


Suggested fix:

I think resource.py line 335 is the culprit. A fix that seems to work:

dirpath = '/'.join(dirpath.split(os.path.sep))

Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages