Skip to content
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

DeprecationWarning: invalid escape sequence #34

Closed
tony opened this issue May 6, 2023 · 3 comments
Closed

DeprecationWarning: invalid escape sequence #34

tony opened this issue May 6, 2023 · 3 comments

Comments

@tony
Copy link

tony commented May 6, 2023

This raises in pytest as of 1.1.5, on Python 3.10:

~/.cache/.../lib/python3.10/site-packages/zhon/pinyin.py:40
  ~/.cache/.../lib/python3.10/site-packages/zhon/pinyin.py:40: DeprecationWarning: invalid escape sequence '\]'
    non_stops = """"#$%&'()*+,-/:;<=>@[\]^_`{|}~"""

~/.cache/.../lib/python3.10/site-packages/zhon/pinyin.py:153
  ~/.cache/...0/lib/python3.10/site-packages/zhon/pinyin.py:153: DeprecationWarning: invalid escape sequence '\]'
    """[%(stops)s]['"\]\}\)]*"""

~/.cache/.../lib/python3.10/site-packages/zhon/pinyin.py:154
  ~/.cache/.../lib/python3.10/site-packages/zhon/pinyin.py:154: DeprecationWarning: invalid escape sequence '\-'
    ) % {'word': word, 'non_stops': non_stops.replace('-', '\-'),

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
tony added a commit to cihai/unihan-etl that referenced this issue May 27, 2023
unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:40
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:40: DeprecationWarning: invalid escape sequence '\]'
    non_stops = """"#$%&'()*+,-/:;<=>@[\]^_`{|}~"""

unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:153
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:153: DeprecationWarning: invalid escape sequence '\]'
    """[%(stops)s]['"\]\}\)]*"""

unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:154
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:154: DeprecationWarning: invalid escape sequence '\-'
    ) % {'word': word, 'non_stops': non_stops.replace('-', '\-'),

See also: tsroten/zhon#34
tsroten added a commit that referenced this issue Jun 24, 2023
* origin/v2.0.0_release:
  Bump version and update changelog for version 2.0.0
  Fixes #20. Add doc note aobut combining diactrical marks.
  add fullwidth full stop. fixes #30
  remove python2 support
  fix copy/paste error and update docs link for pypi
  update docs links and status images
  fix remaining flake8 warnings. Also addresses #34
  run black on all files
  formatting fixes from black
  Switch to using hatch for development and upgrade to latest Sphinx for documentation.
  Bump wheel from 0.29.0 to 0.38.1
  Update __init__.py
  Update __init__.py
  Use new string format in docs.
  Add 3.6 and remove 3.3 from setup.py.
  Lint fixes.
  Add tests and Makefile to manifest.
  Move tests to separate directory.
  Update travis/tox tests.
  Update requirements file.
@tsroten
Copy link
Owner

tsroten commented Jun 24, 2023

@tony Thanks for reporting this! This should be fixed as of v2.0.0.

@tsroten tsroten closed this as completed Jun 24, 2023
@tony
Copy link
Author

tony commented Jun 24, 2023

@tsroten Thank you! Taking a closer look now

@tony
Copy link
Author

tony commented Jun 24, 2023

@tsroten Live in https://github.com/cihai/unihan-etl, https://github.com/cihai/cihai

tony added a commit to cihai/unihan-etl that referenced this issue Sep 2, 2023
unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:40
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:40: DeprecationWarning: invalid escape sequence '\]'
    non_stops = """"#$%&'()*+,-/:;<=>@[\]^_`{|}~"""

unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:153
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:153: DeprecationWarning: invalid escape sequence '\]'
    """[%(stops)s]['"\]\}\)]*"""

unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:154
  unihan-etl-2uCVp1pF-py3.10/lib/python3.10/site-packages/zhon/pinyin.py:154: DeprecationWarning: invalid escape sequence '\-'
    ) % {'word': word, 'non_stops': non_stops.replace('-', '\-'),

See also: tsroten/zhon#34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants