【发布时间】:2019-02-19 12:04:15
【问题描述】:
我在 Python 中收到很多这样的警告:
DeprecationWarning: invalid escape sequence \A
orcid_regex = '\A[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]\Z'
DeprecationWarning: invalid escape sequence \/
AUTH_TOKEN_PATH_PATTERN = '^\/api\/groups'
DeprecationWarning: invalid escape sequence \
"""
DeprecationWarning: invalid escape sequence \.
DOI_PATTERN = re.compile('(https?://(dx\.)?doi\.org/)?10\.[0-9]{4,}[.0-9]*/.*')
<unknown>:20: DeprecationWarning: invalid escape sequence \(
<unknown>:21: DeprecationWarning: invalid escape sequence \(
它们是什么意思?我该如何解决?
【问题讨论】:
-
使用 Python 3.8-dev 这将为您提供
SyntaxWarning而不是DeprecationWarning并且适用相同的解决方案。
标签: python python-3.x python-3.6