On May 06, Jesper Noehr <[EMAIL PROTECTED]> wrote:

> Was a bug.

Yup. :-)
It appears to be caused by the + in the title: titles without it
seems to work ok.
I'm about to do some tests with other "+" titles and using
urllib.quote instead of urllib.quote_plus.

> IMDb will redirect you to the proper page, if you specify HTTP/1.1.

Very strange behavior, indeed.

> I've written two patches that fixes this.

Thank you very much!
I've just some questions, because touching IMDbURLopener can create
a great number of problems and I want to be careful.

> --- /root/IMDbPY-3.0/build/lib.linux-i686-2.4/imdb/__init__.py   

Is this part of the patch really necessary?
Are you sure that a search with 's=all&q=%s' could return the
main page of a movie, while the same parameters used with the
query 'q=%s;s=pt' has just returned a list of movies?

I'll do some tests, but if you have some examples, it would help.

> ...and now using urllib2 instead of urllib (might have bugs in it!);

If urllib2 is the only solution we'll have to move to using it,
and in any case it can be worth the work (I've never used it):
after all it looks to be more robust than urllib.
Does anyone have some experience on this subject?

Unfortunately we have to consider other things: http_error_default,
open_unknown and open_unknown_proxy must be supported/converted,
and in at least one case (in retrieve_unicode) the IOError exception
(raised by urllib) is trapped, but urllib2 raises the urlib2.HTTPError
exception, which doesn't have the same attributes.

I'm wondering if it's possibile to have an "IMDbPYUrlOpener" object
at module level, in imdb.parser.http; the current IMDbURLopener class
after all is instanced/used directly only by the IMDbHTTPAccessSystem
class and by the get_imdbID method, so there is no need to change a
lot of code, once we have an "IMDbPYUrlOpener" instance created
with urllib2.build_opener - if it's possible.

In the next days, I'll take a look at this solution; if you have
ideas/code, please suggest! :-)


Thank you again for the report and the code!
Oh, by the way: if you're interested in do some (ever very little)
work on IMDbPY just let me know: I will be glad to add you to the
list of developers and grant you access to the CVS repository.

Bye,
-- 
Davide Alberani <[EMAIL PROTECTED]> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Imdbpy-devel mailing list
Imdbpy-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel

Reply via email to