Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

list index out of range error #12

Closed
jasonkgreen opened this issue Jan 10, 2016 · 8 comments
Closed

list index out of range error #12

jasonkgreen opened this issue Jan 10, 2016 · 8 comments

Comments

@jasonkgreen
Copy link

I get this in the midst of a fetch. Not sure if it's a python error or a twecoll error.

@lucahammer
Copy link
Contributor

This happens when there is an empty line in the .dat file. I am not sure yet when they happen but a quick fix is to remove the empty line and start the fetch command again.

@jasonkgreen
Copy link
Author

Thanks. This seems to have solved it.

@jdevoo
Copy link
Owner

jdevoo commented Jan 11, 2016

Thank you @lucahammer ! I wonder how these empty lines come about... Any chance you can share the handle to reproduce this @jasonkgreen ?

@lucahammer
Copy link
Contributor

For the first time I was able to reproduce the error. It's probably something in the location field. Example of an account where the error happens: https://twitter.com/Atomroflbomber

@lucahammer
Copy link
Contributor

I am testing location = data['location'].strip() in line 399 as a fix. Didn't have the problem again, but will test it some more before submitting a PR. I wonder if there are cases where it doesn't work because the problematic characters are surrounded by the location text. Then it would be better to replace \n and \t.

@lucahammer
Copy link
Contributor

lucahammer commented Jan 14, 2017

As expected it wasn't enough. This account triggered another out of range error: https://twitter.com/luXus_Suizid.

I added the following as a workaround.
location = location.replace('\n', ' ') location = location.replace('\t', ' ')

@jdevoo
Copy link
Owner

jdevoo commented Jan 14, 2017

cool - we can probably chain them into a single line... wonder if this needs to be applied to other attributes as well

@jdevoo jdevoo reopened this Jan 16, 2017
@jdevoo
Copy link
Owner

jdevoo commented Jan 16, 2017

made the change but left out the tab case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants