Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/stringbinding usage #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ladeia
Copy link
Contributor

@Ladeia Ladeia commented Jun 9, 2024

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
Copy link

SukiCZ commented Jun 27, 2024

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
Copy link
Contributor Author

Ladeia commented Jun 27, 2024

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