#25 — IndexError when parsing releaseDate coming from amazon_tool

by Florian Friesdorf last modified Jan 22, 2010 03:51 PM
State Rejected
Version:
Area Functionality
Issue type Patch
Severity Medium
Submitted by Florian Friesdorf
Submitted on Feb 27, 2007
Responsible
Target release:


With svn release 38446:
With book with isbn 0929652339

- importing is working
- adding the book with just isbn number and performing set details from amazon on a book with that isbn leads to an IndexError in content/book.py line 193

This fixes the problem :
--- CMFBibliographyAT-r38446/content/book.py 2007-01-18 16:26:51.000000000 +0100
+++ CMFBibliographyAT/content/book.py 2007-02-27 18:18:57.000000000 +0100
@@ -189,8 +189,9 @@
         # u'May, 2004'
         l = result.ReleaseDate.split(', ')
        year = l[1]
+ l = l[0].split(' ')
         if len(l) >= 2:
- month = l[0].split(' ')[1]
+ month = l[1]
         else:
             month = l[0]
         self.setPublication_year(year)
Added by Tim Hicks on Apr 05, 2007 04:20 PM
Sorry to be so slow responding to this. Can you say a little more about the fix? Presumably the old code worked at some point. Have Amazon changed the structure of the data they return? Or did the old code just not handle all cases? Does your patch handle all cases?
Added by Florian Friesdorf on Mar 11, 2008 12:10 AM
Sorry for the way slower response.

The old code assumed something like:
'something <month>, <year>'

It failed for:
'<month>, <year>'

The new code should handle the first case like the old code and additionally the second case.

As far as I remember.
Added by Andreas Jung on Jan 22, 2010 03:51 PM
Issue state: UnconfirmedRejected
Won't fix since AmazonTool is no longer working due to changes in the Amazon WS API.

No responses can be added.