Skip to content

DeprecationWarning: invalid escape sequence #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pabs3 opened this issue Jan 9, 2022 · 4 comments
Closed

DeprecationWarning: invalid escape sequence #417

pabs3 opened this issue Jan 9, 2022 · 4 comments
Assignees
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@pabs3
Copy link

pabs3 commented Jan 9, 2022

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
@jodoglevy jodoglevy added the SDK Issue pertains to the SDK itself and not specific to any service label Jan 12, 2022
@waruwaruwaru
Copy link

waruwaruwaru commented Jan 20, 2022

Hi @pabs3, what python version and what command did you run to test the oci-python-sdk? I tried to reproduce it on my end but I was not able to see the warning.

@pabs3
Copy link
Author

pabs3 commented Jan 20, 2022 via email

@waruwaruwaru waruwaruwaru self-assigned this Jan 20, 2022
@waruwaruwaru
Copy link

Thank you, I will look more into this issue.

@waruwaruwaru
Copy link

@pabs3, the latest SDK should now have this issue fixed. Please feel free to re-open the issue if another problem comes up. Thank you for contributing to OCI Python SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

3 participants