Skip to content

DeprecationWarning: invalid escape sequence #417

@pabs3

Description

@pabs3

When running the tests I get a few DeprecationWarning messages:

oci/base_client.py:43: DeprecationWarning: invalid escape sequence \(
    DICT_VALUE_TYPE_REGEX = re.compile('dict\(str, (.+?)\)$')  # noqa: W605

oci/base_client.py:44: DeprecationWarning: invalid escape sequence \[
    LIST_ITEM_TYPE_REGEX = re.compile('list\[(.+?)\]$')  # noqa: W605

base_client.py:825: DeprecationWarning: invalid escape sequence \[
    sub_kls = re.match('list\[(.*)\]', cls).group(1)  # noqa: W605

oci/base_client.py:830: DeprecationWarning: invalid escape sequence \(
    sub_kls = re.match('dict\(([^,]*), (.*)\)', cls).group(2)  # noqa: W605

Since these are regexes the right thing to do use to use raw strings like this:

    DICT_VALUE_TYPE_REGEX = re.compile(r'dict\(str, (.+?)\)$')  # noqa: W605

Metadata

Metadata

Assignees

Labels

SDKIssue pertains to the SDK itself and not specific to any service

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions