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

Sometimes urllib2 raises URLError when trying POST with httpS #63257

Closed
mrDoctorWho0 mannequin opened this issue Sep 20, 2013 · 3 comments
Closed

Sometimes urllib2 raises URLError when trying POST with httpS #63257

mrDoctorWho0 mannequin opened this issue Sep 20, 2013 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@mrDoctorWho0
Copy link
Mannequin

mrDoctorWho0 mannequin commented Sep 20, 2013

BPO 19057
Nosy @tiran, @bitdancer
Files
  • code.py: a part of code
  • 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 2016-09-08.22:46:01.402>
    created_at = <Date 2013-09-20.10:55:37.819>
    labels = ['invalid', 'type-bug', 'library']
    title = 'Sometimes urllib2 raises URLError when trying POST with httpS'
    updated_at = <Date 2016-09-08.22:46:01.400>
    user = 'https://bugs.python.org/mrDoctorWho0'

    bugs.python.org fields:

    activity = <Date 2016-09-08.22:46:01.400>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-09-08.22:46:01.402>
    closer = 'christian.heimes'
    components = ['Library (Lib)']
    creation = <Date 2013-09-20.10:55:37.819>
    creator = 'mrDoctorWho0..'
    dependencies = []
    files = ['31825']
    hgrepos = []
    issue_num = 19057
    keywords = []
    message_count = 3.0
    messages = ['198141', '198147', '275199']
    nosy_count = 3.0
    nosy_names = ['christian.heimes', 'r.david.murray', 'mrDoctorWho0..']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19057'
    versions = ['Python 2.7']

    @mrDoctorWho0
    Copy link
    Mannequin Author

    mrDoctorWho0 mannequin commented Sep 20, 2013

    Trying to use POST-request to https://vk.com and sometimes library raise an error.
    File "library/vkApi.py", line 31, in post
    response = self.Opener.open(request)
    File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
    File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
    File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
    File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
    raise URLError(err)
    URLError: <urlopen error _ssl.c:489: The handshake operation timed out>

    This exception appears randomly, connection is ok 100%. I tried it on different machines with python 2.7.4 and 2.7.3.

    @mrDoctorWho0 mrDoctorWho0 mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 20, 2013
    @bitdancer
    Copy link
    Member

    I would guess that if you did a network trace you'd find out there really was a packet that did not arrive (a timeout). Note that detecting this is complicated by the fact that ssl is involved. (I don't know the details, but I remember someone saying that more than one packet may be involved in something that looks like a single event at the OpenSSL level.)

    It is certainly *possible* that there is a bug at the OpenSSL or (less likely) the _ssl module level, but the first step in debugging it would be to get that network trace, I think...

    As I said, though, I'm not an expert in this area, perhaps someone who is will have other suggestions.

    @tiran
    Copy link
    Member

    tiran commented Sep 8, 2016

    I'm closing this ticket. It's old and hasn't seen any activity in almost three years.

    @tiran tiran closed this as completed Sep 8, 2016
    @tiran tiran added the invalid label Sep 8, 2016
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants