Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent fix for row data missing attributes that were defined in the rowset #7

Closed
mattjwarren opened this issue Feb 26, 2012 · 6 comments

Comments

@mattjwarren
Copy link

The fix / (commented ; hack ;) ) for row data missing attributes in the rowset seems to have broken some queries.

Running apitest to get alliances, and also a test to get killlog on a character, and getting char sheet info in apitest all return the following error;

Traceback (most recent call last):
File "C:/Python27/myevetest.py", line 38, in
kills_result=auth.char.Killlog(characterID=char.characterID)
File "C:\Python27\lib\site-packages\eveapi.py", line 274, in call
return self._root(self._path, **kw)
File "C:\Python27\lib\site-packages\eveapi.py", line 362, in call
return _ParseXML(response, True, store and (lambda obj: cache.store(self._host, path, kw, response, obj)))
File "C:\Python27\lib\site-packages\eveapi.py", line 204, in _ParseXML
obj = _Parser().Parse(response, True)
File "C:\Python27\lib\site-packages\eveapi.py", line 410, in Parse
p.ParseFile(data)
File "C:\Python27\lib\site-packages\eveapi.py", line 485, in tag_start
if col == attributes[row_idx]:
IndexError: list index out of range

@mattjwarren
Copy link
Author

I'm poking around for the 'correct' way to fix it, I'll update here if I figure it out.

@mattjwarren
Copy link
Author

I have a 'workaround', not sure if this is how it should be done.

Snippet of code in tag_start changed to

            for hdr_idx,col in enumerate(self.container._cols):
                                    try:
                                            if col == attributes[row_idx]:
                                                    fixed.append(_autocast(col, attributes[row_idx+1]))
                                                    row_idx += 2
                                            else:
                                                    fixed.append(None)
                                    except IndexError:
                                            pass

This 'seems' to work - though this is the first time I've tried to use the eve api so not sure of the consequences of my actions - just ignoring the missing values.

@ntt
Copy link
Owner

ntt commented Feb 27, 2012

Hehe, that will still mess things up, and slows things down a bit too (exceptions that are triggered are rather expensive).

Pushed a fix that ought to work. Let me know if it works so I can close this :)

@mattjwarren
Copy link
Author

:P I had a feeling it wasn't quite the way to do it. I'll try the fix tomorrow and let you know :)

@mattjwarren
Copy link
Author

Works ok for me, I no longer get the issue I was having when pulling from the Killlog

@ntt
Copy link
Owner

ntt commented Feb 28, 2012

great. thanks :)

@ntt ntt closed this as completed Feb 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants