diff --git a/CHANGES.md b/CHANGES.md index 41429a6..2a68bad 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -104,6 +104,11 @@ * Change API response fieldname `global_exclude_require` to `global exclude require` in sg.listignorewords endpoint +### 0.21.45 (2020-09-11 16:25:00 UTC) + +* Fix autoProcessTV.py to use `config.readfp` under py2 as `config.read_file` is py3.x+. + + ### 0.21.44 (2020-09-11 10:10:00 UTC) * Fix thesubdb subtitle service under py3 diff --git a/autoProcessTV/autoProcessTV.py b/autoProcessTV/autoProcessTV.py index 8e2ede1..2aecc53 100755 --- a/autoProcessTV/autoProcessTV.py +++ b/autoProcessTV/autoProcessTV.py @@ -76,7 +76,14 @@ def process_files(dir_to_process, org_nzb_name=None, status=None): print('Loading config from %s\n' % config_filename) with open(config_filename, 'r') as fp: - config.read_file(fp) + """ Under py3, `config.readfp` is flagged deprecated with advice to use read_file instead. + However, py2 doesn't have `read_file`, so a little defensive coding is added here + """ + if callable(getattr(config, 'read_file', None)): + config.read_file(fp) + else: + # noinspection PyDeprecation + config.readfp(fp) # Replace default values with config_file values host = config.get('SickBeard', 'host')