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

Document that Response.iter_lines is broken and should be avoided #6570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 10, 2023

  1. Document that Response.iter_lines is broken.

    This method is broken in a couple of significant ways:
    
    - If delimiter is None, and if one chunk happens to end with \r and
      the following chunk begins with \n, this method will yield a bogus
      blank line at that point.
    
    - If delimiter is a string, and if a chunk happens to end with that
      string, this method will yield a bogus blank line at that point.
    
    This is broken both with and without decode_unicode=True, and it is
    broken both with and without stream=True.  (Setting stream=True makes
    the problem worse, because then the chunk boundaries are partially
    dependent on server or network I/O chunking.)
    
    Unless and until this behavior is fixed, this method should not be
    used.
    Benjamin Moody committed Nov 10, 2023
    Configuration menu
    Copy the full SHA
    cd10158 View commit details
    Browse the repository at this point in the history