Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 140 forks source link

Future warning - unicode nested set #376

Closed msoucy closed 4 years ago

msoucy commented 5 years ago
Python 3.7.1 (default, Nov  5 2018, 14:07:04) 
[GCC 8.2.1 20181011 (Red Hat 8.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from scss import Compiler
/home/msoucy/Code/project/.venv/lib/python3.7/site-packages/scss/selector.py:54: FutureWarning: Possible nested set at position 329
  ''', re.VERBOSE | re.MULTILINE)

The fix is introduced in the 3.7 release notes, though I wasn't exactly sure which part of that large regex was the problematic area.

ginomempin commented 5 years ago

I got the error to go away by escaping one of the [ in selector.py:

BEFORE:

    # Square brackets are attribute tests
    # TODO: this doesn't handle ] within a string
    | [[] .+? []]

AFTER (escape the 2nd [):

    # Square brackets are attribute tests
    # TODO: this doesn't handle ] within a string
    | [\[] .+? []]

Python 3.7.2 pyScss==1.3.5

ghost commented 5 years ago

you can also just write

| \[ .+? \]

@Kronuz It is four months later, how ´bout updating the PyPI package?

lamby commented 5 years ago

@Kronuz It is four months later, how ´bout updating the PyPI package?

Ping on this? :)

coridrew commented 5 years ago

This is blocking me as well

jmduke commented 5 years ago

Added a PR to fix this:

https://github.com/Kronuz/pyScss/pull/381

MolotovCherry commented 5 years ago

I had to fix this manually. Oh well, thanks for the fix @jmduke