Closed Prady04 closed 5 months ago
I isolated the code below. It is working on Linux. I havent encountered this error on EOD2. I'll run it on Windows and get back.
Can you confirm your Python version?
from datetime import datetime
from zoneinfo import ZoneInfo
import tzlocal
tz_local = tzlocal.get_localzone()
tz_IN = ZoneInfo("Asia/Kolkata")
curTime = datetime.now(tz_IN)
local_time = curTime.replace(hour=19, minute=0).astimezone(tz_local)
t_str = local_time.strftime("%-I:%M%p")
print(t_str)
I reproduced the error in Windows. Seems like a Windows specific issue. The -
character to removed the leading 0 is not recognized in Python on Windows.
I will post a fix for this. It would seem like all my future updates need to be tested on Windows first.
Thanks @Prady04
I have fixed the issue in all branches
Tested on Windows and all working well. Closing this issue.
Error log CRITICAL: Unhandled exception Traceback (most recent call last): File "D:\python\eod2-main\src\init.py", line 58, in
if not defs.dates.nextDate():
^^^^^^^^^^^^^^^^^^^^^
File "D:\python\eod2-main\src\defs\defs.py", line 95, in nextDate
t_str = local_time.strftime("%-I:%M%p") # 7:00PM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Invalid format string
CRITICAL: Unhandled exception
Traceback (most recent call last):
File "D:\python\eod2-main\src\init.py", line 58, in
if not defs.dates.nextDate():
^^^^^^^^^^^^^^^^^^^^^
File "D:\python\eod2-main\src\defs\defs.py", line 95, in nextDate
t_str = local_time.strftime("%-I:%M%p") # 7:00PM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^