You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing mount output with spaces in filenames (such as mounts to samba shares) fails with AttributeError: 'NoneType' object has no attribute 'groupdict'.
Example code that fails:
import jc
data = """
//10.100.1.237/Bilder und Videos on /mnt/smb/thw/media type cifs (rw,nosuid,nodev,relatime,vers=2.1,cache=strict,username=iweinmann,uid=1000,noforceuid,gid=1000,noforcegid,addr=10.100.1.237,file_mode=0755,dir_mode=0755,iocharset=utf8,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1,user=ingo)
"""
jc.parse(parser_mod_name="mount", data=data)
Will lead to error:
File ~/src/raspberrypi/xxxxx/.venv/lib/python3.9/site-packages/jc/parsers/mount.py:150, in _linux_parse(data)
139 pattern = re.compile(
140 r'''
141 (?P<filesystem>\S+)\s+
(...)
146 \((?P<options>.*?)\)\s*''',
147 re.VERBOSE)
149 match = pattern.match(entry)
--> 150 groups = match.groupdict()
152 if groups:
153 output_line['filesystem'] = groups["filesystem"]
AttributeError: 'NoneType' object has no attribute 'groupdict
The text was updated successfully, but these errors were encountered:
Parsing mount output with spaces in filenames (such as mounts to samba shares) fails with
AttributeError: 'NoneType' object has no attribute 'groupdict'
.Example code that fails:
Will lead to error:
The text was updated successfully, but these errors were encountered: