internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pymedusa/Medusa

Issue:
TypeError: not all arguments converted during string formatting
```
2017-05-31 17:10:51 INFO     MAIN :: [72e3c23] Checking for scene exception updates from https://cdn.pymedusa.com/scene_exceptions/scene_exceptions_tmdb.json
Traceback (most recent call last):
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/home/travis/build/pymedusa/Medusa/medusa/logger/__init__.py", line 532, in format
    msg = super(CensoredFormatter, self).format(record)
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 471, in format
    record.message = record.getMessage()
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
```


Discussion:
From @duramato:

```
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] Executing {cmd} with your shell in {dir}
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] Executing {cmd} with your shell in {dir}
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] check_for_new_news: Checking GitHub for latest news.
```

Resolving patch:
diff --git a/medusa/version_checker.py b/medusa/version_checker.py
--- a/medusa/version_checker.py
+++ b/medusa/version_checker.py
@@ -29,14 +29,16 @@
 
 from logging import DEBUG, WARNING
 
+from medusa.logger.adapters.style import BraceAdapter
+
 from . import app, db, helpers, notifiers, ui
 from .github_client import get_github_repo
 
 ERROR_MESSAGE = ('Unable to find your git executable. Set git executable path in Advanced Settings '
                  'OR shutdown application and delete your .git folder and run from source to enable updates.')
 
-log = logging.getLogger(__name__)
-log.addHandler(logging.NullHandler())
+log = BraceAdapter(logging.getLogger(__name__))
+log.logger.addHandler(logging.NullHandler())
 
 
 class CheckVersion(object):


Test patch:
Repository: pymedusa/Medusa

Issue:
TypeError: not all arguments converted during string formatting
```
2017-05-31 17:10:51 INFO     MAIN :: [72e3c23] Checking for scene exception updates from https://cdn.pymedusa.com/scene_exceptions/scene_exceptions_tmdb.json
Traceback (most recent call last):
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/home/travis/build/pymedusa/Medusa/medusa/logger/__init__.py", line 532, in format
    msg = super(CensoredFormatter, self).format(record)
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 471, in format
    record.message = record.getMessage()
  File "/opt/python/2.7.9/lib/python2.7/logging/__init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
```


Discussion:
From @duramato:

```
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] Executing {cmd} with your shell in {dir}
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] Executing {cmd} with your shell in {dir}
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] {cmd} : returned successful
2017-05-31 20:49:27 DEBUG    CHECKVERSION :: [94e0649] check_for_new_news: Checking GitHub for latest news.
```
Fixed with https://github.com/pymedusa/Medusa/pull/2852

Resolving patch:
diff --git a/medusa/version_checker.py b/medusa/version_checker.py
--- a/medusa/version_checker.py
+++ b/medusa/version_checker.py
@@ -29,14 +29,16 @@
 
 from logging import DEBUG, WARNING
 
+from medusa.logger.adapters.style import BraceAdapter
+
 from . import app, db, helpers, notifiers, ui
 from .github_client import get_github_repo
 
 ERROR_MESSAGE = ('Unable to find your git executable. Set git executable path in Advanced Settings '
                  'OR shutdown application and delete your .git folder and run from source to enable updates.')
 
-log = logging.getLogger(__name__)
-log.addHandler(logging.NullHandler())
+log = BraceAdapter(logging.getLogger(__name__))
+log.logger.addHandler(logging.NullHandler())
 
 
 class CheckVersion(object):


Test patch:
Repository: pymedusa/Medusa

Issue:
No posters for trakt show recommendations
### Before submitting your issue:

Enable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)

**Branch/Commit:**
**OS:**
**What you did:**
**What happened:**
**What you expected:**
**Logs:**
```
2017-06-27 05:58:49 DEBUG    Thread-38 :: [b26de9c] Missing poster on TheTVDB, cause: WindowsError(3, 'The system cannot find the path specified')```



Discussion:

Resolving patch:
diff --git a/medusa/show/recommendations/trakt.py b/medusa/show/recommendations/trakt.py
--- a/medusa/show/recommendations/trakt.py
+++ b/medusa/show/recommendations/trakt.py
@@ -104,7 +104,8 @@ def _create_recommended_show(self, show_obj):
         try:
             if not missing_posters.has(show_obj['show']['ids']['tvdb']):
                 image = self.check_cache_for_poster(show_obj['show']['ids']['tvdb']) or \
-                    self.tvdb_api_v2.series_api.series_id_images_query_get(show_obj['show']['ids']['tvdb'], key_type='poster').data[0].file_name
+                    self.tvdb_api_v2.config['session'].series_api.series_id_images_query_get(show_obj['show']['ids']['tvdb'],
+                                                                                             key_type='poster').data[0].file_name
             else:
                 log.info('CACHE: Missing poster on TVDB for show {0}', show_obj['show']['title'])
                 use_default = self.default_img_src
@@ -117,7 +118,11 @@ def _create_recommended_show(self, show_obj):
             use_default = self.default_img_src
             log.debug('Missing poster on TheTVDB, cause: {0!r}', error)
 
-        rec_show.cache_image('http://thetvdb.com/banners/{0}'.format(image), default=use_default)
+        if image:
+            rec_show.cache_image('http://thetvdb.com/banners/{0}'.format(image), default=use_default)
+        else:
+            rec_show.cache_image('', default=use_default)
+
         # As the method below requires allot of resources, i've only enabled it when
         # the shows language or country is 'jp' (japanese). Looks a litle bit akward,
         # but alternative is allot of resource used
@@ -210,6 +215,9 @@ def fetch_popular_shows(self, page_url=None, trakt_list=None):  # pylint: disabl
 
     def check_cache_for_poster(self, tvdb_id):
         """Verify if we already have a poster downloaded for this show."""
+        if not os.path.exists(os.path.join(app.CACHE_DIR, 'images', self.cache_subfolder)):
+            os.makedirs(os.path.join(app.CACHE_DIR, 'images', self.cache_subfolder))
+
         for image_file_name in os.listdir(os.path.abspath(os.path.join(app.CACHE_DIR, 'images', self.cache_subfolder))):
             if os.path.isfile(os.path.abspath(os.path.join(app.CACHE_DIR, 'images', self.cache_subfolder, image_file_name))):
                 if str(tvdb_id) == image_file_name.split('-')[0]:


Test patch:
Repository: pymedusa/Medusa

Issue:
Error: SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)
```
2017-08-22 17:13:36 ERROR    SHOWQUEUE-ADD :: [49e9fc3] 289590 Error while loading information from indexer TVDBv2. Error: SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),)
Traceback (most recent call last):
  File "/app/medusa/medusa/show_queue.py", line 419, in run
    check_existing_shows(s, self.indexer)
  File "/app/medusa/medusa/helpers/externals.py", line 131, in check_existing_shows
    new_show_externals = get_externals(indexer=indexer, indexed_show=indexed_show)
  File "/app/medusa/medusa/helpers/externals.py", line 105, in get_externals
    new_show_externals.update(t.get_id_by_external(**new_show_externals))
  File "/app/medusa/medusa/indexers/tmdb/tmdb.py", line 593, in get_id_by_external
    result = self.tmdb.Find(kwargs.get(external_id)).info(**{'external_source': external_id})
  File "/app/medusa/lib/tmdbsimple/find.py", line 50, in info
    response = self._GET(path, kwargs)
  File "/app/medusa/lib/tmdbsimple/base.py", line 87, in _GET
    return self._request('GET', path, params=params)
  File "/app/medusa/lib/tmdbsimple/base.py", line 80, in _request
    headers=self.headers)
  File "/app/medusa/lib/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/app/medusa/lib/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/app/medusa/lib/cachecontrol/adapter.py", line 46, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/app/medusa/lib/requests/adapters.py", line 477, in send
    raise SSLError(e, request=request)
SSLError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
```


Discussion:

Resolving patch:
diff --git a/medusa/helpers/externals.py b/medusa/helpers/externals.py
--- a/medusa/helpers/externals.py
+++ b/medusa/helpers/externals.py
@@ -10,6 +10,7 @@
 from medusa.indexers.indexer_exceptions import IndexerException, IndexerShowAllreadyInLibrary, IndexerUnavailable
 from medusa.logger.adapters.style import BraceAdapter
 
+from requests.exceptions import RequestException
 from traktor import AuthException, TokenExpiredException, TraktApi, TraktException
 
 log = BraceAdapter(logging.getLogger(__name__))
@@ -103,7 +104,7 @@ def get_externals(show=None, indexer=None, indexed_show=None):
             # except for the indexers own.
             try:
                 new_show_externals.update(t.get_id_by_external(**new_show_externals))
-            except IndexerException as error:
+            except (IndexerException, RequestException) as error:
                 log.warning(
                     u'Error getting external ids for other'
                     u' indexer {name}: {reason}',


Test patch:
Repository: pymedusa/Medusa

Issue:
Cookie required when configuring custom provider

Branch: master
Commit: 3f23fd272652b10cf781e3058fee50daf79f11b6Version: v0.1.15
Database: 44.8
Python Version: | 2.7.13 (default, Dec 18 2016, 22:44:40) [GCC 4.9.3 20150311 (prerelease)]
SSL Version: | OpenSSL 1.0.2j 26 Sep 2016
OS: | Linux-3.10.102-armv7l-with-glibc2.4
Locale: | en_US.UTF-8

Trying to add custom provider, EZTV.  I don't use a login, just linking to the RSS feed.  When I try to add the site, it's requiring a cookie, something I don't recall having to do w/SR.   When I put all of the details in except the cookie and hit add, I get an error box stating "No Cookies added from ui for provider: EZTV".  Shouldn't this be optional or has something changed requiring cookies to be set?


Discussion:

Resolving patch:
diff --git a/medusa/providers/torrent/rss/rsstorrent.py b/medusa/providers/torrent/rss/rsstorrent.py
--- a/medusa/providers/torrent/rss/rsstorrent.py
+++ b/medusa/providers/torrent/rss/rsstorrent.py
@@ -46,8 +46,9 @@ def __init__(self, name, url, cookies='',
         self.enable_daily = enable_daily
         self.enable_manualsearch = enable_manualsearch
         self.enable_backlog = enable_backlog
-        self.enable_cookies = True
+        self.enable_cookies = bool(cookies)
         self.cookies = cookies
+        self.required_cookies = ('uid', 'pass')
         self.title_tag = title_tag
 
         # Torrent Stats
@@ -156,9 +157,10 @@ def _make_provider(config):
     def validate_rss(self):
         """Validate if RSS."""
         try:
-            add_cookie = self.add_cookies_from_ui()
-            if not add_cookie.get('result'):
-                return add_cookie
+            if self.enable_cookies:
+                add_cookie = self.add_cookies_from_ui()
+                if not add_cookie.get('result'):
+                    return add_cookie
 
             data = self.cache._get_rss_data()['entries']
             if not data:


Test patch:
Repository: pymedusa/Medusa

Issue:
Medusa fails to delete .srt .nfo -thumb.jpg files when replacing an episode with preferred quality
**Branch/Commit:**
Medusa Info:  Branch: master
Commit: 3f23fd272652b10cf781e3058fee50daf79f11b6

**OS:**
OS: Linux-4.13.4-1-ARCH-x86_64-with-glibc2.2.5

**What you did:**
Medusa replaced an allowed quality episode with a preferred quality episode

This issue has happened with many different series and episodes on my computer (all of them,
in fact). But I have just included one specific example in this report.

**What happened:**
Medusa deleted the .mkv file associated with the old quality episode being replaced,
but did NOT delete associated .srt .nfo -thumb.jpg files

**What you expected:**
Medusa should have deleted all the files associated with the old quality episode that
is being replaced. I switched to Medusa from an older version of Sickrage and SR
used to delete those files.

Note that I have PostProcessing / Rename episode using the Episode Naming settings? unchecked
(disabled) so the original filenames are kept, but there is a custom renaming pattern defined. Medusa
should respect the unchecked rename setting despite having a custom renaming pattern defined, but
I thought I should mention this in case there is a bug in Medusa under those conditions.

**Logs:**
```
Medusa Configuration
Medusa Info:  Branch: master
Commit: 3f23fd272652b10cf781e3058fee50daf79f11b6
Version: v0.1.15
Database: 44.8
Python Version: 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]
SSL Version:  OpenSSL 1.1.0f 25 May 2017
OS: Linux-4.13.4-1-ARCH-x86_64-with-glibc2.2.5
Locale: en_US.UTF-8
   
   
User: sysop
Program Folder: /opt/Medusa
Config File:  /home/sysop/.medusa/config.ini
Database File:  /home/sysop/.medusa/main.db
Cache Folder: /home/sysop/.medusa/cache
Log Folder: /home/sysop/.medusa/Logs
Arguments:  

[
    "--quiet",
    "--nolaunch",
    "--daemon",
    "--datadir",
    "/home/sysop/.medusa"
]

[medusa-issue.log](https://github.com/pymedusa/Medusa/files/1382968/medusa-issue.log)

```



Discussion:

Resolving patch:
diff --git a/medusa/post_processor.py b/medusa/post_processor.py
--- a/medusa/post_processor.py
+++ b/medusa/post_processor.py
@@ -326,13 +326,8 @@ def _delete(self, files, associated_files=False):
             file_list = files
 
         # also delete associated files, works only for 1 file
-        if associated_files and len(files) == 1:
-            file_list += self.list_associated_files(files[0], subfolders=True)
-
-        if not file_list:
-            self.log(u'There were no files associated with {0}, not deleting anything'.format
-                     (files), logger.DEBUG)
-            return
+        if associated_files and len(file_list) == 1:
+            file_list += self.list_associated_files(file_list[0], subfolders=True)
 
         for cur_file in file_list:
             if os.path.isfile(cur_file):


Test patch:
Repository: pymedusa/Medusa

Issue:
qbittorrent: Unable to set the label for Torrent
### Before submitting your issue:

Enable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)

**Branch/Commit:**
MASTER branch
commit b16e0e5eb4ded727eebd2ab2cd9683ab597662f5

**OS:** 
Linux-4.10.0-37-generic-x86_64-with-LinuxMint-18.2-sonya
running Qbittorrent 3.3.16

**What you did:**
Snatch an episode manually

**What happened:**
It worked fine successfully added torrent to qbittorrent, downloaded it, post procssed it, etc.... but threw this error about Qbittorrent and a label issue

**What you expected:**
Not an error - note in Search Settings -> Torrent Search -> Add Label to Torrent it is blank (with no spaces) - a friend of mine is seeing this same error, we both went from SickRage to pyMedusa today and are both qBittorrent users

**Logs:**
```
2017-11-01 12:55:35 ERROR    SNATCHQUEUE-MANUALSNATCH-250487 :: [b16e0e5] qbittorrent: Unable to set priority for Torrent
2017-11-01 12:55:35 INFO     SNATCHQUEUE-MANUALSNATCH-250487 :: [b16e0e5] qbittorrent: Forbidden
2017-11-01 12:55:35 ERROR    SNATCHQUEUE-MANUALSNATCH-250487 :: [b16e0e5] qbittorrent: Unable to set the label for Torrent
2017-11-01 12:55:33 INFO     SNATCHQUEUE-MANUALSNATCH-250487 :: [b16e0e5] Downloading xxxxxxx.mkv with 8 seeders and 0 leechers and size 1.91 GB from xxxx
2017-11-01 12:55:33 INFO     SNATCHQUEUE-MANUALSNATCH-250487 :: [b16e0e5] Beginning to manual snatch release: xxxxxx

I changed the torrent name and provider to xxxx for privacy.


Discussion:

Resolving patch:
diff --git a/medusa/clients/torrent/qbittorrent_client.py b/medusa/clients/torrent/qbittorrent_client.py
--- a/medusa/clients/torrent/qbittorrent_client.py
+++ b/medusa/clients/torrent/qbittorrent_client.py
@@ -96,7 +96,7 @@ def _set_torrent_label(self, result):
                 label_key.lower(): label.replace(' ', '_'),
             }
             return self._request(method='post', data=data, cookies=self.session.cookies)
-        return None
+        return True
 
     def _set_torrent_priority(self, result):
 


Test patch:
Repository: pymedusa/Medusa

Issue:
Season 00 logging as WARNING when no banner available on TheTVDB
```
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] Found codec for Saturday Night Live SNL Remembers Chris Farley
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] 76177: Formatting pattern: %SN - S%0SE%0E - %EN -> Saturday Night Live - S00E28 - SNL Remembers Chris Farley
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] Metadata provider KODI 12+ creating episode thumbnail for Saturday Night Live - S00E28 - SNL Remembers Chris Farley
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] Fetching image from http://thetvdb.com/banners/%s
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] GET URL: http://thetvdb.com/banners/%s [Status: 301]
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] User-Agent: Medusa/0.0.1 (Linux; 4.9.49-moby; b859e09c-c0f3-11e7-a43f-0242ac110004)
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] GET URL: https://www.thetvdb.com/banners/%s [Status: 400]
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] User-Agent: Medusa/0.0.1 (Linux; 4.9.49-moby; b859e09c-c0f3-11e7-a43f-0242ac110004)
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] The response returned a non-200 response while requestion url http://thetvdb.com/banners/%s. Error: HTTPError(u'400 Client Error: Bad Request for url: https://www.thetvdb.com/banners/%s',)
2017-11-05 07:07:26 WARNING  SHOWQUEUE-REFRESH :: [b16e0e5] There was an error trying to retrieve the image, aborting
2017-11-05 07:07:26 DEBUG    SHOWQUEUE-REFRESH :: [b16e0e5] No thumb is available for this episode, not creating a thumbnail
```

The logs probably ought to display what the %s is actually set to - I'd imagine the error is there's no S00 for most shows. Default behaviour prob best to lower level to INFO vs WARNING as this makes an annoying error but also to fallback to show banner when season not available? I can take a crack at this as probably simple code but don't know the preferred behaviour.


Discussion:

Resolving patch:
diff --git a/medusa/indexers/tvdbv2/tvdbv2_api.py b/medusa/indexers/tvdbv2/tvdbv2_api.py
--- a/medusa/indexers/tvdbv2/tvdbv2_api.py
+++ b/medusa/indexers/tvdbv2/tvdbv2_api.py
@@ -355,7 +355,7 @@ def _parse_episodes(self, tvdb_id, episode_data):
                 k = k.lower()
 
                 if v is not None:
-                    if k == 'filename':
+                    if v and k == 'filename':
                         v = urljoin(self.config['artwork_prefix'], v)
                     else:
                         v = self._clean_data(v)
@@ -567,7 +567,7 @@ def _get_show_data(self, sid, language):
         # get series data / add the base_url to the image urls
         for k, v in series_info['series'].items():
             if v is not None:
-                if k in ['banner', 'fanart', 'poster']:
+                if v and k in ['banner', 'fanart', 'poster']:
                     v = self.config['artwork_prefix'] % v
             self._set_show_data(sid, k, v)
 


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TypeError: integer argument expected, got float
### INFO
**Python Version**: `2.7.13 (default, Apr 11 2017, 16:05:39) [GCC 4.8.4]`
**Operating System**: `Linux-4.2.8-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@b16e0e5eb4ded727eebd2ab2cd9683ab597662f5
**Link to Log**: https://gist.github.com/28959ec35573f55afe29fc65ecbe8270
### ERROR
<pre>
2017-11-11 19:37:49 ERROR    TORNADO :: [b16e0e5] API :: 'integer argument expected, got float'
Traceback (most recent call last):
  File "/share/CACHEDEV1_DATA/.qpkg/Medusa/Medusa/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/server/api/v1/core.py#L126">medusa/server/api/v1/core.py</a>", line 126, in get
    out_dict = _call_dispatcher(args, kwargs)
  File "/share/CACHEDEV1_DATA/.qpkg/Medusa/Medusa/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/server/api/v1/core.py#L196">medusa/server/api/v1/core.py</a>", line 196, in call_dispatcher
    cur_out_dict = func(cur_args, cur_kwargs).run()  # call function and get response
  File "/share/CACHEDEV1_DATA/.qpkg/Medusa/Medusa/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/server/api/v1/core.py#L1423">medusa/server/api/v1/core.py</a>", line 1423, in run
    next_backlog = app.backlog_search_scheduler.next_run().strftime(dateFormat).decode(app.SYS_ENCODING)
  File "/share/CACHEDEV1_DATA/.qpkg/Medusa/Medusa/<a href="../blob/b16e0e5eb4ded727eebd2ab2cd9683ab597662f5/medusa/search/backlog.py#L33">medusa/search/backlog.py</a>", line 33, in next_run
    return datetime.date.fromordinal(self.action._last_backlog + self.action.cycleTime)
TypeError: integer argument expected, got float
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators


Discussion:
What did you do to trigger this error?
@medariox It can be reproduced by calling the API's `checkscheduler` command.

Resolving patch:
diff --git a/medusa/search/backlog.py b/medusa/search/backlog.py
--- a/medusa/search/backlog.py
+++ b/medusa/search/backlog.py
@@ -30,7 +30,8 @@ def next_run(self):
         if self.action._last_backlog <= 1:
             return datetime.date.today()
         else:
-            return datetime.date.fromordinal(self.action._last_backlog + self.action.cycleTime)
+            backlog_frequency_in_days = int(self.action.cycleTime)
+            return datetime.date.fromordinal(self.action._last_backlog + backlog_frequency_in_days)
 
 
 class BacklogSearcher(object):


Test patch: