From 0a6c9adec6702c7fc392900f6dc6b2aa359f3227 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Fri, 8 Dec 2023 14:55:24 -0500 Subject: [PATCH] support for python 3.12 (#1019) * add support for python 3.12 python3.12 removed `readfp()`, recommended to use `read_file()` instead * Add versions 3.10 through 3.12 to test matrix * CI: fix - avoid decimal rounding - pull back 3.11 and 3.12 since we still have some issues to work through --------- Co-authored-by: ryneeverett --- .github/workflows/bugwarrior.yml | 4 ++-- bugwarrior/config/load.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bugwarrior.yml b/.github/workflows/bugwarrior.yml index 71355160..f69ae2f2 100644 --- a/.github/workflows/bugwarrior.yml +++ b/.github/workflows/bugwarrior.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 5 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] jira-version: [1.0.10, 2.0.0] steps: - name: Checkout code @@ -50,7 +50,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] jira-version: [1.0.10, 2.0.0] architecture: [aarch64, ppc64le] diff --git a/bugwarrior/config/load.py b/bugwarrior/config/load.py index 5abe50da..98cf07e7 100644 --- a/bugwarrior/config/load.py +++ b/bugwarrior/config/load.py @@ -70,7 +70,8 @@ def parse_file(configpath: str) -> dict: config = tomllib.load(f) else: rawconfig = BugwarriorConfigParser() - rawconfig.readfp(codecs.open(configpath, "r", "utf-8",)) + with codecs.open(configpath, "r", "utf-8",) as buff: + rawconfig.read_file(buff) config = {} for section in rawconfig.sections(): if section in ['hooks', 'notifications']: