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

Quote folder names in search query #216

Merged
merged 1 commit into from
Jan 11, 2019

Conversation

nicolasbock
Copy link
Contributor

When using folder names containing whitespace characters (see PR #206)
the folder part of the notmuch search query needs to be quoted.

Signed-off-by: Nicolas Bock nicolasbock@gmail.com

When using folder names containing whitespace characters (see PR afewmail#206)
the folder part of the notmuch search query needs to be quoted.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
Copy link
Collaborator

@GuillaumeSeren GuillaumeSeren left a comment

Choose a reason for hiding this comment

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

LGTM

@GuillaumeSeren
Copy link
Collaborator

Hello,
thank you for the patch 👏

@GuillaumeSeren GuillaumeSeren merged commit 1f18447 into afewmail:master Jan 11, 2019
@nicolasbock nicolasbock deleted the mail_mover branch January 11, 2019 13:11
@flokli
Copy link
Member

flokli commented Jan 15, 2019

@nicolasbock I guess this breaks when the output contains double quotes - we just enclose quotes, but not escape.

Instead of this patch, can we escape while setting main_query by calling .format using shlex.quote? This should enclose single-quotes automatically:

>>> import shlex
>>> print(shlex.quote("foo"))
foo
>>> print(shlex.quote("foo\""))
'foo"'

nicolasbock added a commit to nicolasbock/afew that referenced this pull request Jan 17, 2019
Follow on to PR afewmail#216:

In cases where the folder name contains characters that should be
quoted, use the `shlex.quote()` function to properly format the folder
name.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
@nicolasbock
Copy link
Contributor Author

@flokli Something like #218 ?

nicolasbock added a commit to nicolasbock/afew that referenced this pull request Jan 17, 2019
Follow on to PR afewmail#216:

In cases where the folder name contains characters that should be
quoted, use the `shlex.quote()` function to properly format the folder
name.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
nicolasbock added a commit to nicolasbock/afew that referenced this pull request Jan 20, 2019
Follow on to PR afewmail#216:

In cases where the folder name contains characters that should be
quoted, use the `shlex.quote()` function to properly format the folder
name.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants