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

http client attempts to send a readable object twice #57069

Closed
langmartin mannequin opened this issue Aug 30, 2011 · 2 comments
Closed

http client attempts to send a readable object twice #57069

langmartin mannequin opened this issue Aug 30, 2011 · 2 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@langmartin
Copy link
Mannequin

langmartin mannequin commented Aug 30, 2011

BPO 12860
Nosy @orsenthil
Superseder
  • bpo-16658: Missing "return" in HTTPConnection.send()
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-06-25.19:59:01.372>
    created_at = <Date 2011-08-30.17:05:30.284>
    labels = ['type-bug']
    title = 'http client attempts to send a readable object twice'
    updated_at = <Date 2014-06-25.19:59:01.370>
    user = 'https://bugs.python.org/langmartin'

    bugs.python.org fields:

    activity = <Date 2014-06-25.19:59:01.370>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-06-25.19:59:01.372>
    closer = 'ned.deily'
    components = []
    creation = <Date 2011-08-30.17:05:30.284>
    creator = 'langmartin'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 12860
    keywords = []
    message_count = 2.0
    messages = ['143227', '221567']
    nosy_count = 3.0
    nosy_names = ['orsenthil', 'BreamoreBoy', 'langmartin']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '16658'
    type = 'behavior'
    url = 'https://bugs.python.org/issue12860'
    versions = ['Python 3.3', 'Python 3.4']

    @langmartin
    Copy link
    Mannequin Author

    langmartin mannequin commented Aug 30, 2011

    on line 765 of client/http.py, the client loops over the read method, sending it's content to the web server. It appears as though the send method should return at this point; instead it falls through and attempts to send the data object through first self.sock.sendall, falling back to the iterable interface.

    The result is that a readable data object must support a null __iter__ method, or if it supports both a working read and __iter__, the data will be sent to the server twice.

    Change the break on line 768 to a return, and the expected behavior happens.

    @langmartin langmartin mannequin added the type-bug An unexpected behavior, bug, or error label Aug 30, 2011
    @BreamoreBoy
    Copy link
    Mannequin

    BreamoreBoy mannequin commented Jun 25, 2014

    This looks identical to the problem fixed on bpo-16658.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant