You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there a specific reason memory_usage return None when stream=True ? #397
I'm using stream + retval so my script is crashing since i'm getting a None object when doing mem_usage,res=memory_usage((func,args,kwargs),stream=True, retval=True
My current fix is just removing the if stream : return None, but I would like to know if it will bite me later or if it's fine ?
I'm really not familiar with memory usage so maybe there is a specific reason.
Thanks
Is there a specific reason memory_usage return None when stream=True ?
@PveOnly Looking at the method you describe, I think stream is not intended to receive a boolean, but instead a file or a file-like object.
stream : File
if stream is a File opened with write access, then results are written
to this file instead of stored in memory and returned at the end of
the subprocess. Useful for long-running processes.
Implies timestamps=True.
So if you supply something as the stream parameter, it will try to write output there, instead of returning it.
Activity
bartbroere commentedon Jun 13, 2024
@PveOnly Looking at the method you describe, I think
streamis not intended to receive a boolean, but instead a file or a file-like object.So if you supply something as the
streamparameter, it will try to write output there, instead of returning it.In your example that could be something like: