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

offlineimap.conf: use raw strings in regex examples #206

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lucrocha
Copy link

Newer pythons are strict on the escape sequences allowed in normal strings, which can cause issues with regular expressions as most of them do include escape sequences that are not allowed. In those cases, the process will exit with the confusing warning:
<string>:1: SyntaxWarning: invalid escape sequence '\.'

To help prevent such cases, have the sample configuration use raw strings when using regular expressions.

This PR

Add character x [x].

  • I've read the DCO.
  • I've read the Coding Guidelines
  • The relevant informations about the changes stands in the commit message, not here in the message of the pull request.
  • Code changes follow the style of the files they change.
  • Code is tested (provide details).

Additional information

Tested with my own configuration which uses regular expressions with \. escaped.

Newer pythons are strict on the escape sequences allowed in normal
strings, which can cause issues with regular expressions as most of them
do include escape sequences that are not allowed. In those cases, the
process will exit with the confusing warning:
  <string>:1: SyntaxWarning: invalid escape sequence '\.'

To help prevent such cases, have the sample configuration use raw
strings when using regular expressions.

Signed-off-by: Luciano Rocha <[email protected]>
@etbuira
Copy link

etbuira commented Sep 13, 2024

Thanks, applied in https://github.com/IMAPMirror/imapmirror

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