OpenBB-finance / OpenBB

Investment Research for Everyone, Everywhere.
https://openbb.co
Other
34.01k stars 3.11k forks source link

[Bug]Stocks/news - command, and when adding -h, breaks - Error: list index out of range #2267

Closed deeleeramone closed 2 years ago

deeleeramone commented 2 years ago

News function does not work in Stocks menu. It does work from the main menu.

2022 Aug 07, 19:41 /stocks/ $ news
Error: list index out of range

2022 Aug 07, 19:41 /stocks/ $ news -h
Error: list index out of range
Screen Shot 2022-08-07 at 4 39 27 PM
colin99d commented 2 years ago

@deeleeramone are you still having this issue? I cannot seem to recreate it.

deeleeramone commented 2 years ago

Yes. To recreate, /stocks/load aapl/news -h

Screen Shot 2022-08-09 at 3 32 46 PM
colin99d commented 2 years ago
Screen Shot 2022-08-10 at 9 33 21 AM

Maybe is this an outdated installer?

colin99d commented 2 years ago

If this still an issue after pulling from main can you run the terminal with --debug and then send a screenshot of the error.

colin99d commented 2 years ago

2022 Aug 10, 18:23 /stocks/ $ news Traceback (most recent call last): File "/Users/danglewood/GitHub/OpenBBTerminal/terminal.py", line 973, in main( File "/Users/danglewood/GitHub/OpenBBTerminal/terminal.py", line 916, in main terminal() File "/Users/danglewood/GitHub/OpenBBTerminal/terminal.py", line 664, in terminal t_controller.queue = t_controller.switch(an_input) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/decorators.py", line 58, in wrapper value = func(*args, kwargs) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/parent_classes.py", line 298, in switch getattr( File "/Users/danglewood/GitHub/OpenBBTerminal/terminal.py", line 332, in call_stocks self.queue = self.load_class(StocksController, self.queue) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/parent_classes.py", line 183, in load_class return class_ins(*args, *kwargs).menu() File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/parent_classes.py", line 651, in menu self.queue = self.switch(an_input) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/decorators.py", line 58, in wrapper value = func(args, kwargs) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/parent_classes.py", line 298, in switch getattr( File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/decorators.py", line 58, in wrapper value = func(*args, **kwargs) File "/Users/danglewood/GitHub/OpenBBTerminal/openbb_terminal/stocks/stocks_controller.py", line 422, in call_news if sources[0] == "feedparser": IndexError: list index out of range

colin99d commented 2 years ago

Adding this here for visibility

deeleeramone commented 2 years ago

Problem was user-error! The sources file was out-of-date and did not contain the fields for Stocks/news. Thanks!