You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code runs correctly the first time but then complains that datetime.strptime is of type NoneType the second time the code is run within the same browser session.
"""Demonstrates WASM issue with datetime.strptime."""fromdatetimeimportdatetimeprint(datetime.strptime("2023-01-13", "%Y-%m-%d"))
print(datetime.strptime("2023-01-13", "%Y-%m-%d"))
Note that running datetime.strptime twice doesn't cause an issue. The issue seems to be due to exiting Python and then re-entering it. For example in an interactive session, one would need to call exit() and then start the interactive session again in the same browser window (example here).
>>> from datetime import datetime
>>> datetime.strptime("2023", "%Y")
datetime.datetime(2023, 1, 1, 0, 0)
>>> exit() # The REPL is automatically re-entered after this
>>> from datetime import datetime
>>> datetime.strptime("2023", "%Y")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
Your environment
CPython 3.11.0 compiled to Emscripten for the browser.
The text was updated successfully, but these errors were encountered:
Bug report
The following code runs correctly the first time but then complains that
datetime.strptime
is of typeNoneType
the second time the code is run within the same browser session.Live example here: https://pym.dev/p/2g6wn/
Note that running
datetime.strptime
twice doesn't cause an issue. The issue seems to be due to exiting Python and then re-entering it. For example in an interactive session, one would need to callexit()
and then start the interactive session again in the same browser window (example here).Your environment
CPython 3.11.0 compiled to Emscripten for the browser.
The text was updated successfully, but these errors were encountered: