GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cannot use docker with eventlet since #2865 · Issue #3131 · docker/docker-py

Cannot use docker with eventlet since #2865 #3131

New issue
Copy link
New issue
Copy link
Closed
#3132
Closed
Cannot use docker with eventlet since #2865#3131
#3132
Copy link

Description

@tito
tito
opened on May 16, 2023
Issue body actions

Before #2865, it was possible to use docker-py with a eventlet-based project.
However, after the inclusion of a tests for using poll(), i now have errors, see below.

This is expected: eventlet removes poll function on the select module on purpose. See eventlet/eventlet#608 (comment)

So instead of checking if the platform is win32, we should check if the select module have a poll method. Which also make it more cross-platform compatible as per select.poll documentation (https://docs.python.org/3/library/select.html#select.poll - Not supported by all operating systems, but not mentionning win32 exactly.)

.venv/lib/python3.11/site-packages/docker/utils/socket.py:156: in consume_socket_output                                       [64/1813]
    return bytes().join(frames)                                                                                                        
.venv/lib/python3.11/site-packages/docker/api/client.py:422: in <genexpr>                                                              
    gen = (data for (_, data) in gen)                                                                                                  
.venv/lib/python3.11/site-packages/docker/utils/socket.py:113: in frames_iter_no_tty                                                   
    (stream, n) = next_frame_header(socket)                                                                                            
.venv/lib/python3.11/site-packages/docker/utils/socket.py:85: in next_frame_header                                                     
    data = read_exactly(socket, 8)                                                                                                     
.venv/lib/python3.11/site-packages/docker/utils/socket.py:70: in read_exactly                                                          
    next_data = read(socket, n - len(data))                                                                                            
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _      
                                                                                                                                       
socket = <socket.SocketIO object at 0x7f0f24f04c10>, n = 8                                                                             
                                                                                                                                       
    def read(socket, n=4096):                                                                                                          
        """                                                                                                                            
        Reads at most n bytes from socket                                                                                              
        """                                                                                                                            
                                                                                                                                       
        recoverable_errors = (errno.EINTR, errno.EDEADLK, errno.EWOULDBLOCK)                                                           
                                                                                                                                       
        if not isinstance(socket, NpipeSocket):                                                                                        
            if sys.platform == 'win32':                                                                                                
                # Limited to 1024                                  
                select.select([socket], [], [])                    
            else:                
>               poll = select.poll()                               
E               AttributeError: module 'select' has no attribute 'poll'                                                                

.venv/lib/python3.11/site-packages/docker/utils/socket.py:39: AttributeError   

Activity

  1. tito
    added a commit that references this issue on May 16, 2023

    Check if poll attribute exists on select module instead of win32 plat…

    This issue will close once commit 8a4c55f is merged into the 'main' branch.
    8a4c55f
  2. milas
    closed this as completedin #3132on Jun 1, 2023
  3. milas
    added a commit that references this issue on Jun 1, 2023

    fix: eventlet compatibility (#3132)

    This issue will close once commit 78439eb is merged into the 'main' branch.
    78439eb
  4. felixfontein
    added 2 commits that reference this issue on Oct 7, 2023

    vendored Docker SDK for Python code: fix: eventlet compatibility

    a92a7f2

    Update vendored Docker SDK for Python code (#694)

    4d9b85c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.