Skip to content

SyntaxWarning: invalid escape sequence '\s' #109

@simone80an

Description

@simone80an

I have latest Rundeck OSS 5.8.0 running in a Windows Server 2019 VM, Python version installed 3.13.1 and latest py-winrm-plugin v.2.1.3.

When i execute a Powershell script i made i get SyntaxWarning: invalid escape sequence '\s' in the output.

The script:

if (Get-Service -Name "@option.servizio@") {
$arrService = Get-Service -Name "@option.servizio@"
Restart-Service -Name "@option.servizio@"
write-host 'Restarting service @option.servizio@'

Start-Sleep -seconds 10

$arrService.Refresh()

if ($arrService.Status -eq 'Running')
{
    Write-Host '@option.servizio@ is now running'
} else {
    Write-Host '@option.servizio@ is stopped, notifying...'
    exit 1
}

} else {
    Write-Host "@option.servizio@ service doesn't exists."
}

the option servizio has the following list of allowed values: NETA Schedulatore Amministratore Service,NETABollengWrapperService,Neta Etl Service,NETA Reports Service,NETA OutputFile Service

The output:

C:\rundeck\libext\cache\py-winrm-plugin-2.1.3\common.py:35: SyntaxWarning: invalid escape sequence '\s'
regexpMultipleAbsolutePath = re.compile(''[a-zA-Z]:\\.\s[a-zA-Z]:\\.') #at least two absolute paths
C:\rundeck\libext\cache\py-winrm-plugin-2.1.3\common.py:39: SyntaxWarning: invalid escape sequence '\s'
regexpPathAndOption = re.compile(''[a-zA-Z]:\\.\s/.+')
C:\rundeck\libext\cache\py-winrm-plugin-2.1.3\common.py:43: SyntaxWarning: invalid escape sequence '\s'
regexpPathAndOptionUnix = re.compile(''[a-zA-Z]:\\.
\s-.+')
C:\rundeck\libext\cache\py-winrm-plugin-2.1.3\common.py:47: SyntaxWarning: invalid escape sequence '\s'
regexPathRequireQuotes = re.compile(''[a-zA-Z]:\\.*\s')
Riavvio servizio NETABollengWrapperService
NETABollengWrapperService è ora in esecuzione

However the job complete OK and the script does what i expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions