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

No timezone in key UTC #897

Closed
homer0825 opened this issue Apr 20, 2021 · 6 comments
Closed

No timezone in key UTC #897

homer0825 opened this issue Apr 20, 2021 · 6 comments

Comments

@homer0825
Copy link

homer0825 commented Apr 20, 2021

First of all, Thank you for creating a very wonderful and useful package. I am very new to python and just discovering it's capabilities.

I am using program to send a simple email. program runs correctly using pycharm and i am able to receive it but when I convert it to EXE and run it, I am getting an error - No timezone found with key UTC. Any suggestions? I apologize in advance if this has been answered already but tried searching and i am unable to find the solution

@ecederstrand
Copy link
Owner

Thanks for the kind words! I'm glad you like exchangelib.

Can you please post the full stack trace you get when you run the exe file?

@homer0825
Copy link
Author

HI, Very new at this.
Screenshot 2021-04-21 074513
Screenshot 2021-04-21 074543
Screenshot 2021-04-21 074602

Here is the stack trace i get in process explorer when i run the exe

ntoskrnl.exe!KeSynchronizeExecution+0x5b46
ntoskrnl.exe!KeWaitForSingleObject+0x1c2d
ntoskrnl.exe!KeWaitForSingleObject+0xab4
ntoskrnl.exe!KeWaitForSingleObject+0x255
ntoskrnl.exe!ExTryQueueWorkItem+0x1407
ntoskrnl.exe!KeWaitForSingleObject+0x3828
ntoskrnl.exe!KeWaitForSingleObject+0x1cc8
ntoskrnl.exe!KeWaitForSingleObject+0xab4
ntoskrnl.exe!KeWaitForSingleObject+0x255
ntoskrnl.exe!NtWaitForSingleObject+0x10b
ntoskrnl.exe!setjmpex+0x7bf5
ntdll.dll!NtWaitForSingleObject+0x14
KERNELBASE.dll!WaitForSingleObjectEx+0x93
test email.exe+0x53ef
test email.exe+0x30d8
test email.exe+0x903e
KERNEL32.DLL!BaseThreadInitThunk+0x14
ntdll.dll!RtlUserThreadStart+0x21

@ecederstrand
Copy link
Owner

ecederstrand commented Apr 21, 2021

That's a problem coming from the Python zoneinfo package. It doesn't look like it's specific to exchangelib. You would probably get the same if your exe file just contained:

from zoneinfo import ZoneInfo
utc = ZoneInfo('UTC')

I have no idea what the problem could be, unfortunately. Maybe your Windows system is missing timezone information, or maybe Python doesn't have access to the timezone information when run as an exe.

@ecederstrand
Copy link
Owner

Actually, looking at e.g. https://realpython.com/python39-new-features/#accessing-time-zones it looks like the tzdata package, or the data installed by the tzdata package, is missing in the exe file. At least that gives the No time zone found with key error you see.

I haven't worked with packaging to exe before, so I don't know how to solve this problem.

@homer0825
Copy link
Author

Understood. Thank you for pointing me in the right direction. I will let you know just in case i find out more.

@ecederstrand
Copy link
Owner

@ecederstrand ecederstrand changed the title No timzone in key UTC No timezone in key UTC May 28, 2021
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

No branches or pull requests

2 participants