D2642: util: also silence py3 warnings from codec module

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Mar 4 16:56:05 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Fixes warnings like this:
  
  +  mercurial/util.py:2446: DeprecationWarning: invalid escape sequence '\d'
  +    return codecs.escape_decode(s)[0]

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2642

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -249,6 +249,8 @@
     # silence warning emitted by passing user string to re.sub()
     warnings.filterwarnings(r'ignore', r'bad escape', DeprecationWarning,
                             r'mercurial')
+    warnings.filterwarnings(r'ignore', r'invalid escape sequence',
+                            DeprecationWarning, r'mercurial')
 
 def nouideprecwarn(msg, version, stacklevel=1):
     """Issue an python native deprecation warning



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list