Compare commits

...

No commits in common. "c8" and "c8-stream-3.8" have entirely different histories.

4 changed files with 213 additions and 159 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/psutil-5.4.3.tar.gz SOURCES/psutil-5.6.4.tar.gz

View File

@ -1 +1 @@
d1335bf6850e57fe6fa758caf74fced68ca66d92 SOURCES/psutil-5.4.3.tar.gz 038eebeacabe8f11215961aae307818e4c5af85b SOURCES/psutil-5.6.4.tar.gz

View File

@ -1,19 +1,19 @@
diff --git a/psutil/_psutil_aix.c b/psutil/_psutil_aix.c diff --git a/psutil/_psutil_aix.c b/psutil/_psutil_aix.c
index 916254d..37a1fb2 100644 index 8c055a4..9f58f60 100644
--- a/psutil/_psutil_aix.c --- a/psutil/_psutil_aix.c
+++ b/psutil/_psutil_aix.c +++ b/psutil/_psutil_aix.c
@@ -158,8 +158,8 @@ psutil_proc_name_and_args(PyObject *self, PyObject *args) { @@ -265,8 +265,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) {
py_retlist = Py_BuildValue("OO", py_name, py_args);
if (!py_retlist)
goto error; goto error;
- Py_DECREF(py_name); if (PyDict_SetItem(py_retdict, py_key, py_val))
- Py_DECREF(py_args); goto error;
+ Py_CLEAR(py_name); - Py_DECREF(py_key);
+ Py_CLEAR(py_args); - Py_DECREF(py_val);
return py_retlist; + Py_CLEAR(py_key);
+ Py_CLEAR(py_val);
error: }
@@ -389,10 +389,10 @@ psutil_users(PyObject *self, PyObject *args) { curvar = strchr(curvar, '\0') + 1;
}
@@ -510,10 +510,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -28,7 +28,7 @@ index 916254d..37a1fb2 100644
} }
endutxent(); endutxent();
@@ -449,9 +449,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -570,9 +570,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -42,10 +42,10 @@ index 916254d..37a1fb2 100644
} }
endmntent(file); endmntent(file);
diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c
index 9a2ed04..3dc04e0 100644 index b4264ce..7f1c492 100644
--- a/psutil/_psutil_bsd.c --- a/psutil/_psutil_bsd.c
+++ b/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c
@@ -152,7 +152,7 @@ psutil_pids(PyObject *self, PyObject *args) { @@ -154,7 +154,7 @@ psutil_pids(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_pid)) if (PyList_Append(py_retlist, py_pid))
goto error; goto error;
@ -118,10 +118,10 @@ index 9a2ed04..3dc04e0 100644
endutxent(); endutxent();
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c
index d1f0d14..00212ba 100644 index 717723d..0d16eb4 100644
--- a/psutil/_psutil_linux.c --- a/psutil/_psutil_linux.c
+++ b/psutil/_psutil_linux.c +++ b/psutil/_psutil_linux.c
@@ -232,9 +232,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -241,9 +241,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -134,7 +134,7 @@ index d1f0d14..00212ba 100644
} }
endmntent(file); endmntent(file);
return py_retlist; return py_retlist;
@@ -488,10 +488,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -454,10 +454,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -150,10 +150,19 @@ index d1f0d14..00212ba 100644
endutent(); endutent();
return py_retlist; return py_retlist;
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c
index 55dd64c..37f5284 100644 index d2ca94b..76ec0ee 100644
--- a/psutil/_psutil_osx.c --- a/psutil/_psutil_osx.c
+++ b/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c
@@ -795,7 +795,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { @@ -138,7 +138,7 @@ psutil_pids(PyObject *self, PyObject *args) {
goto error;
if (PyList_Append(py_retlist, py_pid))
goto error;
- Py_DECREF(py_pid);
+ Py_CLEAR(py_pid);
proclist++;
}
free(orig_address);
@@ -653,7 +653,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_cputime)) if (PyList_Append(py_retlist, py_cputime))
goto error; goto error;
@ -162,7 +171,7 @@ index 55dd64c..37f5284 100644
} }
ret = vm_deallocate(mach_task_self(), (vm_address_t)info_array, ret = vm_deallocate(mach_task_self(), (vm_address_t)info_array,
@@ -977,9 +977,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -841,9 +841,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -175,7 +184,7 @@ index 55dd64c..37f5284 100644
} }
free(fs); free(fs);
@@ -1055,7 +1055,6 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -911,7 +911,6 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
} }
for (j = 0; j < thread_count; j++) { for (j = 0; j < thread_count; j++) {
@ -183,7 +192,7 @@ index 55dd64c..37f5284 100644
thread_info_count = THREAD_INFO_MAX; thread_info_count = THREAD_INFO_MAX;
kr = thread_info(thread_list[j], THREAD_BASIC_INFO, kr = thread_info(thread_list[j], THREAD_BASIC_INFO,
(thread_info_t)thinfo_basic, &thread_info_count); (thread_info_t)thinfo_basic, &thread_info_count);
@@ -1076,7 +1075,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -934,7 +933,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -192,7 +201,7 @@ index 55dd64c..37f5284 100644
} }
ret = vm_deallocate(task, (vm_address_t)thread_list, ret = vm_deallocate(task, (vm_address_t)thread_list,
@@ -1185,10 +1184,8 @@ psutil_proc_open_files(PyObject *self, PyObject *args) { @@ -1043,10 +1042,8 @@ psutil_proc_open_files(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -205,7 +214,7 @@ index 55dd64c..37f5284 100644
// --- /construct python list // --- /construct python list
} }
} }
@@ -1368,7 +1365,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) { @@ -1226,7 +1223,7 @@ psutil_proc_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -214,7 +223,7 @@ index 55dd64c..37f5284 100644
} }
else if (family == AF_UNIX) { else if (family == AF_UNIX) {
py_laddr = PyUnicode_DecodeFSDefault( py_laddr = PyUnicode_DecodeFSDefault(
@@ -1390,9 +1387,9 @@ psutil_proc_connections(PyObject *self, PyObject *args) { @@ -1248,9 +1245,9 @@ psutil_proc_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -227,7 +236,7 @@ index 55dd64c..37f5284 100644
} }
} }
} }
@@ -1513,7 +1510,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -1370,7 +1367,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ifc_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ifc_name, py_ifc_info))
goto error; goto error;
@ -236,7 +245,7 @@ index 55dd64c..37f5284 100644
} }
else { else {
continue; continue;
@@ -1686,7 +1683,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -1543,7 +1540,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, disk_name, py_disk_info)) if (PyDict_SetItemString(py_retdict, disk_name, py_disk_info))
goto error; goto error;
@ -245,7 +254,7 @@ index 55dd64c..37f5284 100644
CFRelease(parent_dict); CFRelease(parent_dict);
IOObjectRelease(parent); IOObjectRelease(parent);
@@ -1748,10 +1745,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -1605,10 +1602,10 @@ psutil_users(PyObject *self, PyObject *args) {
endutxent(); endutxent();
goto error; goto error;
} }
@ -261,7 +270,7 @@ index 55dd64c..37f5284 100644
endutxent(); endutxent();
diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c diff --git a/psutil/_psutil_posix.c b/psutil/_psutil_posix.c
index cc82727..6d9212a 100644 index 209e787..aa60084 100644
--- a/psutil/_psutil_posix.c --- a/psutil/_psutil_posix.c
+++ b/psutil/_psutil_posix.c +++ b/psutil/_psutil_posix.c
@@ -324,11 +324,11 @@ psutil_net_if_addrs(PyObject* self, PyObject* args) { @@ -324,11 +324,11 @@ psutil_net_if_addrs(PyObject* self, PyObject* args) {
@ -282,10 +291,10 @@ index cc82727..6d9212a 100644
freeifaddrs(ifaddr); freeifaddrs(ifaddr);
diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c
index c667364..ff635f6 100644 index 919e76d..31d6f36 100644
--- a/psutil/_psutil_sunos.c --- a/psutil/_psutil_sunos.c
+++ b/psutil/_psutil_sunos.c +++ b/psutil/_psutil_sunos.c
@@ -214,8 +214,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) { @@ -300,8 +300,8 @@ psutil_proc_environ(PyObject *self, PyObject *args) {
if (PyDict_SetItem(py_retdict, py_envname, py_envval) < 0) if (PyDict_SetItem(py_retdict, py_envname, py_envval) < 0)
goto error; goto error;
@ -296,7 +305,7 @@ index c667364..ff635f6 100644
} }
psutil_free_cstrings_array(env, env_count); psutil_free_cstrings_array(env, env_count);
@@ -576,10 +576,10 @@ psutil_users(PyObject *self, PyObject *args) { @@ -655,10 +655,10 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -311,7 +320,7 @@ index c667364..ff635f6 100644
} }
endutxent(); endutxent();
@@ -635,9 +635,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -714,9 +714,9 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -324,7 +333,7 @@ index c667364..ff635f6 100644
} }
fclose(file); fclose(file);
return py_retlist; return py_retlist;
@@ -688,8 +688,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { @@ -767,8 +767,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_cputime)) if (PyList_Append(py_retlist, py_cputime))
goto error; goto error;
@ -334,7 +343,7 @@ index c667364..ff635f6 100644
} }
} }
@@ -745,7 +744,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -824,7 +823,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
if (PyDict_SetItemString(py_retdict, ksp->ks_name, if (PyDict_SetItemString(py_retdict, ksp->ks_name,
py_disk_info)) py_disk_info))
goto error; goto error;
@ -343,7 +352,7 @@ index c667364..ff635f6 100644
} }
} }
ksp = ksp->ks_next; ksp = ksp->ks_next;
@@ -880,8 +879,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) { @@ -959,8 +958,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -354,7 +363,7 @@ index c667364..ff635f6 100644
// increment pointer // increment pointer
p += 1; p += 1;
@@ -996,7 +995,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -1075,7 +1074,7 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info))
goto error; goto error;
@ -363,7 +372,7 @@ index c667364..ff635f6 100644
goto next; goto next;
next: next:
@@ -1189,7 +1188,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1273,7 +1272,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -372,34 +381,16 @@ index c667364..ff635f6 100644
} }
} }
#if defined(AF_INET6) #if defined(AF_INET6)
@@ -1232,7 +1231,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1287,7 +1286,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error;
if (PyList_Append(py_retlist, py_tuple))
goto error;
- Py_DECREF(py_tuple);
+ Py_CLEAR(py_tuple);
}
}
#endif
@@ -1240,7 +1239,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
else if (mibhdr->level == MIB2_UDP || mibhdr->level == MIB2_UDP_ENTRY) {
ude = (mib2_udpEntry_t *)databuf.buf;
num_ent = mibhdr->len / sizeof(mib2_udpEntry_t);
- assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr->len);
+ assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len);
for (i = 0; i < num_ent; i++, ude++) {
#ifdef NEW_MIB_COMPLIANT #ifdef NEW_MIB_COMPLIANT
processed_pid = ude->udpCreationProcess; processed_pid = tp6.tcp6ConnCreationProcess;
@@ -1271,7 +1270,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { #else
goto error; - processed_pid = 0;
if (PyList_Append(py_retlist, py_tuple)) + processed_pid = 0;
goto error; #endif
- Py_DECREF(py_tuple); if (pid != -1 && processed_pid != pid)
+ Py_CLEAR(py_tuple); continue;
} @@ -1316,14 +1315,14 @@ psutil_net_connections(PyObject *self, PyObject *args) {
}
#if defined(AF_INET6)
@@ -1304,7 +1303,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -408,7 +399,33 @@ index c667364..ff635f6 100644
} }
} }
#endif #endif
@@ -1477,7 +1476,7 @@ psutil_net_if_stats(PyObject* self, PyObject* args) { // UDPv4
else if (mibhdr.level == MIB2_UDP || mibhdr.level == MIB2_UDP_ENTRY) {
num_ent = mibhdr.len / sizeof(mib2_udpEntry_t);
- assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len);
+ assert(num_ent * sizeof(mib2_udpEntry_t) == mibhdr.len);
for (i = 0; i < num_ent; i++) {
memcpy(&ude, databuf.buf + i * sizeof ude, sizeof ude);
#ifdef NEW_MIB_COMPLIANT
@@ -1355,7 +1354,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error;
if (PyList_Append(py_retlist, py_tuple))
goto error;
- Py_DECREF(py_tuple);
+ Py_CLEAR(py_tuple);
}
}
#if defined(AF_INET6)
@@ -1388,7 +1387,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error;
if (PyList_Append(py_retlist, py_tuple))
goto error;
- Py_DECREF(py_tuple);
+ Py_CLEAR(py_tuple);
}
}
#endif
@@ -1561,7 +1560,7 @@ psutil_net_if_stats(PyObject* self, PyObject* args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info)) if (PyDict_SetItemString(py_retdict, ksp->ks_name, py_ifc_info))
goto error; goto error;
@ -418,10 +435,10 @@ index c667364..ff635f6 100644
} }
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index 81d1b4a..adef70c 100644 index beaba18..08b208d 100644
--- a/psutil/_psutil_windows.c --- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c
@@ -307,7 +307,7 @@ psutil_pids(PyObject *self, PyObject *args) { @@ -221,7 +221,7 @@ psutil_pids(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_pid)) if (PyList_Append(py_retlist, py_pid))
goto error; goto error;
@ -430,7 +447,7 @@ index 81d1b4a..adef70c 100644
} }
// free C array allocated for PIDs // free C array allocated for PIDs
@@ -1019,7 +1019,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) { @@ -1003,7 +1003,7 @@ psutil_per_cpu_times(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -439,7 +456,7 @@ index 81d1b4a..adef70c 100644
} }
free(sppi); free(sppi);
@@ -1237,7 +1237,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { @@ -1156,7 +1156,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -448,43 +465,43 @@ index 81d1b4a..adef70c 100644
CloseHandle(hThread); CloseHandle(hThread);
} }
@@ -1695,7 +1695,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1580,7 +1580,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
else { free(table);
@@ -1792,7 +1792,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1667,7 +1667,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
else { free(table);
@@ -1866,7 +1866,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1730,7 +1730,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
else { free(table);
@@ -1939,7 +1939,7 @@ psutil_net_connections(PyObject *self, PyObject *args) { @@ -1793,7 +1793,7 @@ psutil_net_connections(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_conn_tuple)) if (PyList_Append(py_retlist, py_conn_tuple))
goto error; goto error;
- Py_DECREF(py_conn_tuple); - Py_DECREF(py_conn_tuple);
+ Py_CLEAR(py_conn_tuple); + Py_CLEAR(py_conn_tuple);
} }
}
else { free(table);
@@ -2331,8 +2331,8 @@ psutil_net_io_counters(PyObject *self, PyObject *args) { @@ -2188,8 +2188,8 @@ psutil_net_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_nic_name, py_nic_info)) if (PyDict_SetItem(py_retdict, py_nic_name, py_nic_info))
goto error; goto error;
@ -495,7 +512,7 @@ index 81d1b4a..adef70c 100644
free(pIfRow); free(pIfRow);
pCurrAddresses = pCurrAddresses->Next; pCurrAddresses = pCurrAddresses->Next;
@@ -2446,7 +2446,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { @@ -2304,7 +2304,7 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItemString(py_retdict, szDeviceDisplay, py_tuple)) if (PyDict_SetItemString(py_retdict, szDeviceDisplay, py_tuple))
goto error; goto error;
@ -504,7 +521,7 @@ index 81d1b4a..adef70c 100644
next: next:
CloseHandle(hDevice); CloseHandle(hDevice);
@@ -2603,7 +2603,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -2461,7 +2461,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
} }
@ -513,7 +530,7 @@ index 81d1b4a..adef70c 100644
// Continue looking for more mount points // Continue looking for more mount points
mp_flag = FindNextVolumeMountPoint(mp_h, mp_buf, MAX_PATH); mp_flag = FindNextVolumeMountPoint(mp_h, mp_buf, MAX_PATH);
@@ -2628,7 +2628,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) { @@ -2486,7 +2486,7 @@ psutil_disk_partitions(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -522,7 +539,7 @@ index 81d1b4a..adef70c 100644
goto next; goto next;
next: next:
@@ -2758,9 +2758,9 @@ psutil_users(PyObject *self, PyObject *args) { @@ -2610,9 +2610,9 @@ psutil_users(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -535,7 +552,7 @@ index 81d1b4a..adef70c 100644
} }
WTSFreeMemory(sessions); WTSFreeMemory(sessions);
@@ -2992,8 +2992,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) { @@ -2838,8 +2838,8 @@ psutil_proc_memory_maps(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -544,9 +561,9 @@ index 81d1b4a..adef70c 100644
+ Py_CLEAR(py_tuple); + Py_CLEAR(py_tuple);
+ Py_CLEAR(py_str); + Py_CLEAR(py_str);
} }
previousAllocationBase = basicInfo.AllocationBase; previousAllocationBase = (ULONGLONG)basicInfo.AllocationBase;
baseAddress = (PCHAR)baseAddress + basicInfo.RegionSize; baseAddress = (PCHAR)baseAddress + basicInfo.RegionSize;
@@ -3043,8 +3043,8 @@ psutil_ppid_map(PyObject *self, PyObject *args) { @@ -2889,8 +2889,8 @@ psutil_ppid_map(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_pid, py_ppid)) if (PyDict_SetItem(py_retdict, py_pid, py_ppid))
goto error; goto error;
@ -557,7 +574,7 @@ index 81d1b4a..adef70c 100644
} while (Process32Next(handle, &pe)); } while (Process32Next(handle, &pe));
} }
@@ -3147,8 +3147,8 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) { @@ -2993,8 +2993,8 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -568,7 +585,7 @@ index 81d1b4a..adef70c 100644
} }
// find out the IP address associated with the NIC // find out the IP address associated with the NIC
@@ -3224,14 +3224,14 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) { @@ -3070,14 +3070,14 @@ psutil_net_if_addrs(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyList_Append(py_retlist, py_tuple)) if (PyList_Append(py_retlist, py_tuple))
goto error; goto error;
@ -587,7 +604,7 @@ index 81d1b4a..adef70c 100644
pCurrAddresses = pCurrAddresses->Next; pCurrAddresses = pCurrAddresses->Next;
} }
@@ -3351,8 +3351,8 @@ psutil_net_if_stats(PyObject *self, PyObject *args) { @@ -3197,8 +3197,8 @@ psutil_net_if_stats(PyObject *self, PyObject *args) {
goto error; goto error;
if (PyDict_SetItem(py_retdict, py_nic_name, py_ifc_info)) if (PyDict_SetItem(py_retdict, py_nic_name, py_ifc_info))
goto error; goto error;

View File

@ -1,19 +1,18 @@
%global srcname psutil %global srcname psutil
%global sum A process and system utilities module for Python %global sum A process and system utilities module for Python
%if 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
# Filter Python modules from Provides # Filter Python modules from Provides
%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$ %global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$
# Prepared for Python 2 removal
%bcond_with python2
# Possibility to disable tests
%bcond_with tests
Name: python-%{srcname} Name: python-%{srcname}
Version: 5.4.3 Version: 5.6.4
Release: 11%{?dist} Release: 4%{?dist}
Summary: %{sum} Summary: %{sum}
License: BSD License: BSD
@ -25,7 +24,33 @@ Source0: https://github.com/giampaolo/psutil/archive/release-%{version}.t
# and https://github.com/giampaolo/psutil/commit/3a9bccfd2c6d2e6538298cd3892058b1204056e0 # and https://github.com/giampaolo/psutil/commit/3a9bccfd2c6d2e6538298cd3892058b1204056e0
Patch0: CVE-2019-18874.patch Patch0: CVE-2019-18874.patch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
BuildRequires: gcc
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-rpm-macros
# Test dependencies
%if %{with tests}
BuildRequires: procps-ng BuildRequires: procps-ng
BuildRequires: python%{python3_pkgversion}-mock
%endif
%if %{with python2}
%if 0%{?fedora} < 32
BuildRequires: python2-mock
BuildRequires: python2-devel
BuildRequires: python2-ipaddress
%else
# This package has an exception to use Python 2 in Fedora 32+
# The exception is for chromium (chrome-remote-desktop)
# https://pagure.io/fesco/issue/2214
BuildRequires: python27
BuildRequires: python2-setuptools
%endif
%endif
%description %description
psutil is a module providing an interface for retrieving information on all psutil is a module providing an interface for retrieving information on all
@ -38,11 +63,6 @@ ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap.
%if %{with python2} %if %{with python2}
%package -n python2-%{srcname} %package -n python2-%{srcname}
Summary: %{sum} Summary: %{sum}
BuildRequires: python2-devel
BuildRequires: python2-mock
BuildRequires: python2-ipaddress
%{?python_provide:%python_provide python2-%{srcname}} %{?python_provide:%python_provide python2-%{srcname}}
Obsoletes: python-%{srcname} < 3.1.1-3 Obsoletes: python-%{srcname} < 3.1.1-3
@ -52,14 +72,10 @@ running processes and system utilization (CPU, memory, disks, network, users) in
a portable way by using Python 3, implementing many functionalities offered by a portable way by using Python 3, implementing many functionalities offered by
command line tools such as: ps, top, df, kill, free, lsof, free, netstat, command line tools such as: ps, top, df, kill, free, lsof, free, netstat,
ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap. ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap.
%endif # with python2 %endif
%package -n python%{python3_pkgversion}-psutil %package -n python%{python3_pkgversion}-psutil
Summary: %{sum} Summary: %{sum}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-mock
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-psutil %description -n python%{python3_pkgversion}-psutil
@ -84,23 +100,25 @@ done
%build %build
%if %{with python2} %if %{with python2}
%py2_build %py2_build
%endif # with python2 %endif
%py3_build %py3_build
%install %install
%if %{with python2} %if %{with python2}
%py2_install %py2_install
%endif # with python2 %endif
%py3_install %py3_install
#%check %check
# the main test target causes failures, investigating %if %{with tests}
%if %{with python2} %if %{with python2} && 0%{?fedora} < 32
#make test-memleaks PYTHON=%{__python2} make test-memleaks PYTHON=%{__python2}
%endif # with python2 %endif
#make test-memleaks PYTHON=%{__python3} make test-memleaks PYTHON=%{__python3}
%endif
%if %{with python2} %if %{with python2}
%files -n python2-%{srcname} %files -n python2-%{srcname}
@ -108,7 +126,7 @@ done
%doc CREDITS HISTORY.rst README.rst %doc CREDITS HISTORY.rst README.rst
%{python2_sitearch}/%{srcname}/ %{python2_sitearch}/%{srcname}/
%{python2_sitearch}/*.egg-info %{python2_sitearch}/*.egg-info
%endif # with python2 %endif
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
@ -119,28 +137,47 @@ done
%changelog %changelog
* Mon Jul 26 2021 Charalampos Stratakis <cstratak@redhat.com> - 5.4.3-11 * Mon Jul 26 2021 Charalampos Stratakis <cstratak@redhat.com> - 5.6.4-4
- Security fix for CVE-2019-18874: double free because of refcount mishandling - Security fix for CVE-2019-18874: double free because of refcount mishandling
Resolves: rhbz#1772014 Resolves: rhbz#1772014
* Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-10 * Thu Dec 12 2019 Tomas Orsava <torsava@redhat.com> - 5.6.4-3
- Smoke tests shall only run unicode tests - Exclude unsupported i686 arch
* Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-9 * Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 5.6.4-2
- Skip failing tests - Adjusted for Python 3.8 module in RHEL 8
* Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-8 * Wed Nov 06 2019 Lumír Balhar <lbalhar@redhat.com> - 5.6.4-1
- Add test content - New upstream release 5.6.4
- bcond for Python 2 subpackage and tests
- Enabled tests
* Mon Aug 05 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-7 * Sun Oct 06 2019 Kevin Fenzi <kevin@scrye.com> - 5.6.3-5
- Bump release - Add python2-setuptools to BuildRequires to fix egg info. Fixes bug #1750362
- Rebuild for rhel 8 gating for rhbz#1720647
* Tue Jun 18 2019 Athos Ribeiro <athos@redhat.com> - 5.4.3-6 * Tue Sep 03 2019 Miro Hrončok <mhroncok@redhat.com> - 5.6.3-4
- Bump release - Reduce unused build dependencies
* Tue Jun 05 2018 Charalampos Stratakis <cstratak@redhat.com> - 5.4.3-5 * Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 5.6.3-3
- Conditionalize the python2 subpackage - Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jun 30 2019 Kevin Fenzi <kevin@scrye.com> - 5.6.3-1
- Update to 5.6.3 Fixes bug #1567102
* Thu Feb 28 2019 Yatin Karel <ykarel@redhat.com> - 5.5.1-1
- Update to 5.5.1 (Resolves #1567102)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 5.4.3-5
- Rebuilt for Python 3.7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-4 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild