Skip to content

Fix/stringbinding usage#104

Open
Ladeia wants to merge 2 commits into
ShawnDEvans:masterfrom
Ladeia:fix/stringbinding-usage
Open

Fix/stringbinding usage#104
Ladeia wants to merge 2 commits into
ShawnDEvans:masterfrom
Ladeia:fix/stringbinding-usage

Conversation

@Ladeia

@Ladeia Ladeia commented Jun 9, 2024

Copy link
Copy Markdown
Contributor

fix stringbinding command on smbmap.py file

@Ladeia Ladeia force-pushed the fix/stringbinding-usage branch from 39bdfc3 to ccec340 Compare June 9, 2024 17:44
@SukiCZ

SukiCZ commented Jun 27, 2024

Copy link
Copy Markdown

When I upgrade smbmap from apt I get a warning

  /usr/lib/python3/dist-packages/smbmap/smbmap.py:441: SyntaxWarning: invalid escape sequence '\p'
  stringbinding = 'ncacn_np:%s[\pipe\svcctl]' % remoteName

When I create a python script

# /tmp/foo.py
stringbinding = 'ncacn_np:%s[\pipe\svcctl]' % 'remoteName'

and check it with python3 -Wd /tmp/foo.py I'm able to reproduce the SyntaxWarning

/tmp/foo.py:2: SyntaxWarning: invalid escape sequence '\p'
  stringbinding = 'ncacn_np:%s[\pipe\svcctl]' % 'remoteName'

I think that might be the motivation of this change, however it changes the meaning of that string.

To resolve this, I would suggest to use raw-string (with r prefix) and change the line to

stringbinding = r'ncacn_np:%s[\pipe\svcctl]' % remoteName

Note: I'm not a contributor, I just want my apt upgrade to be happy 😊

@Ladeia

Ladeia commented Jun 27, 2024

Copy link
Copy Markdown
Contributor Author

Thanks @SukiCZ. I applied your suggestion in PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants