GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-40077: Convert _csv module to use PyType_FromSpec by corona10 · Pull Request #20974 · python/cpython Conversation
|
|
FYI, macOS CI issue is not related to this PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks all of your reviews are applied and no memory leak was found!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that it's possible to convert static types to heap types if they have Py_TPFLAGS_BASETYPE, since currently there is no way to retrieve the module from such type.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| &strict)) | ||
| return NULL; | ||
|
|
||
| _csvstate *state = PyType_GetModuleState(type); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
PyType_GetModuleState() is not safe if the type has Py_TPFLAGS_BASETYPE flag, which is the case here.
Is there a way to get the defining type in tp_new?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| PyErr_Format(_csvstate_global->error_obj, "field larger than field limit (%ld)", | ||
| _csvstate_global->field_limit); | ||
| PyTypeObject *reader_type = Py_TYPE(self); | ||
| _csvstate *state = PyType_GetModuleState(reader_type); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The Reader type has Py_TPFLAGS_BASETYPE: PyType_GetModuleState() is unsafe here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return NULL; | ||
| } | ||
| self->dialect = (DialectObj *)_call_dialect(dialect, keyword_args); | ||
| _csvstate *state = get_csv_state(module); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
state can be moved at the beginning of the function, to avoid calling get_csv_state() twice.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I understand that this PR (if merged) would fix https://bugs.python.org/issue14935 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The issue is now closed via #23224. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.