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

IndexError: list index out of range #30

Open
dneise opened this issue Jan 23, 2018 · 1 comment
Open

IndexError: list index out of range #30

dneise opened this issue Jan 23, 2018 · 1 comment

Comments

@dneise
Copy link
Member

dneise commented Jan 23, 2018

SH was calling me every hour or two during the last night since we use sfc 0.4.1 for the first time.

I was able to reproduce the problem first time this way:

while True:
    print(time.asctime(), sfc.main_page())

Got this:

Tue Jan 23 08:03:01 2018 single-pe(179) [104/02:09]
Tue Jan 23 08:03:02 2018 single-pe(179) [104/02:09]
Tue Jan 23 08:03:02 2018 single-pe(179) [104/02:09]
Tue Jan 23 08:03:02 2018 Idle [single-pe]
Tue Jan 23 08:03:03 2018 Idle [single-pe]
Tue Jan 23 08:03:03 2018 Idle [single-pe]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-5-13fe3da96b99> in <module>()
      1 while True:
----> 2     print(time.asctime(), sfc.main_page().system_status)
      3 

~/fact/smart_fact_crawler/smart_fact_crawler/__init__.py in main_page(url, timeout, fallback)
    317     system_status = get(table, 1, 1)
    318     power_val, power_unit = get(table, 6, 3, default='nan nan').split()
--> 319     trigger_val, trigger_unit, _ = get(table, 5, 1, default='nan nan nan').split()
    320     return to_namedtuple('MainPage', {
    321         'timestamp_1': sft2dt(get(table, 0, 0)),

~/fact/smart_fact_crawler/smart_fact_crawler/tools.py in get_entry(table, row, col, fallback, default)
     56 
     57     try:
---> 58         return table[row][col]
     59     except IndexError:
     60         if fallback is True:

IndexError: list index out of range

So it happened just after the single-pe run in the end of the night ... maybe this is the reason why it called me only sometimes ...

If we set fallback=True ... then we do not get an exception.

@dneise
Copy link
Member Author

dneise commented Jan 23, 2018

So this is is not an fsc issue.

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

1 participant