truenas / py-SMART

Wrapper for smartctl (smartmontools)
GNU Lesser General Public License v2.1
79 stars 35 forks source link

Fix invalid escape sequence #68

Closed teapot9 closed 1 year ago

teapot9 commented 1 year ago

This fixes the following deprecation warning:

pySMART/device_list.py:116
  /home/yoshi/Downloads/py-SMART/pySMART/device_list.py:116: DeprecationWarning: invalid escape sequence 'S'
    '^(\S+)\s+-d\s+(\S+)').match(line).groups()
ralequi commented 1 year ago

Thank you!

Just to know... Which python version are you using? Didn't see on python 3.11

teapot9 commented 1 year ago

Looks like the warning only appears when I am running pytest and there is no cache.

You should be able to reproduce by removing any __pycache__ directory before running pytest: rm -r ./pySMART/interface/__pycache__ ./pySMART/__pycache__ ./tests/__pycache__

ralequi commented 1 year ago

Replicated

Thank you!

(wtf isn't this failing on tests!? arg!)

teapot9 commented 1 year ago

(wtf isn't this failing on tests!? arg!)

You can make pytest fail on warnings with the -Werror or -Werror::DeprecationWarning flag.

ralequi commented 1 year ago

Thanks for your idea :-)