Skip to content

SyntaxWarning/DeprecatedWarnings invalid escape sequence #387

@Taragolis

Description

@Taragolis

At least latest version oss2 raise this warnings, but I guess it might affect older ones

oss2/api.py:497: DeprecationWarning: invalid escape sequence \&
oss2/utils.py:156: DeprecationWarning: invalid escape sequence \w

r'http://your-bucket.oss-cn-hangzhou.aliyuncs.com/logo.jpg?OSSAccessKeyId=YourAccessKeyId\&Expires=1447178011&Signature=UJfeJgvcypWq6Q%2Bm3IJcSHbvSak%3D'

pattern = '^([a-zA-Z]+://)?[\w.-]+(:\d+)?$'

Since Python 3.12 this kind of warning become SyntaxWarning, see: python/cpython#98401, which are not ignored by default as DeprecatedWarnings it would be nice if regexp/docstrings will wrap into the raw strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions