[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-10 Thread STINNER Victor

STINNER Victor  added the comment:

Oren Milman: thanks for your contribution! I merged your PR.

I don't consider that such corner case requires to backport the change to 
Python 2.7 and 3.6.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-10 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 93c5a5df8ea118f6e4a153a7c8cccd65a5ff8bff by Victor Stinner (Oren 
Milman) in branch 'master':
bpo-31740: Prevent refleaks when sqlite3.Connection.__init__() is called more 
than once (GH-3944)
https://github.com/python/cpython/commit/93c5a5df8ea118f6e4a153a7c8cccd65a5ff8bff


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-10 Thread Oren Milman

Oren Milman  added the comment:

(opened bpo-31746 for the crashes i mentioned)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-10 Thread Oren Milman

Change by Oren Milman :


--
keywords: +patch
pull_requests: +3917
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

Oren Milman  added the comment:

Ah, here also there are crashes when calling methods of uninitialized 
connection objects.

Should i fix this as part of this issue, or open another one?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

2017-10-09 Thread Oren Milman

New submission from Oren Milman :

The following code causes refleaks:
import sqlite3
connection = sqlite3.Connection.__new__(sqlite3.Connection)
connection.__init__('foo')
connection.__init__('foo')

This is because pysqlite_connection_init() (in Modules/_sqlite/connection.c)
doesn't decref (if needed) before assigning to various fields of `self`.

I would open a PR to fix this soon.

--
components: Extension Modules
messages: 303997
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: refleaks when calling sqlite3.Connection.__init__() more than once
type: resource usage
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com