Skip to content

Commit

Permalink
Add python version 3.12 in place of 3.7 in CI + patch regexp to avoid…
Browse files Browse the repository at this point in the history
… gitlab warning
  • Loading branch information
dvacca-onfido committed Oct 23, 2024
1 parent 6082852 commit 4bce419
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
env:
POETRY_CACHE_DIR: ~/.cache/pypoetry-${{ matrix.python-version }}

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude onfido
- name: Test with pytest
if: ${{ matrix.python-version == '3.11' &&
if: ${{ matrix.python-version == '3.12' &&
github.repository_owner == 'onfido' }}
run: |
poetry run pytest --show-capture=no
Expand Down
2 changes: 1 addition & 1 deletion onfido/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti
data = json.loads(response_text)
except ValueError:
data = response_text
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
elif re.match(r'^application/(json|[\w!#$&.+-^]+\+json)\s*(;|$)', content_type, re.IGNORECASE):

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium

Suspicious character range that overlaps with \\w in the same character class, and is equivalent to \[+,\\-.\\/0-9:;<=>?@A-Z\\\[\\\\\\\]^\].
if response_text == "":
data = ""
else:
Expand Down

0 comments on commit 4bce419

Please sign in to comment.