← Back to team overview

mosquitto-users team mailing list archive

Re: Exception thrown from loop() when ssl enabled and network missing

 

This might be another place where we intend to catch exceptions, but the
exception type is different when ssl is on:

Traceback (most recent call last):
  File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.2/threading.py", line 693, in run
    self._target(*self._args, **self._kwargs)
  File "/home/jacko/linuxmessenger/mosquitto.py", line 1765, in _thread_main
    rc = self.loop()
  File "/home/jacko/linuxmessenger/mosquitto.py", line 664, in loop
    socklist = select.select(rlist, wlist, [], timeout)
ValueError: file descriptor cannot be a negative integer (-1)



On Sun, Feb 17, 2013 at 11:38 AM, Jack O'Connor <oconnor663@xxxxxxxxx>wrote:

> Traceback (most recent call last):
>   File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
>     self.run()
>   File "/usr/lib/python3.2/threading.py", line 693, in run
>     self._target(*self._args, **self._kwargs)
>   File "/home/jacko/linuxmessenger/mosquitto.py", line 1765, in
> _thread_main
>     rc = self.loop()
>   File "/home/jacko/linuxmessenger/mosquitto.py", line 670, in loop
>     rc = self.loop_read(max_packets)
>   File "/home/jacko/linuxmessenger/mosquitto.py", line 840, in loop_read
>     rc = self._packet_read()
>   File "/home/jacko/linuxmessenger/mosquitto.py", line 1078, in
> _packet_read
>     command = self._ssl.read(1)
>   File "/usr/lib/python3.2/ssl.py", line 295, in read
>     v = self._sslobj.read(len or 1024)
> AttributeError: 'NoneType' object has no attribute 'read'
>
> It looks like _packet_read() catches certain socket exceptions, but it
> doesn't expect this one. I'm guessing this is a behavior difference between
> ssl and non-ssl sockets. Is this a bug?
>

Follow ups

References