[Paul Wise]
>    Setting up isenkram-cli (0.56) ...
>    /usr/lib/python3/dist-packages/isenkram/usb.py:43: SyntaxWarning: invalid 
> escape sequence '\s'
>      m = re.match('^([0-9a-f]{4})\s+(\S.*)$', line)
>    /usr/lib/python3/dist-packages/isenkram/usb.py:48: SyntaxWarning: invalid 
> escape sequence '\s'
>      m = re.match('^\t([0-9a-f]{4})\s+(\S.*)$', line)

This is rather strange, as \s is described in
<URL: https://docs.python.org/3/library/re.html >:


  \s
    For Unicode (str) patterns:
        Matches Unicode whitespace characters (which includes
        [ \t\n\r\f\v], and also many other characters, for example the
        non-breaking spaces mandated by typography rules in many
        languages).
    

        Matches [ \t\n\r\f\v] if the ASCII flag is used.
    For 8-bit (bytes) patterns:

        Matches characters considered whitespace in the ASCII character
        set; this is equivalent to [ \t\n\r\f\v]. 


    Matches any character which is not a whitespace character. This is
    the opposite of \s. 

    Matches [^ \t\n\r\f\v] if the ASCII flag is used.

Any idea what happend with \s in python 3.12?  Perhaps the problem is
a missing 'r' in front of the quotes?

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to