Issue 473 in pyglet: AttributeError: 'NoneType' object has no attribute 'startswith'

643 views
Skip to first unread message

codesite...@google.com

unread,
Mar 16, 2010, 7:49:18 AM3/16/10
to pyglet...@googlegroups.com
Status: New
Owner: ----

New issue 473 by stodge: AttributeError: 'NoneType' object has no
attribute 'startswith'
http://code.google.com/p/pyglet/issues/detail?id=473

What steps will reproduce the problem?
1. Tried to run any of the graphical examples:
2. Example applications crash

Paste in the traceback or error message:

./multiple_windows.py
Traceback (most recent call last):
File "./multiple_windows.py", line 40, in <module>
from pyglet.gl import *
File "/usr/lib/python2.6/site-packages/pyglet/gl/__init__.py", line 510,
in <module>
import pyglet.window
File "/usr/lib/python2.6/site-packages/pyglet/window/__init__.py", line
1684, in <module>
gl._create_shadow_window()
File "/usr/lib/python2.6/site-packages/pyglet/gl/__init__.py", line 494,
in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/__init__.py",
line 474, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pyglet/window/__init__.py", line
686, in __init__
self._create()
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/__init__.py",
line 683, in _create
self.switch_to()
File "/usr/lib/python2.6/site-packages/pyglet/window/xlib/__init__.py",
line 781, in switch_to
self._context.set_current()
File "/usr/lib/python2.6/site-packages/pyglet/gl/__init__.py", line 347,
in set_current
setattr(self, attr, check(self._info))
File "/usr/lib/python2.6/site-packages/pyglet/gl/__init__.py", line 314,
in <lambda>
lambda info: info.get_renderer().startswith('ATI Radeon X')),
AttributeError: 'NoneType' object has no attribute 'startswith'

pyglet 1.1 with Python 2.5: Paste in the output of `python -m pyglet.info`
Other: Paste in the output of tools/gl_info.py (included in source distro):

See attachment for output of pyglet.info.

Any additional info (platform/language/hardware) that may be relevant?

Fedora 12 running on a Dell M4300 laptop.

gl_info.py crashes.

Attachments:
pyglet_info.txt 6.0 KB

--
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

codesite...@google.com

unread,
Mar 17, 2010, 12:06:34 PM3/17/10
to pyglet...@googlegroups.com
Updates:
Status: Accepted
Labels: OpSys-Linux Type-Defect

Comment #1 on issue 473 by chardster: AttributeError: 'NoneType' object has

This generally happens because the Context.set_current is called before the
real
(platform specific) context has been initialised. Poking through the code I
can only
presume that we end up with an instance of BaseXlibContext instead of any
of its
subclasses.

stodge: Could you confirm the types of w1.context and w2.context from the
multiple_windows.py example for your setup? Take a copy of the file and
add 'print
type(w1.context), type(w2.context)' before 'pyglet.app.run()'

codesite...@google.com

unread,
Mar 17, 2010, 12:12:41 PM3/17/10
to pyglet...@googlegroups.com

Comment #2 on issue 473 by stodge: AttributeError: 'NoneType' object has no
attribute 'startswith'
http://code.google.com/p/pyglet/issues/detail?id=473

Tried that but it doesn't help. The crash occurs "inside" the import:

from pyglet.gl import *

So my print statements are never reached.

codesite...@google.com

unread,
Mar 18, 2010, 10:19:26 AM3/18/10
to pyglet...@googlegroups.com

Comment #3 on issue 473 by stodge: AttributeError: 'NoneType' object has no
attribute 'startswith'
http://code.google.com/p/pyglet/issues/detail?id=473

Anything else I can report/find for you? Cheers

codesite...@google.com

unread,
Mar 26, 2010, 3:55:24 AM3/26/10
to pyglet...@googlegroups.com

Comment #4 on issue 473 by lexa.knyazev: AttributeError: 'NoneType' object

I got the same on Fedora 12 with NVIDIA card and nouveau driver (for now it
lacks 3D
support).
Try proprietary driver.

codesite...@google.com

unread,
Mar 26, 2010, 7:39:39 AM3/26/10
to pyglet...@googlegroups.com

Comment #5 on issue 473 by stodge: AttributeError: 'NoneType' object has no
attribute 'startswith'
http://code.google.com/p/pyglet/issues/detail?id=473

Sorry - forgot to mention that this was the proprietary NVIDIA driver.

codesite...@google.com

unread,
Mar 26, 2010, 8:17:13 AM3/26/10
to pyglet...@googlegroups.com

Comment #6 on issue 473 by lexa.knyazev: AttributeError: 'NoneType' object

what is output of:

$ glxinfo | egrep "vendor|OpenGL"

codesite...@google.com

unread,
Mar 26, 2010, 8:21:00 AM3/26/10
to pyglet...@googlegroups.com

Comment #7 on issue 473 by stodge: AttributeError: 'NoneType' object has no
attribute 'startswith'
http://code.google.com/p/pyglet/issues/detail?id=473

Ah:

glxinfo | egrep "vendor|OpenGL"
Error: glXCreateContext failed

codesite...@google.com

unread,
May 22, 2010, 3:59:36 PM5/22/10
to pyglet...@googlegroups.com

Comment #8 on issue 473 by opbstudios: AttributeError: 'NoneType' object
i am also having this issue, python 2.6.5, svn trunk of pyglet, nvidia
proprietary
driver.

here's my crash
Python 2.6.5 (r265:79063, Mar 18 2010, 23:38:15)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> window = pyglet.window.Window()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyglet/__init__.py", line 313, in __getattr__
__import__(import_name)
File "pyglet/window/__init__.py", line 1810, in <module>
gl._create_shadow_window()
File "pyglet/gl/__init__.py", line 208, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "pyglet/window/xlib/__init__.py", line 158, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "pyglet/window/__init__.py", line 558, in __init__
self._create()
File "pyglet/window/xlib/__init__.py", line 248, in _create
self.context.attach(self.canvas)
File "pyglet/gl/xlib.py", line 267, in attach
self.set_current()
File "pyglet/gl/xlib.py", line 272, in set_current
super(XlibContext10, self).set_current()
File "pyglet/gl/base.py", line 308, in set_current
setattr(self, attr, check(self._info))
File "pyglet/gl/base.py", line 256, in <lambda>
lambda info: (info.get_renderer().startswith('ATI Radeon X')
AttributeError: 'NoneType' object has no attribute 'startswith'


hope that helps

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

codesite...@google.com

unread,
May 22, 2010, 4:03:38 PM5/22/10
to pyglet...@googlegroups.com

Comment #9 on issue 473 by opbstudios: AttributeError: 'NoneType' object
re-entering this attach my pyglet.info dump
Attachments:
pyglet.inf 2.4 KB
Reply all
Reply to author
Forward
0 new messages