jegesh / python-sqs-listener

A simple wrapper for boto3 for listening, and sending, to an AWS SQS queue
Other
154 stars 71 forks source link

handle ValueError exception when pidfile is empty #56

Closed mtami closed 1 year ago

mtami commented 2 years ago

When starting the Daemon for the first time, the pidfile is auto-created with empty content, however, the exception handling does not capture casting an empty string to int.

Currently, the following exception is raised.

Traceback (most recent call last):
  File "callback_listener.py", line 46, in <module>
    daemon.start()
  File "~/sqs_listener/daemon.py", line 85, in start
    pid = int(pf.read().strip())
ValueError: invalid literal for int() with base 10: ''