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-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized by orenmn · Pull Request #3958 · python/cpython Conversation
| ||||||||||||||||||||||||||||||||||||
|
I wonder whether we should add However, i don't know how to produce code that would create a partially initialized |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args) | ||
| { | ||
| if (self->connection == NULL) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Style nit: I think !foo is more common than foo == NULL in sqlite3 codebase. It would be nice to keep styling consistent within the module.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,2 @@ | |||
| Prevent a crash in `sqlite3.Cursor.close()` in case the `Cursor` object is | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please use double backticks (``). I tried to explain why single backticks shouldn't be used at #3925 (comment)
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 am not familiar with Sphinx, but i trust you are :)
So maybe https://devguide.python.org/committing/#what-s-new-and-news-entries should also recommend double backticks?
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.
Yeah, I wasn't aware of that example in the devguide. I will update it, thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| cur = Cursor(con) | ||
| with self.assertRaises(sqlite.ProgrammingError): | ||
| cur.execute("select 4+5").fetchall() | ||
| self.assertRaises(sqlite.ProgrammingError, cur.close) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ProgrammingError is raised by a lot of things so I wonder if we should add a test for the exception message to make it more future-proof.
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.
All right. Should i also change the assertRaises() that was already in CheckCursorConstructorCallCheck()?
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'd say let's do it only for new additions to the test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@berkerpeksag What do you think about #3958 (comment)? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree with you. There is no need to add additional code for hypothetical use cases. We can change it later if we find a way to create a partially initialized Cursor object. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The author took comments in account.
…or object is uninitialized (pythonGH-3958) (cherry picked from commit edb13ae)
|
GH-4303 is a backport of this pull request to the 3.6 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…or object is uninitialized (python#3958)
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.