Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-71587: Drop local reference cache to _strptime module in _datetime#120224
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2b82d53085e37ce65bec36bb01418a0ea7b39a425933e096612fad4c341561bba2d0a5File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fix crash in C version of :meth:`datetime.datetime.strptime` when called again | ||
| on the restarted interpreter. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5514,19 +5514,19 @@ datetime_utcfromtimestamp(PyObject *cls, PyObject *args) | ||
| static PyObject * | ||
| datetime_strptime(PyObject *cls, PyObject *args) | ||
| { | ||
| static PyObject *module = NULL; | ||
| PyObject *string, *format; | ||
| PyObject *string, *format, *result; | ||
| if (!PyArg_ParseTuple(args, "UU:strptime", &string, &format)) | ||
| return NULL; | ||
| PyObject *module = PyImport_Import(&_Py_ID(_strptime)); | ||
| if (module == NULL) { | ||
| module = PyImport_ImportModule("_strptime"); | ||
neonene marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| if (module == NULL) | ||
| return NULL; | ||
| return NULL; | ||
| } | ||
| return PyObject_CallMethodObjArgs(module, &_Py_ID(_strptime_datetime), | ||
| cls, string, format, NULL); | ||
| result = PyObject_CallMethodObjArgs(module, &_Py_ID(_strptime_datetime), | ||
| cls, string, format, NULL); | ||
| Py_DECREF(module); | ||
| return result; | ||
| } | ||
| /* Return new datetime from date/datetime and time arguments. */ | ||
Uh oh!
There was an error while loading. Please reload this page.