[issue35322] test_datetime leaks memory on Windows

2018-11-28 Thread STINNER Victor


STINNER Victor  added the comment:

I tested manually that "python -m test test_datetime -R 3:3" pass on 3.7 and 
master branches.

Note: PyUnicode_DecodeLocale() is still untested, only _Py_DecodeLocaleEx() and 
_Py_EncodeLocaleEx() are tested.

--
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



[issue35322] test_datetime leaks memory on Windows

2018-11-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 85ab974f78c0ebcfa611639864640d0273eb5466 by Victor Stinner in 
branch '3.7':
bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759) (GH-10761)
https://github.com/python/cpython/commit/85ab974f78c0ebcfa611639864640d0273eb5466


--

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-28 Thread STINNER Victor


STINNER Victor  added the comment:

bpo-34482 added the test in test_datetime which triggered the bug.

--

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10010
stage:  -> patch review

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6 by Victor Stinner in 
branch 'master':
bpo-34523, bpo-35322: Fix unicode_encode_locale() (GH-10759)
https://github.com/python/cpython/commit/bde9d6bbb46ca59bcee5d5060adaa33c3ffee3a6


--

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I see. unicode_encode_locale() has multiple bugs in the code handling 
errors :-(

I don't think that my commit 3d4226a832cabc630402589cc671cc4035d504e5 
introduced the memory leak triggered by test_datetime, it seems older. Python 
3.7 also has the bug in unicode_encode_locale(). The memory leak has been 
introduced by commit 7ed7aead9503102d2ed316175f198104e0cd674c, also written by 
me :-)

--
stage: patch review -> 
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



[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Correction: the fall-through in "else if (res == -3)" clause doesn't cause a 
memory leak, but still results in usage of uninitialized 'str'.

--

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

This is because of a leak of 'wstr' at 
https://github.com/python/cpython/blob/1005c84535191a72ebb7587d8c5636a065b7ed79/Objects/unicodeobject.c#L3476
 .

There is another leak and usage of uninitialized 'str' because the following 
"else if" clause doesn't have a 'return' (probably due to copy-paste from 
unicode_decode_locale() in 3d4226a832cabc630402589cc671cc4035d504e5).

--
nosy: +izbyshev

___
Python tracker 

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



[issue35322] test_datetime leaks memory on Windows

2018-11-27 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Library (Lib)
title: test_datetime leaks memory -> test_datetime leaks memory on Windows
versions: +Python 3.8

___
Python tracker 

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