[issue40451] Unexpected sys.getrefcount(foo) output

2020-04-30 Thread Cristian Martinez de Morentin


New submission from Cristian Martinez de Morentin :

Hello, I have observed a strange behaviour regarding reference counting in 
Python 3.8.2 (Windows 64 bits). Perhaps, it could be linked to a memory leakage 
issue.

In the following code, I would not expect an output of '137' for the reference 
counter of the 'aux' object. Could you please explain this behaviour?

>>> import sys
>>> test = {'a': 0, 'b': 1}
>>> sys.getrefcount(test)
2
>>> aux = test['b']
>>> sys.getrefcount(aux)
137

Thank you so much.

--
components: Windows
messages: 367760
nosy: Cristian Martinez de Morentin, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Unexpected sys.getrefcount(foo) output
type: behavior
versions: Python 3.8

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



[issue40451] Unexpected sys.getrefcount(foo) output

2020-04-30 Thread Cristian Martinez de Morentin


Cristian Martinez de Morentin  added the comment:

OK, understood.

Thank you for your support!

--

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



[issue40699] Memory leak in threading library with Python 3.6-3.8

2020-05-20 Thread Cristian Martinez de Morentin


New submission from Cristian Martinez de Morentin :

Hi everyone,

I have found a memory leak when using Queue and Condition from threading 
library.

The issue can be reproduced with the following code:


import queue
import threading


class MemoryTest(threading.Thread):

def __init__(self):
threading.Thread.__init__(self)
self.queue = queue.Queue()
self.cv = threading.Condition()

def put(self, msg):
self.queue.put(msg)

with self.cv:
self.cv.notify()

def run(self):
while True:
while not self.queue.empty():
self.queue.get()
self.queue.task_done()

with self.cv:
self.cv.wait_for(lambda: not self.queue.empty())


If you run a MemoryTest object in another thread, by calling its start() 
method, and you send it messages by using its put() method, you will see how 
RAM memory usage starts increasing.

This behaviour has been observed in Windows (64 bits) with Python 3.6, 3.7 & 
3.8, but not with Python 3.5.

Thank you so much.

--
components: Windows
messages: 369443
nosy: Cristian Martinez de Morentin, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Memory leak in threading library with Python 3.6-3.8
type: resource usage
versions: Python 3.6, Python 3.7, Python 3.8

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



[issue42244] TimedRotatingFileHandler doesn’t handle the switch to/from DST when using daily/midnight rotation

2020-11-02 Thread Cristian Martinez de Morentin

New submission from Cristian Martinez de Morentin :

TimedRotatingFileHandler doesn’t handle the switch to/from DST when using 
daily/midnight rotation. When DST switch occurs, the previous day logging file 
is overwritten. The issue is present regardless of the value of the UTC flag 
(True/False).

For instance, we had a DST switch on october 24th in Spain and no logging file 
was created for that day. Instead, the data was written to october 23rd file.

--
components: Library (Lib)
messages: 380201
nosy: Cristian Martinez de Morentin
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler doesn’t handle the switch to/from DST when 
using daily/midnight rotation
type: behavior
versions: Python 3.8

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