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

error: (10035, 'The socket operation could not complete without blocking') #46962

Closed
dhanlen mannequin opened this issue Apr 28, 2008 · 10 comments
Closed

error: (10035, 'The socket operation could not complete without blocking') #46962

dhanlen mannequin opened this issue Apr 28, 2008 · 10 comments
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@dhanlen
Copy link
Mannequin

dhanlen mannequin commented Apr 28, 2008

BPO 2710
Nosy @terryjreedy, @devdanzin
Files
  • tkinterwork.py: GUI for backgammon, in progress
  • rpc.diff: patch against trunk (untested)
  • 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 2011-01-13.16:59:00.712>
    created_at = <Date 2008-04-28.19:44:50.014>
    labels = ['expert-IDLE', 'type-bug']
    title = "error: (10035, 'The socket operation could not complete without blocking')"
    updated_at = <Date 2011-01-13.16:59:00.711>
    user = 'https://bugs.python.org/dhanlen'

    bugs.python.org fields:

    activity = <Date 2011-01-13.16:59:00.711>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-01-13.16:59:00.712>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2008-04-28.19:44:50.014>
    creator = 'dhanlen'
    dependencies = []
    files = ['10133', '14655']
    hgrepos = []
    issue_num = 2710
    keywords = ['patch']
    message_count = 10.0
    messages = ['65928', '65945', '86612', '91235', '91293', '91299', '91303', '91323', '124952', '126182']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'ggenellina', 'ajaksu2', 'gpolo', 'dhanlen']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'test needed'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2710'
    versions = ['Python 3.1', 'Python 2.7']

    @dhanlen
    Copy link
    Mannequin Author

    dhanlen mannequin commented Apr 28, 2008

    IDLE internal error in runcode()
    Traceback (most recent call last):
      File "C:\PYTHON25\lib\idlelib\rpc.py", line 235, in asyncqueue
        self.putmessage((seq, request))
      File "C:\PYTHON25\lib\idlelib\rpc.py", line 332, in putmessage
        n = self.sock.send(s[:BUFSIZE])
    error: (10035, 'The socket operation could not complete without blocking')

    Does this look familiar to anyone? I can't figure out what to do about
    it. Python 2.5, windoze. I get it when I execute a Tkinter op that
    works elsewhere.

    changing this (works):

    t = self.b.create_text(
        (point.baseX + 1)*self.checkerSize/2 + fudge,
        y + fudge,
        text = str(point.occupied),
        width = self.checkerSize)

    to

    t = self.b.create_text(
        (point.baseX + 1)*self.checkerSize/2 + fudge,
        y + fudge,
        text = str(point.occupied),
        font=("Times", str(self.checkerSize/2), "bold"),
        width = self.checkerSize)

    for example. The same code works fine elsewhere. I thought I'd ask
    here before I try (no clue) increasing BUFSIZE in rpc.py? I'm not crazy
    about tinkering with code I have no clue about..

    It has been suggested that the problem is competition with IDLE for
    tkinter resources.

    --

    don

    @dhanlen
    Copy link
    Mannequin Author

    dhanlen mannequin commented Apr 28, 2008

    ah, lines 284-289 (the lines in question) need indenting 4 levels. I
    just DL'd 2.5.2, ran the code once, no problem, 2nd time, got the usual
    error message.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Apr 26, 2009

    Don: any news on this? Do you still get the same error with 2.6?

    @devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Apr 26, 2009
    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 3, 2009

    Hi Don,

    I don't think this is an issue about idle competing for tkinter
    resources (or idle and tkinter competing for resources -- the other
    meaning I got when reading your message).
    From what I remember this WSAEWOULDBLOCK is just a way for Windows to
    tell "try to send this data again later", so this is actually related to
    networking and not Tkinter vs. IDLE. If someone can confirm this then it
    would be better to check for this specific error and ignore (pass)
    instead of always raising any socket.error.

    @ggenellina
    Copy link
    Mannequin

    ggenellina mannequin commented Aug 5, 2009

    AFAIK, WSAEWOULDBLOCK means that the socket is in nonblocking mode and
    the attempted operation could wait indefinitely to complete. But I
    don't understand how that could happen since a previous select()
    confirmed the socket is writeable...
    Probably the whole code block could be replaced by a single
    self.sock.sendall(s) call.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 5, 2009

    AFAIK, WSAEWOULDBLOCK means that the socket is in nonblocking mode and
    the attempted operation could wait indefinitely to complete.

    Rather pessimistic way to see it :) I've always read it as "operation
    cannot be completed without blocking".

    But I
    don't understand how that could happen since a previous select()
    confirmed the socket is writeable...

    Richard Stevens, MSDN
    (http://msdn.microsoft.com/en-us/library/ms741540(VS.85).aspx) and
    possibly several other authors and places will tell it is possible to
    happen. I've always seen this being handled as "try again later".

    @ggenellina
    Copy link
    Mannequin

    ggenellina mannequin commented Aug 5, 2009

    So this patch should fix it. But I cannot fire the bug using the posted
    example, and there are no test cases for this module yet, so I could
    not test it.

    @gpolo
    Copy link
    Mannequin

    gpolo mannequin commented Aug 5, 2009

    I just tried writing tests for it, but I don't know idlelib/rpc.py
    enough yet. You can see this first attempt at:
    http://svn.python.org/view?view=rev&revision=74320

    I started trying to test rpc.RPCClient together with run.main but it
    seemed too high level. Then I moved to try to test rpc.SocketIO
    directly, but it seems I'm doing wrong things there. Most of times
    SocketIOTest will fail by raising ValueError which then causes the
    server process to finish and either cause a "Connection reset by peer",
    "Broken pipe" or nothing (these are on Linux, on Windows I would expect
    to get "An existing connection was forcibly closed by the remote host").
    Sometimes it also succeeds.

    @terryjreedy
    Copy link
    Member

    If there is no verification that there is a bug in 2.7/3.1,2, then I think this should be closed.

    @terryjreedy
    Copy link
    Member

    This can be reopened if the problem ever appears in a current issue.

    @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
    topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants