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

SIGSEGV when using asyncio and yfinance #148

Open
jjbrosnan opened this issue May 8, 2024 · 1 comment
Open

SIGSEGV when using asyncio and yfinance #148

jjbrosnan opened this issue May 8, 2024 · 1 comment

Comments

@jjbrosnan
Copy link

The following code block works, or at least does not crash (it can give a 401 unauthorized HTML response) when run in Python alone. When run from inside of a JVM via jpy, it causes a SIGSEGV and subsequent crash.

I suspect asyncio is the culprit, however, I have successfully run asyncio code from within a JVM previously, so I'm not 100% sure.

import os
os.system('pip install yfinance')

import asyncio
import yfinance as yf

tickers = ['TSLA']


async def main():
    order_count = 1

    for _ in range(order_count):

        for ticker in tickers:
            underlying_stock = yf.Ticker(ticker)
            print(underlying_stock.info)

            

if __name__ == '__main__':
    asyncio.run(main())
    pass
@chipkent
Copy link
Member

chipkent commented May 8, 2024

On the demo,

This kills the process:

import os
os.system('pip install yfinance')

import asyncio
import yfinance as yf

tickers = ['TSLA']


async def main():
    order_count = 1

    for _ in range(order_count):

        for ticker in tickers:
            underlying_stock = yf.Ticker(ticker)
            print(underlying_stock.info)

            

asyncio.run(main())

This also killed the worker:

import os
os.system('pip install yfinance')

import asyncio
import yfinance as yf

tickers = ['TSLA']


def main():
    order_count = 1

    for _ in range(order_count):

        for ticker in tickers:
            underlying_stock = yf.Ticker(ticker)
            print(underlying_stock.info)

            

main()

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