Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 610414

Summary: app-portage/repoman-2.3.1: with python3.6, running repoman on dev-db/sqlite triggers DeprecationWarning: invalid escape sequence '\['
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: RepomanAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 611324    

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