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

ConnectionError: ('Connection aborted.', BadStatusLine(""''''")) #67243

Closed
joecabrera mannequin opened this issue Dec 15, 2014 · 9 comments
Closed

ConnectionError: ('Connection aborted.', BadStatusLine(""''''")) #67243

joecabrera mannequin opened this issue Dec 15, 2014 · 9 comments
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@joecabrera
Copy link
Mannequin

joecabrera mannequin commented Dec 15, 2014

BPO 23054
Nosy @bitdancer, @vadmium
Superseder
  • bpo-8450: httplib: false BadStatusLine() raised
  • 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 2015-07-19.00:36:27.892>
    created_at = <Date 2014-12-15.14:49:03.514>
    labels = ['type-bug', 'docs']
    title = 'ConnectionError: (\'Connection aborted.\', BadStatusLine(""\'\'\'\'"))'
    updated_at = <Date 2015-07-19.00:36:27.891>
    user = 'https://bugs.python.org/joecabrera'

    bugs.python.org fields:

    activity = <Date 2015-07-19.00:36:27.891>
    actor = 'martin.panter'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2015-07-19.00:36:27.892>
    closer = 'martin.panter'
    components = ['Documentation']
    creation = <Date 2014-12-15.14:49:03.514>
    creator = 'joecabrera'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 23054
    keywords = []
    message_count = 9.0
    messages = ['232664', '232666', '232667', '232758', '232761', '232763', '232766', '246921', '246928']
    nosy_count = 5.0
    nosy_names = ['r.david.murray', 'docs@python', 'martin.panter', 'joecabrera', 'chrismattmann']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '8450'
    type = 'behavior'
    url = 'https://bugs.python.org/issue23054'
    versions = ['Python 2.7']

    @joecabrera
    Copy link
    Mannequin Author

    joecabrera mannequin commented Dec 15, 2014

    ConnectionError: ('Connection aborted.', BadStatusLine(""''''"))

    This error can also occur on Linux and Windows, a more descriptive error messages would be useful for people trying to debug their code.

    @joecabrera joecabrera mannequin assigned docspython Dec 15, 2014
    @joecabrera joecabrera mannequin added docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Dec 15, 2014
    @bitdancer
    Copy link
    Member

    I think you made a mistake in your copy and paste or retyping of that line, since it is not valid python syntax.

    What is not explicit about it? It is telling you there was a bad status line, and what the bad status line contents was. (Used to be you couldn't tell, when the badness of the status line was that it was empty, that that was what the error message was saying, but I'm pretty sure we fixed that so that it shows an empty status line as an empty string in the message).

    @bitdancer
    Copy link
    Member

    Perhaps part of your problem is that you are not getting the string representation of the error message. Is that because of your code, or is this representation something the stdlib is generating?

    @joecabrera
    Copy link
    Mannequin Author

    joecabrera mannequin commented Dec 16, 2014

    This is an error wrapping coming from requests.

    https://github.com/kennethreitz/requests/issues/2364

    The Requests team has concluded they can do nothing about this error, I believe the next step up is the python httplib library.

    @bitdancer
    Copy link
    Member

    I wonder the actual error reported in that issue has any relationship to bpo-15082?

    In any case, the error being presented to requests is *accurate*: httplib tried to read the status line and got nothing (the actual text in the linked issue is BadStatusLine("''")). (Note that bpo-7427 was where we fixed the repr, if you are curious).

    I see that requests would like "a better error message". Is there a concrete suggestion for what that better error message would look like?

    @vadmium
    Copy link
    Member

    vadmium commented Dec 16, 2014

    Not exactly sure what do you want the Python library to do, but perhaps this is a duplicate of bpo-8450, about making the error less misleading when the connection is closed before _any_ status line is sent. See also bpo-7427.

    @bitdancer
    Copy link
    Member

    Ouch. I assumed the change was made to the repr, not the contents of line (I wasn't involved in that fix). Not that that would actually affect this issue, I think, since Requests doesn't want to "introspect exception objects".

    @chrismattmann
    Copy link
    Mannequin

    chrismattmann mannequin commented Jul 18, 2015

    Hi there, we are experiencing this in tika-python too, see:

    chrismattmann/tika-python#44

    @vadmium
    Copy link
    Member

    vadmium commented Jul 19, 2015

    There is hopefully a better RemoteDisconnected exception and documentation in 3.5, thanks to bpo-3566. In Python 2, I think this is the same as bpo-8450.

    @vadmium vadmium closed this as completed Jul 19, 2015
    @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
    docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants