diff --git a/.github/workflows/node-gyp.yml b/.github/workflows/node-gyp.yml index 887705c4..855ecbd7 100644 --- a/.github/workflows/node-gyp.yml +++ b/.github/workflows/node-gyp.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python: ["3.7", "3.10"] + python: ["3.8", "3.x"] runs-on: ${{ matrix.os }} steps: diff --git a/pylib/gyp/easy_xml.py b/pylib/gyp/easy_xml.py index bda1a474..55d17ade 100644 --- a/pylib/gyp/easy_xml.py +++ b/pylib/gyp/easy_xml.py @@ -121,7 +121,11 @@ def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, if win32 and os.linesep != "\r\n": xml_string = xml_string.replace("\n", "\r\n") - default_encoding = locale.getdefaultlocale()[1] + if sys.version_info >= (3, 11): + default_encoding = locale.getencoding() + else: + default_encoding = locale.getdefaultlocale()[1] + if default_encoding and default_encoding.upper() != encoding.upper(): xml_string = xml_string.encode(encoding) diff --git a/pyproject.toml b/pyproject.toml index c08f3481..463c6bf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,6 +94,7 @@ ignore = [ "PLW0603", "PLW2901", "RUF005", + "RUF012", "UP031", ] line-length = 88