Skip to content

Yield is broken using generators #27

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

Open
martincpt opened this issue Mar 27, 2025 · 1 comment · May be fixed by #29
Open

Yield is broken using generators #27

martincpt opened this issue Mar 27, 2025 · 1 comment · May be fixed by #29

Comments

@martincpt
Copy link

After I tried the examples from the README, I ran into the following issue.

Traceback (most recent call last):
  File "/Users/martin/Code/grpc-playground/rpc/client.py", line 34, in <module>
    for i in yield_data(5):
  File "/Users/martin/Code/grpc-playground/.venv/lib/python3.12/site-packages/rpcpy/client.py", line 193, in wrapper
    event = sse_parser.feed(line)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/martin/Code/grpc-playground/.venv/lib/python3.12/site-packages/rpcpy/client.py", line 222, in feed
    if line[0] == ":":  # ignore comment
       ~~~~^^^
IndexError: string index out of range
@martincpt
Copy link
Author

The issue arises with httpx version 0.24 or later, where aiter_lines no longer includes the line break that the current version accounts for. A temporary solution is to install httpx version 0.23.

@martincpt martincpt linked a pull request Apr 20, 2025 that will close this 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

Successfully merging a pull request may close this issue.

1 participant