google-code-export / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

examples/window_platform_event.py crash with traceback #561

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run the pyglet provided examples/window_platform_event.py
2. script crashes with traceback:

Paste in the traceback or error message:
Traceback (most recent call last):
  File "D:\hg_externals\pyglet_12dev\examples\window_platform_event.py", line 51
, in <module>
    from pyglet.window.carbon import *
  File "D:\hg_externals\pyglet_12dev\pyglet\window\carbon\__init__.py", line 52,
 in <module>
    from pyglet.canvas.carbon import CarbonCanvas
  File "D:\hg_externals\pyglet_12dev\pyglet\canvas\carbon.py", line 12, in <modu
le>
    from pyglet.libs.darwin import *
  File "D:\hg_externals\pyglet_12dev\pyglet\libs\darwin\__init__.py", line 17, i
n <module>
    framework='/System/Library/Frameworks/Carbon.framework')
  File "D:\hg_externals\pyglet_12dev\pyglet\lib.py", line 124, in load_library
    raise ImportError('Library "%s" not found.' % names[0])
IndexError: tuple index out of range

winXP sp3
python 2.6.6

pyglet 1.2dev , identified as:
D:\hg_externals\pyglet_12dev\examples>hg summary
parent: 2632:f407d228a880 tip
 stop using [NSWindow center] to center window
branch: default

Patch for this defect:

At the very beginning of pyglet/lib.py add the lines

        if not names:
            raise ImportError('No Library name specified')

(sorry to not provide a diff, in this machine all the lines shows as changed; 
probably an EOL configuration failure for the local hg) 

Original issue reported on code.google.com by ccanepacc@gmail.com on 23 Mar 2012 at 3:54

GoogleCodeExporter commented 9 years ago
Fixed in 2638:ca17f2a533b7

Original comment by Adam.JT...@gmail.com on 25 Apr 2012 at 9:06

GoogleCodeExporter commented 9 years ago
This does not seem right. The framework uses 
pyglet.lib.load_library(framework="xxx") in many places; for me on OS X, this 
change breaks `import pyglet.gl`:

>>> import pyglet.gl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyglet/gl/__init__.py", line 97, in <module>
    from pyglet.gl.lib import GLException
  File "pyglet/gl/lib.py", line 141, in <module>
    from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
  File "pyglet/gl/lib_agl.py", line 49, in <module>
    framework='/System/Library/Frameworks/OpenGL.framework')
  File "pyglet/lib.py", line 90, in load_library
    raise ImportError("No library name specified")
ImportError: No library name specified

The "if not names" check should be after the "if framework in kwargs" check 
(diff attached).

Thanks,
Ben

Original comment by wikipedia.earwig@gmail.com on 27 Apr 2012 at 4:57

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, never mind this; someone already reported it as issue #572

Original comment by wikipedia.earwig@gmail.com on 27 Apr 2012 at 5:03

GoogleCodeExporter commented 9 years ago
Ah sorry Darwiners I'll commit the 572 patch later today.

Original comment by Adam.JT...@gmail.com on 27 Apr 2012 at 8:55