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
What steps will reproduce the problem?
1. Call psutil function that returns named tuple (e.g. psutil.disk_partitions())
2. Try to call pickle.dumps on returned value
What is the expected output?
Should return pickle serialized version of named tuple.
What do you see instead?
Throws pickle error. This is because the namedtuple variables are not named the
same as the namedtuples themselves. For example:
nt_sysmeminfo = namedtuple('usage', 'total used free percent')
Pickle attempts to find the type that the namedtuple object is derived from via
the psutil._common.usage variable, which does not exist (since it is instead
located at psutil._common.nt_sysmeminfo). The problem can be corrected simply
by changing the above line to:
nt_sysmeminfo = namedtuple('nt_sysmeminfo', 'total used free percent')
What version of psutil are you using? What Python version?
Python 2.7.6, psutil 1.2.1
On what operating system? Is it 32bit or 64bit version?
Debian Jessie, 64-bit
Please provide any additional information below.
See above ^^^
From [email protected] on December 29, 2013 20:26:39
Original issue: http://code.google.com/p/psutil/issues/detail?id=461
The text was updated successfully, but these errors were encountered: