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

integration-test: Fix invalid escaping #1165

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

tbzatek
Copy link
Member

@tbzatek tbzatek commented Aug 7, 2023

Python 3.12 complains:
integration-test:401: SyntaxWarning: invalid escape sequence '$'
subst_re = re.compile('${([a-zA-Z_]+)}')
integration-test:1047: SyntaxWarning: invalid escape sequence '\m'
l = 'n"a\m\"e' + fs_type
integration-test:1053: SyntaxWarning: invalid escape sequence '\m'
l = 'n"a\m\"exft'

@tbzatek
Copy link
Member Author

tbzatek commented Aug 7, 2023

Not sure what to replace the \m with...

Copy link
Member

@vojtechtrefny vojtechtrefny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use raw strings (prefix the string with r'...') instead of escaping.

@tbzatek
Copy link
Member Author

tbzatek commented Aug 7, 2023

I think it would be better to use raw strings (prefix the string with r'...') instead of escaping.

Something like this?

Copy link
Member

@vojtechtrefny vojtechtrefny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you.

@vojtechtrefny
Copy link
Member

Looks like there are two more instances of this in the dbus tests:

/home/jenkins/workspace/udisks-pr/arch/x86_64/distro/f_rawhide/type/udisks/src/tests/dbus-tests/test_30_iscsi.py:167: SyntaxWarning: invalid escape sequence '\('
  msg = 'Login failed: initiator reported error \(24 - iSCSI login failed due to authorization failure\)'
/home/jenkins/workspace/udisks-pr/arch/x86_64/distro/f_rawhide/type/udisks/src/tests/dbus-tests/test_80_filesystem.py:485: SyntaxWarning: invalid escape sequence '\('
  _ret, out = self.run_command('mount | grep %s | sed "s/.*(\(.*\))/\\1/"' % block_fs_dev)

Python 3.12 complains:
  integration-test:401: SyntaxWarning: invalid escape sequence '\$'
    subst_re = re.compile('\${([a-zA-Z_]+)}')
  integration-test:1047: SyntaxWarning: invalid escape sequence '\m'
    l = 'n"a\m\\"e' + fs_type
  integration-test:1053: SyntaxWarning: invalid escape sequence '\m'
    l = 'n"a\m\\"exft'
@tbzatek
Copy link
Member Author

tbzatek commented Aug 7, 2023

Looks like there are two more instances of this in the dbus tests:

Good catch, fixed as well.

@tbzatek tbzatek merged commit 8fa2d2b into storaged-project:master Aug 8, 2023
8 checks passed
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