RPA.Email.Exchange Wait For Message Error

I get this error when I Wait for Message Error connecting to Exchange → in ‘EWSTimeZone’ object has no
attribute ‘localize’

Line 544 in the Exchange.py seems to be the problem
tz = EWSTimeZone.localzone()
right_now = tz.localize(EWSDateTime.now()) # pylint: disable=E1101
while time.time() < end_time:
List Message is working for me, so there is no connectivity issue . Any pointers to troubleshoot, highly appreciated .


Hi @prad,

Thank you for the message and welcome! Will you please pass the relevant portion of your code as well. I would like to see what arguments you are passing and how you are using the keyword.


Thanks Tim for having a look, I have hacked it for now by removing ‘datetime_received__gte=right_now’ from line 547 of Exchange.py . I will enable it back and get you the error and the other info requested for


I Imported the library like this
RPA.Email.Exchange WITH NAME MS365

In Testcase , I send a mail and then call the keyword ‘Download Ms365 Mails’ . I can see the send mail in outlook with the correct attachment and subject.
*** Keywords ***
Download Ms365 Mails
[Arguments] ${subject}
Log ${subject}
${status} @{emails}= Run Keyword And Ignore Error
… MS365.Wait For Message criterion=subject:${subject}
… timeout=60 interval=1 contains=True

I have created an issue of this into rpaframework repository

Thanks Mika, Tim for looking into this. There is also a cosmetic bug in the Keyword documentation for ’ ‘Save Attachments’ . Please let me know if this is not the correct place to raise this as I am new to the forum

Thank you for reporting that @prad - I will fix that for the next release.

@prad about the exception message with Wait For Message - I think the problem originates from the fact that you are using Python 3.10 and that is too new Python version for some of the packages that rpaframework contains. In this particular case problem comes exchangelib dependency.

Can you share your conda.yaml ? I would recommend changing Python version. Default version in our template conda.yaml is 3.7.5, but some stable 3.8 version (like 3.8.7) should be fine also. From 3.9 onwards there might be issues with some of the packages.