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

memcached assumes Unix sockets #22

Open
jaraco opened this issue Sep 9, 2018 · 4 comments
Open

memcached assumes Unix sockets #22

jaraco opened this issue Sep 9, 2018 · 4 comments

Comments

@jaraco
Copy link
Contributor

jaraco commented Sep 9, 2018

Today I wanted to use the memcached service fixture in the CherryPy project, but because the fixture here doesn't support Windows, I had chose instead to write our own. Perhaps this project would consider using TCP ports for the memcached service for Windows compatibility.

@webknjaz
Copy link
Member

webknjaz commented Sep 9, 2018

Another issue with Windows is that this dist unconditionally imports fcntl, which crashes tests during setup time, when pytest looks up for and tries to import fixtures: https://ci.appveyor.com/project/CherryPy/cherrypy/build/1.0.444/job/seei217vtwplqk6h#L500

@webknjaz
Copy link
Member

webknjaz commented Sep 9, 2018

(created #23 for that)

@di
Copy link

di commented Jun 4, 2020

The services_log fixture also assumes Unix sockets:

___________ ERROR at setup of test_devpi_upload[twine-1.5.0.tar.gz] ___________

slave_id = 'local'

    @pytest.fixture(scope='session')
    def services_log(slave_id):
        """A services_logger with the slave id."""
        handler = None
        for kwargs in (dict(socktype=socket.SOCK_RAW), dict(socktype=socket.SOCK_STREAM), dict()):
            try:
>               handler = logging.handlers.SysLogHandler(
                    facility=logging.handlers.SysLogHandler.LOG_LOCAL7, address='/dev/log', **kwargs)

.tox\py\lib\site-packages\pytest_services\log.py:16: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.8.3\x64\lib\logging\handlers.py:821: in __init__
    self._connect_unixsocket(address)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <SysLogHandler (NOTSET)>, address = '/dev/log'

    def _connect_unixsocket(self, address):
        use_socktype = self.socktype
        if use_socktype is None:
            use_socktype = socket.SOCK_DGRAM
>       self.socket = socket.socket(socket.AF_UNIX, use_socktype)
E       AttributeError: module 'socket' has no attribute 'AF_UNIX'

C:\hostedtoolcache\windows\Python\3.8.3\x64\lib\logging\handlers.py:853: AttributeError

@bubenkoff
Copy link
Member

@di please submit a PR addressing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants