My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 82: Loader from url seqfaults under linux when a 404 is encountered
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jul 2009


 
Reported by AndreFMi...@gmail.com, Jul 25, 2009
Under Linux, Ubuntu 8.10 using loader from a URL causes a segfault when a
404 is encountered.

Testing the same code on Windows gives the following error instead:

unable to load image http://pooh:8000/tv/media/img/banner/80512.jpg : GDI+
cannot load 'http://pooh:8000/tv/media/img/banner/80512.jpg'

It looks like the Pyglet image loader tries and loads the data anyway, on
Windows, GDI raises an error, but on my Ubuntu system something segfaults.

I think it tries to load the data anyway because urllib is used, which does
not check for a 404 during urlopen and still returns a file object.

I made the following changes to confirm in loader.py:

 24:  import urllib2
283:  fd = urllib2.urlopen(name)

Using urllib2 it now raises a 404 during the urlopen, and I get the
following error message instead:

unable to load image http://pooh:8000/tv/media/img/banner/80512.jpg : HTTP
Error 404: NOT FOUND

And, it no longer segfaults on my Ubuntu system because the Pyglet image
loader never sees the data.
Jul 28, 2009
Project Member #1 txprog
urllib2 cannot open file on disk without file:///
to prevent to check url, i'll stay on urllib, and fix by adding more check on return
error code.
Jul 28, 2009
Project Member #2 txprog
(No comment was entered for this change.)
Labels: Milestone-0.3 Component-Core
Jul 28, 2009
Project Member #3 txprog
This issue was closed by 5267571d42.
Status: Fixed

Powered by Google Project Hosting