Skip to content

Windows bug: 'socket' has no attribute 'MSG_DONTWAIT' #129

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

Closed
Greyvend opened this issue Feb 20, 2018 · 2 comments · Fixed by #130
Closed

Windows bug: 'socket' has no attribute 'MSG_DONTWAIT' #129

Greyvend opened this issue Feb 20, 2018 · 2 comments · Fixed by #130
Assignees

Comments

@Greyvend
Copy link

The recent versions of the package have the bug that prevents from using it on Windows installations since python's socket.py on Windows doesn't have the MSG_DONTWAIT option. Here's the sample traceback:

  File "<src_path>\app.py", line 43, in main
    logger.info('Account api started')
  File "<src_path>\appdata\local\programs\python\python36\Lib\logging\__init__.py", line 1306, in info
    self._log(INFO, msg, args, **kwargs)
  File "<src_path>\appdata\local\programs\python\python36\Lib\logging\__init__.py", line 1442, in _log
    self.handle(record)
  File "<src_path>\appdata\local\programs\python\python36\Lib\logging\__init__.py", line 1452, in handle
    self.callHandlers(record)
  File "<src_path>\appdata\local\programs\python\python36\Lib\logging\__init__.py", line 1514, in callHandlers
    hdlr.handle(record)
  File "<src_path>\appdata\local\programs\python\python36\Lib\logging\__init__.py", line 863, in handle
    self.emit(record)
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\handler.py", line 225, in emit
    data)
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\sender.py", line 97, in emit_with_time
    return self._send(bytes_)
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\sender.py", line 139, in _send
    return self._send_internal(bytes_)
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\sender.py", line 148, in _send_internal
    self._send_data(bytes_)
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\sender.py", line 190, in _send_data
    self._check_recv_side()
  File "<src_path>\Envs\pms.account.queryapi\lib\site-packages\fluent\sender.py", line 173, in _check_recv_side
    recvd = self.socket.recv(4096, socket.MSG_DONTWAIT)
AttributeError: module 'socket' has no attribute 'MSG_DONTWAIT'

I had to switch to version 0.6.0 where there is no _check_recv_side method that fails.
Here's the similar problem and solution used in another lib: https://github.com/banjiewen/bernhard/issues/15

@arcivanov
Copy link
Member

Thanks for your report!

arcivanov added a commit to arcivanov/fluent-logger-python that referenced this issue Feb 21, 2018
arcivanov added a commit to arcivanov/fluent-logger-python that referenced this issue Feb 21, 2018
@arcivanov
Copy link
Member

Fixed in v0.9.2. Please let me know if it works for you.

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

Successfully merging a pull request may close this issue.

2 participants