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

subject search chinese not support? #560

Open
pql-eternally opened this issue Nov 9, 2023 · 3 comments · May be fixed by #569
Open

subject search chinese not support? #560

pql-eternally opened this issue Nov 9, 2023 · 3 comments · May be fixed by #569
Labels

Comments

@pql-eternally
Copy link

我使用IMAPClient版本是3.0.0,我使用下面按中文搜索主题时不生效且底层会报错。
client.search(['SUBJECT', '每日信用管家'], charset='UTF-8')
image

@zhangjiale2020
Copy link

I also encountered the same problem

image

python3.8/site-packages/imapclient/imapclient.py

@zhangjiale2020
Copy link

server.search(['SUBJECT', '中国乡村'], charset='UTF-8')

@mjs
Copy link
Owner

mjs commented Nov 25, 2023

This looks like a bug in _send_literal. It should be calling the has_capability method instead of assuming cached_capabilities has been populated.

A workaround would be to call the capabilities method after login. That will ensure the cached capabilities are set.

I will work on a proper fix.

@mjs mjs added the bug label Nov 25, 2023
mjs pushed a commit that referenced this issue Dec 1, 2023
_send_literal was assuming that _cached_capabilites was populated when
checking for LITERAL+ but this isn't guaranteed. has_capability is now
used to check for LITERAL+. This will populate the capabilities cache if
it hasn't been already.

Fixes #560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants