Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610414 - app-portage/repoman-2.3.1: with python3.6, running repoman on dev-db/sqlite triggers DeprecationWarning: invalid escape sequence '\['
Summary: app-portage/repoman-2.3.1: with python3.6, running repoman on dev-db/sqlite t...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 611324
  Show dependency tree
 
Reported: 2017-02-21 22:09 UTC by Zac Medico
Modified: 2017-03-16 00:09 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-02-21 22:09:48 UTC
This warning is emitted from the unicode_escape codec, triggered by a sed expression in the ebuilds containing "\[":

repoman/modules/scan/ebuild/checks.py:930: DeprecationWarning: invalid escape sequence '\['

I think we can replace the unicode_escape usage with a regular expression that matches an odd number of trailing backslashes.
Comment 1 Zac Medico gentoo-dev 2017-02-21 23:55:44 UTC
This seems to work:

def has_line_continuation(line):
    m = re.search(r'(\\)*$', line)
    return False if m is None else operator.sub(*m.span()) % 2 == 1
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2017-03-16 00:09:18 UTC
Released in repoman-2.3.2